[cpl-plugin-hawki] 25/39: New upstream version 1.8.12

Ole Streicher olebole-guest at alioth.debian.org
Mon Sep 16 19:36:14 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-hawki.

commit 8feebd77c598f44c1630ebaeec91da656911ae8b
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Tue May 7 15:52:45 2013 +0200

    New upstream version 1.8.12
---
 Makefile.in                                        |  242 +-
 aclocal.m4                                         |  460 ++-
 admin/compile                                      |  227 +-
 admin/config.guess                                 |  261 +-
 admin/config.sub                                   |  213 +-
 admin/depcomp                                      |  189 +-
 admin/install-sh                                   |   35 +-
 admin/ltmain.sh                                    |   93 +-
 admin/missing                                      |  148 +-
 calib/dic/ESO-DFS-DIC.HAWKI_QC                     |  948 +++++
 calib/dic/ESO-VLT-DIC.HAWKI_CFG                    |  929 +++++
 calib/dic/ESO-VLT-DIC.HAWKI_ICS                    | 1057 +++++
 calib/dic/ESO-VLT-DIC.HAWKI_OS                     |  409 ++
 calib/gasgano/config/HAWKI.prefs                   |   53 +
 calib/gasgano/config/HAWKI.prefs.in                |   53 +
 calib/gasgano/config/hawki.oca                     |  375 ++
 calib/gasgano/config/hawki_wkf.oca                 |  264 ++
 configure                                          |  782 ++--
 configure.ac                                       |    4 +-
 hawki/Makefile.am                                  |    5 +-
 hawki/Makefile.in                                  |  183 +-
 hawki/hawki_alloc.c                                |    2 +-
 hawki/hawki_alloc.h                                |    2 +-
 hawki/hawki_bkg.cc                                 |    2 +-
 hawki/hawki_bkg.h                                  |    2 +-
 hawki/hawki_calib.c                                |    2 +-
 hawki/hawki_calib.h                                |    2 +-
 hawki/hawki_combine.c                              |    2 +-
 hawki/hawki_combine.h                              |    2 +-
 hawki/hawki_dfs.c                                  |    2 +-
 hawki/hawki_dfs.h                                  |    2 +-
 hawki/hawki_distortion.c                           |    2 +-
 hawki/hawki_distortion.h                           |    2 +-
 hawki/hawki_image.c                                |    2 +-
 hawki/hawki_image.h                                |    2 +-
 hawki/hawki_image_stats.c                          |    2 +-
 hawki/hawki_image_stats.h                          |    2 +-
 hawki/hawki_load.c                                 |    2 +-
 hawki/hawki_load.h                                 |    2 +-
 hawki/hawki_mask.c                                 |    2 +-
 hawki/hawki_mask.h                                 |    2 +-
 hawki/hawki_match_cats.c                           |    2 +-
 hawki/hawki_match_cats.h                           |    2 +-
 hawki/hawki_obj_det.c                              |    2 +-
 hawki/hawki_obj_det.h                              |    2 +-
 hawki/hawki_pfits.c                                |   40 +-
 hawki/hawki_pfits.h                                |   10 +-
 hawki/hawki_properties_tel.c                       |    2 +-
 hawki/hawki_properties_tel.h                       |    2 +-
 hawki/hawki_saa.c                                  |    2 +-
 hawki/hawki_saa.h                                  |    2 +-
 hawki/hawki_save.c                                 |    2 +-
 hawki/hawki_save.h                                 |    2 +-
 hawki/hawki_utils.c                                |    2 +-
 hawki/hawki_utils.h                                |    2 +-
 hawki/hawki_variance.c                             |    2 +-
 hawki/hawki_variance.h                             |    2 +-
 hawki/tests/Makefile.am                            |    8 +-
 hawki/tests/Makefile.in                            |   99 +-
 hawki/tests/hawki_image-test.c                     |    9 +-
 html/annotated.html                                |   37 +-
 html/bc_s.png                                      |  Bin 677 -> 676 bytes
 html/bdwn.png                                      |  Bin 0 -> 147 bytes
 html/classes.html                                  |   42 +-
 html/closed.png                                    |  Bin 126 -> 132 bytes
 html/dir_0bffb7ec63ae446defe2a91d65f62d26.html     |  130 +
 html/dir_38d6ca2a11734cc7d27e97ffc4930ba5.html     |   72 -
 html/dir_8028944ee79da36d001a678d64addfcc.html     |   87 -
 html/dir_b351cdfeb4656d7d168dc72b273024e7.html     |  100 +
 html/dirs.html                                     |   47 -
 html/doxygen.css                                   |  591 ++-
 html/doxygen.png                                   |  Bin 3942 -> 3779 bytes
 html/dynsections.js                                |   97 +
 html/files.html                                    |  145 +-
 html/form_0.png                                    |  Bin 676 -> 735 bytes
 html/form_1.png                                    |  Bin 2144 -> 2322 bytes
 html/form_2.png                                    |  Bin 352 -> 370 bytes
 html/form_3.png                                    |  Bin 197 -> 197 bytes
 html/form_4.png                                    |  Bin 338 -> 350 bytes
 html/form_5.png                                    |  Bin 215 -> 216 bytes
 html/form_6.png                                    |  Bin 264 -> 268 bytes
 html/form_7.png                                    |  Bin 271 -> 281 bytes
 html/form_8.png                                    |  Bin 437 -> 447 bytes
 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/group__hawki__alloc.html                      |   64 +-
 html/group__hawki__calib.html                      |  134 +-
 html/group__hawki__combine.html                    |   33 +-
 html/group__hawki__dfs.html                        |   51 +-
 html/group__hawki__distortion.html                 |  222 +-
 html/group__hawki__image.html                      |   48 +-
 html/group__hawki__image__stats.html               |  106 +-
 html/group__hawki__load.html                       |  292 +-
 html/group__hawki__mask.html                       |   44 +-
 html/group__hawki__obj__det.html                   |   64 +-
 html/group__hawki__pfits.html                      |  936 +++--
 html/group__hawki__properties__tel.html            |   66 +-
 html/group__hawki__save.html                       |  134 +-
 html/group__hawki__utils.html                      |  383 +-
 html/group__hawki__variance.html                   |   64 +-
 html/hawki__alloc_8c_source.html                   |  175 +-
 html/hawki__alloc_8h_source.html                   |  119 +-
 html/hawki__bkg_8h_source.html                     |  239 +-
 html/hawki__cal__dark_8c_source.html               | 1715 ++++----
 html/hawki__cal__distortion_8c_source.html         | 2625 ++++++------
 html/hawki__cal__flat_8c_source.html               | 3765 ++++++++---------
 html/hawki__cal__illum_8c_source.html              | 1607 ++++----
 html/hawki__cal__lingain_8c_source.html            |  395 +-
 html/hawki__cal__zpoint_8c_source.html             | 3678 ++++++++---------
 html/hawki__calib_8c_source.html                   |  833 ++--
 html/hawki__calib_8h_source.html                   |  177 +-
 html/hawki__combine_8c_source.html                 |  133 +-
 html/hawki__combine_8h_source.html                 |  109 +-
 html/hawki__dfs_8c_source.html                     |  245 +-
 html/hawki__dfs_8h_source.html                     | 1053 ++---
 html/hawki__distortion_8c_source.html              | 2139 +++++-----
 html/hawki__distortion_8h_source.html              |  295 +-
 html/hawki__image_8c_source.html                   |  265 +-
 html/hawki__image_8h_source.html                   |  131 +-
 html/hawki__image__stats_8c_source.html            | 1173 +++---
 html/hawki__image__stats_8h_source.html            |  173 +-
 html/hawki__load_8c_source.html                    | 1597 ++++----
 html/hawki__load_8h_source.html                    |  157 +-
 html/hawki__mask_8c_source.html                    |  283 +-
 html/hawki__mask_8h_source.html                    |  125 +-
 html/hawki__match__cats_8c_source.html             |  199 +-
 html/hawki__match__cats_8h_source.html             |  125 +-
 html/hawki__obj__det_8c_source.html                |  245 +-
 html/hawki__obj__det_8h_source.html                |  119 +-
 html/hawki__pfits_8c_source.html                   |  947 ++---
 html/hawki__pfits_8h_source.html                   |  235 +-
 html/hawki__properties__tel_8c_source.html         | 1623 ++++----
 html/hawki__properties__tel_8h_source.html         |  135 +-
 html/hawki__saa_8c_source.html                     |  277 +-
 html/hawki__saa_8h_source.html                     |  143 +-
 html/hawki__save_8c_source.html                    | 1233 +++---
 html/hawki__save_8h_source.html                    |  245 +-
 html/hawki__sci__jitter_8c_source.html             | 4331 ++++++++++----------
 html/hawki__step__apply__dist_8c_source.html       |  979 ++---
 html/hawki__step__basic__calib_8c_source.html      | 1087 ++---
 html/hawki__step__combine_8c_source.html           | 1978 ++++-----
 html/hawki__step__detect__obj_8c_source.html       | 1881 ++++-----
 html/hawki__step__photom__2mass_8c_source.html     | 1886 ++++-----
 html/hawki__step__refine__offsets_8c_source.html   | 1553 +++----
 html/hawki__step__stats_8c_source.html             |  815 ++--
 html/hawki__step__stitch_8c_source.html            |  670 +--
 html/hawki__step__subtract__bkg_8c_source.html     | 1005 ++---
 html/hawki__tec__filtchk_8c_source.html            |  706 ++--
 html/hawki__util__extinction_8c_source.html        | 1022 ++---
 html/hawki__util__gendist_8c_source.html           | 1106 ++---
 html/hawki__util__stdstars_8c_source.html          |  569 +--
 html/hawki__utils_8c_source.html                   | 2235 +++++-----
 html/hawki__utils_8h_source.html                   |  347 +-
 html/hawki__variance_8c_source.html                |  275 +-
 html/hawki__variance_8h_source.html                |  149 +-
 html/index.html                                    |   31 +-
 html/jquery.js                                     |   62 +-
 html/modules.html                                  |   67 +-
 html/nav_f.png                                     |  Bin 159 -> 153 bytes
 html/nav_g.png                                     |  Bin 0 -> 108 bytes
 html/nav_h.png                                     |  Bin 97 -> 98 bytes
 html/open.png                                      |  Bin 118 -> 123 bytes
 ...__hawki__distortion__obj__function__args__.html |   37 +-
 html/sync_off.png                                  |  Bin 0 -> 853 bytes
 html/sync_on.png                                   |  Bin 0 -> 845 bytes
 html/tab_a.png                                     |  Bin 140 -> 142 bytes
 html/tab_b.png                                     |  Bin 178 -> 169 bytes
 html/tab_h.png                                     |  Bin 192 -> 177 bytes
 html/tab_s.png                                     |  Bin 189 -> 184 bytes
 html/tabs.css                                      |    1 +
 irplib/Makefile.am                                 |    2 +-
 irplib/Makefile.in                                 |  187 +-
 irplib/irplib_calib.c                              |    2 +-
 irplib/irplib_calib.h                              |    2 +-
 irplib/irplib_cat.c                                |    2 +-
 irplib/irplib_cat.h                                |    2 +-
 irplib/irplib_distortion.c                         |   12 +-
 irplib/irplib_distortion.h                         |   12 +-
 irplib/irplib_flat.c                               |    2 +-
 irplib/irplib_flat.h                               |    2 +-
 irplib/irplib_framelist.c                          |    2 +-
 irplib/irplib_framelist.h                          |    2 +-
 irplib/irplib_hist.c                               |    2 +-
 irplib/irplib_hist.h                               |    2 +-
 irplib/irplib_ksigma_clip.c                        |    2 +-
 irplib/irplib_ksigma_clip.h                        |    2 +-
 irplib/irplib_ksigma_clip_body.h                   |    2 +-
 irplib/irplib_match_cats.c                         |    2 +-
 irplib/irplib_match_cats.h                         |    2 +-
 irplib/irplib_mkmaster.c                           |    2 +-
 irplib/irplib_mkmaster.h                           |    2 +-
 irplib/irplib_oddeven.c                            |    2 +-
 irplib/irplib_oddeven.h                            |    2 +-
 irplib/irplib_plugin.c                             |    2 +-
 irplib/irplib_plugin.h                             |    2 +-
 irplib/irplib_polynomial.c                         |   12 +-
 irplib/irplib_polynomial.h                         |   12 +-
 irplib/irplib_ppm.c                                |    2 +-
 irplib/irplib_ppm.h                                |    2 +-
 irplib/irplib_slitpos.c                            |    2 +-
 irplib/irplib_slitpos.h                            |    2 +-
 irplib/irplib_spectrum.c                           |    2 +-
 irplib/irplib_spectrum.h                           |    2 +-
 irplib/irplib_stdstar.c                            |    2 +-
 irplib/irplib_stdstar.h                            |    2 +-
 irplib/irplib_strehl.c                             |    2 +-
 irplib/irplib_strehl.h                             |    2 +-
 irplib/irplib_utils.c                              |    2 +-
 irplib/irplib_utils.h                              |    2 +-
 irplib/irplib_wavecal.c                            |    2 +-
 irplib/irplib_wavecal.h                            |    2 +-
 irplib/irplib_wavecal_impl.h                       |    2 +-
 irplib/irplib_wcs.c                                |    2 +-
 irplib/irplib_wcs.h                                |    2 +-
 irplib/irplib_wlxcorr.c                            |   12 +-
 irplib/irplib_wlxcorr.h                            |   12 +-
 irplib/tests/Makefile.am                           |   11 +-
 irplib/tests/Makefile.in                           |  124 +-
 irplib/tests/irplib_cat-test.c                     |   12 +-
 irplib/tests/irplib_polynomial-test.c              |   16 +-
 irplib/tests/irplib_wcs-test.c                     |   12 +-
 irplib/tests/irplib_wlxcorr-test.c                 |   12 +-
 m4macros/cpl.m4                                    |  104 +-
 m4macros/eso.m4                                    |   40 +
 m4macros/libtool.m4                                |  265 +-
 m4macros/ltoptions.m4                              |   19 +-
 m4macros/ltversion.m4                              |   10 +-
 m4macros/openmp.m4                                 |   40 +-
 recipes/Makefile.am                                |    2 +-
 recipes/Makefile.in                                |  146 +-
 recipes/hawki_cal_dark.c                           |    2 +-
 recipes/hawki_cal_distortion.c                     |   56 +-
 recipes/hawki_cal_flat.c                           |    2 +-
 recipes/hawki_cal_zpoint.c                         |   21 +-
 recipes/hawki_sci_jitter.c                         |   22 +-
 recipes/hawki_step_apply_dist.c                    |    2 +-
 recipes/hawki_step_basic_calib.c                   |    2 +-
 recipes/hawki_step_combine.c                       |   21 +-
 recipes/hawki_step_compute_bkg.cc                  |   21 +-
 recipes/hawki_step_detect_obj.c                    |    2 +-
 recipes/hawki_step_photom_2mass.c                  |   29 +-
 recipes/hawki_step_refine_offsets.c                |    2 +-
 recipes/hawki_step_stats.c                         |    2 +-
 recipes/hawki_step_stitch.c                        |   13 +-
 recipes/hawki_step_subtract_bkg.c                  |    2 +-
 recipes/hawki_tec_filtchk.c                        |   13 +-
 recipes/hawki_util_extinction.c                    |   13 +-
 recipes/hawki_util_gendist.c                       |   13 +-
 recipes/hawki_util_stdstars.c                      |    2 +-
 reflex/Makefile.in                                 |   68 +-
 regtests/Makefile.am                               |    2 +-
 regtests/Makefile.in                               |  147 +-
 regtests/tests/Makefile.am                         |    2 +-
 regtests/tests/Makefile.in                         |   44 +-
 setup                                              |    2 +-
 tests/Makefile.am                                  |    5 +-
 tests/Makefile.in                                  |   70 +-
 271 files changed, 35413 insertions(+), 28994 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 08a7f6e..61d3de8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +15,23 @@
 @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@
@@ -37,11 +53,15 @@ 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 COPYING.LIB ChangeLog INSTALL NEWS TODO \
-	admin/compile 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 COPYING.LIB \
+	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 \
@@ -71,6 +91,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-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/||"`;; \
@@ -92,23 +117,33 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)"
 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 \
-	distdir dist dist-all distcheck
+	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,'; \
@@ -136,7 +171,10 @@ am__relativize = \
   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@
 AMTAR = @AMTAR@
@@ -322,7 +360,7 @@ 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 \
@@ -347,6 +385,7 @@ 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
@@ -358,10 +397,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) 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
@@ -388,8 +425,11 @@ distclean-libtool:
 	-rm -f libtool config.lt
 install-pipedocsDATA: $(pipedocs_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(pipedocsdir)" || $(MKDIR_P) "$(DESTDIR)$(pipedocsdir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -403,17 +443,15 @@ uninstall-pipedocsDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(pipedocs_DATA)'; test -n "$(pipedocsdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pipedocsdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pipedocsdir)" && rm -f $$files
+	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):
+# 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 \
@@ -423,7 +461,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; \
@@ -437,37 +479,6 @@ $(RECURSIVE_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-$(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; \
-	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; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -476,6 +487,10 @@ 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)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -539,8 +554,32 @@ GTAGS:
 	  && $(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)
@@ -577,13 +616,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || 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; \
@@ -615,36 +651,36 @@ distdir: $(DISTFILES)
 	|| 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-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__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 -c >$(distdir).tar.xz
-	$(am__remove_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
@@ -655,8 +691,8 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -666,7 +702,7 @@ distcheck: dist
 	*.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)
@@ -676,6 +712,7 @@ distcheck: dist
 	  && 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 \
@@ -699,13 +736,21 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@$(am__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)"; \
@@ -739,10 +784,15 @@ 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:
@@ -823,12 +873,14 @@ ps-am:
 uninstall-am: uninstall-local uninstall-pipedocsDATA
 
 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-strip tags-recursive
+	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-generic \
-	clean-libtool clean-local ctags ctags-recursive dist dist-all \
-	dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \
+	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 \
diff --git a/aclocal.m4 b/aclocal.m4
index 2088c59..a4e40b1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- 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, 2006, 2007, 2008, 2009  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.
@@ -13,11 +13,11 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+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'.])])
+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)
@@ -47,7 +47,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+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])
@@ -93,7 +94,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -141,9 +143,9 @@ 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 "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $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
@@ -156,7 +158,7 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])
+_PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
      	AC_MSG_RESULT([no])
@@ -167,7 +169,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
         ])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
@@ -177,22 +179,64 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  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.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[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.11.1], [],
+m4_if([$1], [1.12.2], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -208,22 +252,24 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # 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.11.1])dnl
+[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
@@ -242,7 +288,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_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,
@@ -268,22 +314,21 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# 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 9
+# 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_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
@@ -302,16 +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, 2006, 2009
-# 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 10
+# 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
@@ -321,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
@@ -334,12 +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], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$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],
@@ -347,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.
@@ -387,16 +433,16 @@ 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"
+    # 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
+    # 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
@@ -405,16 +451,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
       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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -462,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
@@ -472,28 +518,34 @@ 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])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, 2008
-# 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 5
+# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
@@ -512,7 +564,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # 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
+    # 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.
@@ -524,21 +576,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # 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
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -556,7 +606,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # 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],
@@ -565,55 +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])
 
-# Copyright (C) 1996, 1997, 2000, 2001, 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 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 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 16
+# 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.
@@ -659,31 +695,41 @@ 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], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+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_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([AM_PROG_MKDIR_P])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
@@ -694,28 +740,35 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 			     [_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)],
-		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_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 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 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],
@@ -743,12 +796,14 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  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.
@@ -762,9 +817,9 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+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,
@@ -788,20 +843,19 @@ 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, 2008
-# 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 5
+# 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
+# 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],
 [m4_case(m4_default([$1], [disable]),
@@ -809,13 +863,14 @@ AC_DEFUN([AM_MAINTAINER_MODE],
        [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 am_maintainer_other maintainer-specific portions of Makefiles])
+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],
-[  --][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]))
+    [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])
   MAINT=$MAINTAINER_MODE_TRUE
@@ -827,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, 2009  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 4
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -852,7 +907,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# 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
@@ -877,8 +932,7 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# 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,
@@ -914,14 +968,13 @@ m4_define([AC_PROG_CC],
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# 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 6
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -951,45 +1004,19 @@ 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, 2006  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 for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  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 4
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -997,13 +1024,13 @@ 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],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -1016,22 +1043,18 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# 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 5
+# 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
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -1042,32 +1065,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# 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
@@ -1077,43 +1108,61 @@ 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="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# 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 2
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -1122,24 +1171,24 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 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
@@ -1150,10 +1199,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # 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])
@@ -1161,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
diff --git a/admin/compile b/admin/compile
index c0096a7..7b4a9a7 100755
--- a/admin/compile
+++ b/admin/compile
@@ -1,10 +1,9 @@
 #! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
+# Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2012-03-05.13; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
-# Foundation, Inc.
+# 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
@@ -29,21 +28,219 @@ scriptversion=2009-10-06.20; # UTC
 # 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
+     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
+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'.
+right script to run: please start by reading the file 'INSTALL'.
 
 Report bugs to <bug-automake at gnu.org>.
 EOF
@@ -53,11 +250,13 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
@@ -66,8 +265,8 @@ do
   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.
+	# 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)
@@ -94,10 +293,10 @@ do
 done
 
 if test -z "$ofile" || test -z "$cfile"; then
-  # If no `-o' option was seen then we might have been invoked from a
+  # 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
+  # '.c' file was seen then we are probably linking.  That is also
   # ok.
   exec "$@"
 fi
@@ -106,7 +305,7 @@ fi
 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
+# 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
diff --git a/admin/config.guess b/admin/config.guess
index dc84c68..c0adba9 100755
--- a/admin/config.guess
+++ b/admin/config.guess
@@ -1,10 +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, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+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
@@ -17,9 +17,7 @@ timestamp='2009-11-20'
 # 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
@@ -56,8 +54,9 @@ 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, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -144,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
@@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -223,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
@@ -269,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
@@ -295,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}
@@ -394,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 ;;
@@ -480,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 ] || \
@@ -494,7 +496,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -551,7 +553,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[456])
+    *: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
@@ -594,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
@@ -730,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 ;;
@@ -769,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}
@@ -788,13 +790,12 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-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_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
@@ -803,15 +804,18 @@ EOF
     *: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 ;;
     *:Interix*:*)
-    	case ${UNAME_MACHINE} in
+	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
@@ -857,6 +861,13 @@ 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 ;;
@@ -866,7 +877,7 @@ EOF
 	  EV6)   UNAME_MACHINE=alphaev6 ;;
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+	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}
@@ -878,20 +889,29 @@ EOF
 	then
 	    echo ${UNAME_MACHINE}-unknown-linux-gnu
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    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
@@ -933,7 +953,7 @@ EOF
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     padre:Linux:*:*)
 	echo sparc-unknown-linux-gnu
@@ -959,7 +979,7 @@ EOF
 	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
@@ -967,14 +987,17 @@ 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
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -983,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:*:*)
@@ -1019,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 ;;
@@ -1047,13 +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 i586.
+	# 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 ;;
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1088,8 +1111,8 @@ 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 \
@@ -1132,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
@@ -1161,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 ;;
@@ -1230,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:*:*)
@@ -1275,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 ;;
@@ -1299,6 +1325,9 @@ EOF
     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
@@ -1321,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
 
diff --git a/admin/config.sub b/admin/config.sub
index 2a55a50..6205f84 100755
--- a/admin/config.sub
+++ b/admin/config.sub
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+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
@@ -21,9 +21,7 @@ timestamp='2009-11-20'
 # 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
@@ -75,8 +73,9 @@ 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, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,13 +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-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  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 ]
@@ -156,8 +160,8 @@ case $os in
 		os=
 		basic_machine=$1
 		;;
-        -bluegene*)
-	        os=-cnk
+	-bluegene*)
+		os=-cnk
 		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
@@ -173,10 +177,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -221,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
 		;;
@@ -245,17 +255,22 @@ 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 | avr32 \
+        | be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
@@ -281,29 +296,39 @@ case $basic_machine in
 	| 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 \
-	| rx \
+	| 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 | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -313,6 +338,21 @@ case $basic_machine in
 		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
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -327,21 +367,25 @@ 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-* | 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-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -367,25 +411,29 @@ case $basic_machine in
 	| mmix-* \
 	| 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-* | rx-* \
+	| 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-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -410,7 +458,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -480,11 +528,20 @@ case $basic_machine in
 		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)
+	cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -516,7 +573,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16)
+	cr16 | cr16-*)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -674,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
@@ -732,7 +788,7 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-        microblaze)
+	microblaze)
 		basic_machine=microblaze-xilinx
 		;;
 	mingw32)
@@ -771,10 +827,18 @@ case $basic_machine in
 	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
@@ -839,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
 		;;
@@ -921,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
@@ -1017,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
 		;;
@@ -1073,20 +1147,8 @@ 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=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1156,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
@@ -1253,11 +1318,11 @@ 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
+	-auroraux)
+		os=-auroraux
 		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1293,8 +1358,9 @@ case $os in
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -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* \
@@ -1341,7 +1407,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1390,7 +1456,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1435,6 +1501,8 @@ case $os in
 	-dicos*)
 		os=-dicos
 		;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1457,10 +1525,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+	score-*)
 		os=-elf
 		;;
-        spu-*)
+	spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1472,8 +1540,20 @@ 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-*)
@@ -1493,14 +1573,11 @@ 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-*)
+	mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1527,7 +1604,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
diff --git a/admin/depcomp b/admin/depcomp
index df8eea7..debb6ff 100755
--- a/admin/depcomp
+++ b/admin/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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
@@ -28,7 +27,7 @@ scriptversion=2009-04-28.21; # UTC
 
 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*)
@@ -40,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>.
@@ -57,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
@@ -90,10 +95,24 @@ 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"
+   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
@@ -148,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"
   ;;
 
@@ -193,18 +213,15 @@ 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"
+    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"
   else
@@ -216,10 +233,17 @@ 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.
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
@@ -249,12 +273,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # 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:'.
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
     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
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -265,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 :
@@ -290,15 +316,21 @@ 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"
   ;;
 
@@ -334,7 +366,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
 	       s/^ *//
 	       s/ \\*$//
@@ -349,9 +381,9 @@ hp2)
 
 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=
@@ -397,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.
@@ -422,7 +499,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,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"
@@ -503,9 +579,10 @@ makedepend)
   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"
@@ -525,7 +602,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -594,8 +671,8 @@ msvisualcpp)
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$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"
   ;;
diff --git a/admin/install-sh b/admin/install-sh
index 6781b98..377bb86 100755
--- a/admin/install-sh
+++ b/admin/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+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,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # 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
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -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;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     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
 
@@ -194,13 +202,17 @@ if test $# -eq 0; 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
-  trap '(exit $?); exit' 1 2 13 15
+  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.
@@ -228,9 +240,9 @@ 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
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
 	      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-writeable bit of parent directory when it shouldn't.
+		   # 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
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/admin/ltmain.sh b/admin/ltmain.sh
old mode 100755
new mode 100644
index 78cf017..63ae69d
--- a/admin/ltmain.sh
+++ b/admin/ltmain.sh
@@ -1,9 +1,9 @@
 
-# libtool (GNU libtool) 2.4
+# 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 Free Software Foundation, Inc.
+# 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.
 
@@ -41,6 +41,7 @@
 #       --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
@@ -69,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4
+#         $progname:	(GNU libtool) 2.4.2
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -79,9 +80,9 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4
+VERSION=2.4.2
 TIMESTAMP=""
-package_revision=1.3293
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
 
 : ${CP="cp -f"}
 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -387,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
 	s*\$LTCFLAGS*'"$LTCFLAGS"'*
 	s*\$LD*'"$LD"'*
 	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
 	p
 	d
      }
@@ -1052,6 +1048,7 @@ opt_finish=false
 opt_help=false
 opt_help_all=false
 opt_silent=:
+opt_warning=:
 opt_verbose=:
 opt_silent=false
 opt_verbose=false
@@ -1120,6 +1117,10 @@ esac
 			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"
@@ -2059,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
 
       # 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 $oldlib" 'exit $?'
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
 	  # 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*)
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
@@ -3982,14 +3985,17 @@ func_exec_program_core ()
 # launches target application with the remaining arguments.
 func_exec_program ()
 {
-  for lt_wr_arg
-  do
-    case \$lt_wr_arg in
-    --lt-*) ;;
-    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-    esac
-    shift
-  done
+  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+\"\$@\"}
 }
 
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
 {
 EOF
 	    func_emit_wrapper yes |
-              $SED -e 's/\([\\"]\)/\\\1/g' \
-	           -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
-
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
             cat <<"EOF"
 }
 EOF
@@ -5643,7 +5655,8 @@ func_mode_link ()
 	continue
 	;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -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"
@@ -6147,7 +6160,8 @@ func_mode_link ()
 	lib=
 	found=no
 	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	-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"
@@ -6831,7 +6845,7 @@ func_mode_link ()
 	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
+		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
@@ -7316,6 +7330,7 @@ func_mode_link ()
 	  # 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
@@ -7432,7 +7447,7 @@ func_mode_link ()
 	  versuffix="$major.$revision"
 	  ;;
 
-	linux)
+	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
@@ -8020,6 +8035,11 @@ EOF
 
       # 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=
@@ -8058,11 +8078,7 @@ EOF
 	  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\"
-	    fi
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
@@ -9152,6 +9168,8 @@ EOF
 	    esac
 	  done
 	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
 	eval cmds=\"$old_archive_cmds\"
 
 	func_len " $cmds"
@@ -9261,7 +9279,8 @@ EOF
 	      *.la)
 		func_basename "$deplib"
 		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		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"
diff --git a/admin/missing b/admin/missing
index 28055d2..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=2009-04-28.21; # UTC
+scriptversion=2012-01-06.18; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 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
@@ -26,7 +25,7 @@ scriptversion=2009-04-28.21; # UTC
 # 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
 
@@ -34,7 +33,7 @@ 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
@@ -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,21 +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'
+  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
+  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.
+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 $?
@@ -100,8 +98,8 @@ 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
     ;;
 
@@ -122,22 +120,13 @@ case $1 in
     # 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
@@ -149,27 +138,27 @@ esac
 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*)
     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*)
     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"
@@ -186,9 +175,9 @@ 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/' |
@@ -197,10 +186,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   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 "$sed_output"`
@@ -220,13 +209,13 @@ WARNING: \`$1' is needed, but is $msg.
 
   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 test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -250,13 +239,13 @@ WARNING: \`$1' $msg.  You should only need it if
 
   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 test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -273,10 +262,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   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 "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -291,12 +280,12 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   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 "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -318,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
diff --git a/calib/dic/ESO-DFS-DIC.HAWKI_QC b/calib/dic/ESO-DFS-DIC.HAWKI_QC
new file mode 100644
index 0000000..3eaff19
--- /dev/null
+++ b/calib/dic/ESO-DFS-DIC.HAWKI_QC
@@ -0,0 +1,948 @@
+#******************************************************************************
+# E.S.O. - VLT project
+#
+# $Id: ESO-DFS-DIC.HAWKI_QC,v 1.21 2012/12/04 09:41:12 cgarcia Exp $
+# $Author: cgarcia $
+# $Date: 2012/12/04 09:41:12 $
+# $Revision: 1.21 $
+#                            
+#******************************************************************************
+#   NAME
+#   ESO-DFS-DIC.HAWKI_QC - Data Interface Dictionary for HAWKI Quality 
+#                           control (level 1) parameters.
+# -----------------------------------------------------------------------------
+Dictionary Name:   ESO-DFS-DIC.HAWKI_QC
+Scope:             QC
+Source:            ESO SDD/PSD
+Version Control:   "$Id: ESO-DFS-DIC.HAWKI_QC,v 1.21 2012/12/04 09:41:12 cgarcia Exp $"
+Revision:          1.0
+Date:              2007-08-20
+Status:            submitted
+Description:	   HAWKI Quality Control dictionary.
+
+# QC Category
+
+Parameter Name:     QC RON MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the RONs
+Description:        Mean of the RON (QC RONi) from each input frame
+
+Parameter Name:     QC RON MED
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the RONs
+Description:        Median of the RON (QC RONi) from each input frame
+
+Parameter Name:     QC RON STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard Deviation of the RONs
+Description:        Standard Deviation of the RON (QC RONi) from each
+input frame
+
+Parameter Name:     QC RONi
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Read-out noise
+Description:        Measured read-out noise of the whole array of each
+                    input frame
+
+Parameter Name:     QC DARK MED
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the medians from each input frame
+Description:        Median of the medians from each input frame
+
+Parameter Name:     QC DARK MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the medians from each input frame
+Description:        Mean of the medians from each input frame
+
+Parameter Name:     QC DARK STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard dev. of the medians from each input frame
+Description:        Standard dev. of the medians from each input frame
+
+Parameter Name:     QC DARK NBADPIX
+Class:              header|qc-log
+Context:            process
+Type:               int
+Value Format:       %d
+Unit:               pixels
+Comment Field:      Number of bad pixels
+Description:        Number of bad pixels
+
+Parameter Name:     QC DARK VCi MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of video channel <i> subregion of the current extension
+Description:        Mean of video channel <i> subregion of the current extension
+
+Parameter Name:     QC DARK VCi MED
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of video channel <i> subregion of the current extension
+Description:        Median of video channel <i> subregion of the current extension
+
+Parameter Name:     QC DARK VCi STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of video channel <i> subregion of the current extension
+Description:        Standard deviation of video channel <i> subregion of the current extension
+
+Parameter Name:     QC FLAT NORM
+Class:              header|qc-log
+Context:            process
+Type:               double  
+Value Format:       %f  
+Unit:               ADU
+Comment Field:      Normalisation factor
+Description:        Normalisation factor
+
+Parameter Name:     QC FLAT MEDMIN
+Class:              header|qc-log
+Context:            process
+Type:               double  
+Value Format:       %f  
+Unit:               pix
+Comment Field:      Minimum value of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the minimum median values.
+
+Parameter Name:     QC FLAT MEDMAX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pix
+Comment Field:      Maximum value of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the maximum median values.
+
+Parameter Name:     QC FLAT MEDMED
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f  
+Unit:               ADU
+Comment Field:      Median value of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the median of the median values.
+
+
+Parameter Name:     QC FLAT MEDMEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f  
+Unit:               ADU
+Comment Field:      Average value of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the average of the median values.
+
+Parameter Name:     QC FLAT MEDSTDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the standard deviation of the median values.
+
+Parameter Name:     QC FLAT MEDRANG
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Range of values of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the maximum minus the minumum values.
+
+Parameter Name:     QC FLAT MEDNRANG
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Relative range of values of median values.
+Description:        For each frame, the median is computed, this keyword is
+                    the maximum minus the minumum values divided by the median
+
+Parameter Name:     QC FLAT NBADPIX
+Class:              header|qc-log
+Context:            process
+Type:               int
+Value Format:       %d
+Unit:               pixels
+Comment Field:      Number of bad pixels
+Description:        Number of bad pixels
+
+Parameter Name:     QC DETLIN MEDA
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Median value
+Description:        Median value of the A coefficients
+
+Parameter Name:     QC DETLIN MEDB
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Median value
+Description:        Median value of the B coefficients
+
+Parameter Name:     QC DETLIN MEDC
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Median value
+Description:        Median value of the C coefficients
+
+Parameter Name:     QC DETLIN MEDQ
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Median value
+Description:        Median value of the Q
+
+Parameter Name:     QC DETLIN LAMP
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               percent
+Comment Field:      Lamp stability
+Description:        Lamp stability
+
+Parameter Name:     QC BACKGD INSTMAG
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:
+Comment Field:      The mean of all the image mean backgrounds in instrumental magnitudes.
+Description:        The mean of all the image mean backgrounds in instrumental magnitudes: -2.5*log10(backgd_mean/pixscale/pixscale/DIT).
+
+Parameter Name:     QC BACKGD STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:
+Comment Field:      The standard deviation of all the image mean backgrounds.
+Description:        The standard deviation of all the image mean backgrounds.
+
+Parameter Name:     QC BACKGD MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:
+Comment Field:      The mean of all the image mean backgrounds.
+Description:        The mean of all the image mean backgrounds.
+
+
+Parameter Name:     QC FWHM PIX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      The median FWHM in the image [pixels]
+Description:        Median value of the full-width at half-maximum of all
+                    detected objects in the final reduced frame.
+
+Parameter Name:     QC FWHM ARCSEC
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               arcsec
+Comment Field:      The median FWHM in the image [arcsec]
+Description:        Median value of the full-width at half-maximum of all
+                    detected objects in the final reduced frame, multiplied
+                    by the pixel size in arcsec/pixel.
+
+Parameter Name:     QC FWHM MODE
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      The mode FWHM in the image [pixels]
+Description:        The mode FWHM in the image [pixels]
+
+Parameter Name:     QC NBOBJS
+Class:              header|qc-log
+Context:            process
+Type:               integer
+Value Format:       %d
+Unit:               none
+Comment Field:      Number of detected objects in the combined image
+Description:        Number of detected objects in the combined image
+
+Parameter Name:     QC IQ
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               arcsec
+Comment Field:      Estimated image quality (arcsec)
+Description:        Estimated value of the image quality, based on
+                    the median FWHM of all star-like objects in the
+                    final product frame.
+
+Parameter Name:     QC OBJ ANGLE MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               degrees
+Comment Field:      Mean of the orientations of objects detected in an image
+Description:        Mean of the orientations of objects detected in an image
+
+Parameter Name:     QC OBJ ANGLE MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               degrees
+Comment Field:      Median of the orientations of objects detected in an image
+Description:        Median of the orientations of objects detected in an image
+
+Parameter Name:     QC OBJ ANGLE MIN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               degrees
+Comment Field:      Minimum of the orientations of objects detected in an image
+Description:        Minimum of the orientations of objects detected in an image
+
+Parameter Name:     QC OBJ ANGLE MAX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               degrees
+Comment Field:      Maximum of the orientations of objects detected in an image
+Description:        Maximum of the orientations of objects detected in an image
+
+Parameter Name:     QC OBJ ANGLE STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               degrees
+Comment Field:      Standard deviations of the orientations of 
+                    objects detected in an image
+Description:        Standard deviations of the orientations of 
+                    objects detected in an image
+
+Parameter Name:     QC OBJ ELLIP MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               
+Comment Field:      Mean of the ellipticities of objects detected in an image
+Description:        Mean of the ellipticities of objects detected in an image
+
+Parameter Name:     QC OBJ ELLIP MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:              
+Comment Field:      Median of the ellipticities of objects detected in an image
+Description:        Median of the ellipticities of objects detected in an image
+
+Parameter Name:     QC OBJ ELLIP MIN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               
+Comment Field:      Minimum of the ellipticities of objects detected in an image
+Description:        Minimum of the ellipticities of objects detected in an image
+
+Parameter Name:     QC OBJ ELLIP MAX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               
+Comment Field:      Maximum of the ellipticities of objects detected in an image
+Description:        Maximum of the ellipticities of objects detected in an image
+
+Parameter Name:     QC OBJ ELLIP STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               
+Comment Field:      Standard deviations of the ellipticities of 
+                    objects detected in an image
+Description:        Standard deviations of the ellipticities of 
+                    objects detected in an image
+
+Parameter Name:     QC COMBINED POSX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Position in X of the first image
+Description:        Position in X of the first image
+
+Parameter Name:     QC COMBINED POSY
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.2f
+Unit:               pix
+Comment Field:      Position in Y of the first image
+Description:        Position in Y of the first image
+
+Parameter Name:     QC FILTER OBS
+Class:              header|qc-log
+Context:            process
+Type:               string
+Value Format:       %20s
+Unit:
+Comment Field:      Observation filter
+Description:        This is the filter used to observe the star. It might
+                    be different from the one used to get the star
+                    magnitude in the database.
+
+Parameter Name:     QC FILTER REF
+Class:              header|qc-log
+Context:            process
+Type:               string
+Value Format:       %20s
+Unit:
+Comment Field:      Reference filter
+Description:        If the filter used for observation corresponds to an
+                    unknown magnitude value in the database, an association
+                    rule is used to see which other magnitude could be
+                    used. In that case, this value differs from the
+                    actually used filter for observation.
+
+Parameter Name:     QC AMBI RHUM AVG
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %.f
+Unit:
+Comment Field:      (percent) ambient relative humidity @ 30/2 m
+Description:        Temporal mean of site ambient relative humidity
+                    measured at sensor position i = 1/2 in 30m/2m height.
+                    This parameter is delivered by the ASM at intervals
+                    of typically 1 minute. This keyword stores the average
+                    of all measured values during the zero-point
+                    measurement.
+
+Parameter Name:     QC AIRMASS MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:
+Comment Field:      Average airmass
+Description:        Average airmass during the zero-point acquisition.
+
+Parameter Name:     QC STDNAME
+Class:              header|qc-log
+Context:            process
+Type:               string
+Value Format:       %20s
+Unit:
+Comment Field:      Standard star name
+Description:        Name of the standard star used for ZP computation
+
+Parameter Name:     QC STARMAG
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %g
+Unit:
+Comment Field:      Standard star magnitude in observed filter
+Description:        Standard star magnitude in observed filter
+
+Parameter Name:     QC STARMAG H
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %g
+Unit:
+Comment Field:      Standard star magnitude in H
+Description:        Standard star magnitude in H
+
+Parameter Name:     QC STARMAG J
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %g
+Unit:
+Comment Field:      Standard star magnitude in J
+Description:        Standard star magnitude in J
+
+Parameter Name:     QC STARMAG K
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %g
+Unit:
+Comment Field:      Standard star magnitude in K
+Description:        Standard star magnitude in K
+
+Parameter Name:     QC STARMAG Y
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %g
+Unit:
+Comment Field:      Standard star magnitude in Y
+Description:        Standard star magnitude in Y
+
+Parameter Name:     QC SPECTYPE
+Class:              header|qc-log
+Context:            process
+Type:               string
+Value Format:       %s
+Unit:
+Comment Field:      Standard star spectral type
+Description:        Standard star spectral type
+
+Parameter Name:     QC CATNAME
+Class:              header|qc-log
+Context:            process
+Type:               string
+Value Format:       %20s
+Unit:
+Comment Field:      Standard star catalogue name
+Description:        Name of the catalogue from which the standard star
+                    has been extracted.
+
+Parameter Name:     QC ZPOINT MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               mag
+Comment Field:      Mean measured zero-point for all the chips.
+Description:        Mean measured zero-point for all the chips
+
+Parameter Name:     QC ATX0 MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               mag
+Comment Field:      Mean extinction corrected zero-point for all the chips.
+Description:        Mean extinction corrected zero-point for all the chips
+
+Parameter Name:     QC ZPOINT
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               mag
+Comment Field:      Measured zero-point for a given chip.
+Description:        Measured zero-point for a given chip.
+
+Parameter Name:     QC ATX0
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               mag
+Comment Field:      Extinction corrected zero-point for a given chip.
+Description:        Extinction corrected zero-point for a given chip.
+
+Parameter Name:     QC ZPOINT EXT COEFF
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               mag/airmass
+Comment Field:      Extinction coefficient used in the computation of ATX0.
+Description:        Extinction coefficient used in the computation of ATX0.
+
+Parameter Name:     QC ZPOINT POSX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pixels
+Comment Field:      
+Description:        X position of the standard star
+
+
+Parameter Name:     QC ZPOINT POSY
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pixels
+Comment Field:      
+Description:        Y position of the standard star
+
+Parameter Name:     QC ZPOINT FLUX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      
+Description:        Flux of the standard star
+
+Parameter Name:     QC ZPOINT PEAK
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      
+Description:        Peak of the standard star
+
+Parameter Name:     QC ZPOINT BGD
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      
+Description:        Background around the standard star
+
+Parameter Name:     QC ZPOINT FWHMX
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pixels
+Comment Field:      
+Description:        X FWHM of the standard star
+
+Parameter Name:     QC ZPOINT FWHMY
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pixels
+Comment Field:      
+Description:        Y FWHM of the standard star
+
+Parameter Name:     QC ZPOINT FWHM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               pixels
+Comment Field:      
+Description:        FWHM of the standard star
+
+Parameter Name:     QC ZPOINT FWHMX_AS
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               arcsec
+Comment Field:      
+Description:        X FWHM of the standard star
+
+Parameter Name:     QC ZPOINT FWHMY_AS
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               arcsec
+Comment Field:      
+Description:        Y FWHM of the standard star
+
+Parameter Name:     QC ZPOINT FWHM_AS
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               arcsec
+Comment Field:      
+Description:        FWHM of the standard star
+
+Parameter Name:     QC DATANCOM
+Class:              header|qc-log
+Context:            process
+Type:               int
+Value Format:       %d
+Unit:               number of files
+Comment Field:      
+Description:        Number of files used for the reduction
+
+Parameter Name:     QC RAW MINIMUM MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the minimum values of a list of raw frames
+Description:        Mean of the minimum values of a list of raw frames
+
+Parameter Name:     QC RAW MINIMUM MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the minimum values of a list of raw frames
+Description:        Median of the minimum values of a list of raw frames
+
+Parameter Name:     QC RAW MINIMUM MINIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Minimum of the minimum values of a list of raw frames
+Description:        Minimum of the minimum values of a list of raw frames
+
+Parameter Name:     QC RAW MINIMUM MAXIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Maximum of the minimum values of a list of raw frames
+Description:        Maximum of the minimum values of a list of raw frames
+
+Parameter Name:     QC RAW MINIMUM STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of the minimum values of a list of raw frames
+Description:        Standard deviation of the minimum values of a list of raw frames
+
+Parameter Name:     QC RAW MAXIMUM MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the maximum values of a list of raw frames
+Description:        Mean of the maximum values of a list of raw frames
+
+Parameter Name:     QC RAW MAXIMUM MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the maximum values of a list of raw frames
+Description:        Median of the maximum values of a list of raw frames
+
+Parameter Name:     QC RAW MAXIMUM MINIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Minimum of the maximum values of a list of raw frames
+Description:        Minimum of the maximum values of a list of raw frames
+
+Parameter Name:     QC RAW MAXIMUM MAXIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Maximum of the maximum values of a list of raw frames
+Description:        Maximum of the maximum values of a list of raw frames
+
+Parameter Name:     QC RAW MAXIMUM STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of the maximum values of a list of raw frames
+Description:        Standard deviation of the maximum values of a list of raw frames
+
+Parameter Name:     QC RAW MEDIAN MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the median values of a list of raw frames
+Description:        Mean of the median values of a list of raw frames
+
+Parameter Name:     QC RAW MEDIAN MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the median values of a list of raw frames
+Description:        Median of the median values of a list of raw frames
+
+Parameter Name:     QC RAW MEDIAN MINIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Minimum of the median values of a list of raw frames
+Description:        Minimum of the median values of a list of raw frames
+
+Parameter Name:     QC RAW MEDIAN MAXIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Maximum of the median values of a list of raw frames
+Description:        Maximum of the median values of a list of raw frames
+
+Parameter Name:     QC RAW MEDIAN STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of the median values of a list of raw frames
+Description:        Standard deviation of the median values of a list of raw frames
+
+Parameter Name:     QC RAW MEAN MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the mean values of a list of raw frames
+Description:        Mean of the mean values of a list of raw frames
+
+Parameter Name:     QC RAW MEAN MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the mean values of a list of raw frames
+Description:        Median of the mean values of a list of raw frames
+
+Parameter Name:     QC RAW MEAN MINIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Minimum of the mean values of a list of raw frames
+Description:        Minimum of the mean values of a list of raw frames
+
+Parameter Name:     QC RAW MEAN MAXIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Maximum of the mean values of a list of raw frames
+Description:        Maximum of the mean values of a list of raw frames
+
+Parameter Name:     QC RAW MEAN STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of the mean values of a list of raw frames
+Description:        Standard deviation of the mean values of a list of raw frames
+
+Parameter Name:     QC RAW RMS MEAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Mean of the rms values of a list of raw frames
+Description:        Mean of the rms values of a list of raw frames
+
+Parameter Name:     QC RAW RMS MEDIAN
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Median of the rms values of a list of raw frames
+Description:        Median of the rms values of a list of raw frames
+
+Parameter Name:     QC RAW RMS MINIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Minimum of the rms values of a list of raw frames
+Description:        Minimum of the rms values of a list of raw frames
+
+Parameter Name:     QC RAW RMS MAXIMUM
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Maximum of the rms values of a list of raw frames
+Description:        Maximum of the rms values of a list of raw frames
+
+Parameter Name:     QC RAW RMS STDEV
+Class:              header|qc-log
+Context:            process
+Type:               double
+Value Format:       %f
+Unit:               ADU
+Comment Field:      Standard deviation of the rms values of a list of raw frames
+Description:        Standard deviation of the rms values of a list of raw frames
+
diff --git a/calib/dic/ESO-VLT-DIC.HAWKI_CFG b/calib/dic/ESO-VLT-DIC.HAWKI_CFG
new file mode 100644
index 0000000..c99a872
--- /dev/null
+++ b/calib/dic/ESO-VLT-DIC.HAWKI_CFG
@@ -0,0 +1,929 @@
+#************************************************************************
+# E.S.O. - VLT project
+#
+# "@(#) $Id: ESO-VLT-DIC.HAWKI_CFG,v 1.1 2007/08/21 09:28:25 yjung Exp $"
+#
+# who       when      what
+# --------  --------- ------------------------------------------------
+# mkiekebu 2007-08-03 added OCS.CON.DETi.CRPIXi and OCS.CON.DETi.ROT
+# mkiekebu 2007-07-16 added XGAP,YGAP and NDET keywords
+# mkiekebu 2007-07-03 improved keyword description.
+# mkiekebu 2007-07-02 CLAMP replace by LPIN
+# mkiekebu 2007-06-02 added test keywords for digital controller
+# mkiekebu 2007-05-28 added FC configuration keywords
+# mkiekebu 2007-05-25 added INS.SENSORi.MONTIME
+# mkiekebu 2007-05-06 added config keys for filter user function
+# pbiereic  01/12/06  created
+#
+
+#************************************************************************
+#  DESCRIPTION
+#    HAWKI configuration dictionary for devices and assemblies
+#
+#    The letters within () indicate the class to which the keyword belongs to:
+#    c = config
+#    h = header
+#    l = conf-log
+#    p = private
+#    s = setup
+#    o = ops-log
+#
+#************************************************************************
+
+Dictionary Name:   ESO-VLT-DIC.HAWKI_CFG
+Scope:             HAWKI
+Source:            ESO VLT
+Version Control:   @(#) $Id: ESO-VLT-DIC.HAWKI_CFG,v 1.1 2007/08/21 09:28:25 yjung Exp $
+Revision:          $Revision: 1.1 $
+Date:              2007-08-21
+Status:            Development
+Description:       HAWKI ICS keywords
+
+
+#########################################################################
+# TCS SETINSD
+#
+Parameter Name:    OCS CON INSDi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %80s
+Unit:              
+Comment Format:    INS data
+Description:       Configuration parameters for tif command SETINSD
+
+
+#########################################################################
+# INS
+#
+Parameter Name:    INS FILTi DARKi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Filter dark positions
+Description:       Keyword to configure dark filter positions.
+
+Parameter Name:    INS FILTi LPSIGNAL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Use locking pin signal
+Description:       If T, function will use the locking pin
+                   enable signal during motor initialization
+                   as a second reference switch.
+
+Parameter Name:    INS FILTi IMOTSTP
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Motor init step index
+Description:       Motor initialization sequence index for
+                   step just before to lauch the init user
+                   function.
+
+Parameter Name:    INS FILTi EMOTSTP
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Motor end step index
+Description:       Motor initialization sequence index for
+                   the final step which is updated by the
+                   init user function.
+
+
+#########################################################################
+# RTD
+#
+Parameter Name:    OCS CON RTD TIMEOUT
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              s
+Comment Format:    RTD command timeout [s]
+Description:       Default RTD command timeout.
+
+Parameter Name:    OCS CON RTD STRTIME
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              s
+Comment Format:    RTD startup wait time [s]
+Description:       RTD startup wait time [s]
+
+
+#########################################################################
+# OCS.CON
+#
+Parameter Name:    OCS CON CREFX
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              pixel
+Comment Format:    Nominal reference pixel X [pixel]
+Description:       Nominal reference pixel X [pixel]
+
+Parameter Name:    OCS CON CREFY
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              pixel
+Comment Format:    Nominal reference pixel Y [pixel]
+Description:       Nominal reference pixel Y [pixel]
+
+Parameter Name:    OCS CON XGAP
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Detector gap along X
+Description:       Detector gap along X
+
+Parameter Name:    OCS CON YGAP
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Detector gap along Y
+Description:       Detector gap along Y
+
+Parameter Name:    OCS CON NDET
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of detectors in the mosaic
+Description:       Number of detector chips in the instrument
+                   mosaic (c).
+
+Parameter Name:    OCS CON DETi CRPIXi
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Reference pixel of center of rotation.
+Description:       Reference pixel for each detector in the
+                   mosaic related to the center of rotation
+                   from the lower left corner.
+
+Parameter Name:    OCS CON DETi ROT
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Detector rotation
+Description:       Tilt of each detector in the mosaic.
+
+Parameter Name:    OCS CON XSECPIX
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec/pixel
+Comment Format:    Image Scale along axis X [arcsec/pixel]
+Description:       Image Scale along axis X [arcsec/pixel]
+
+Parameter Name:    OCS CON YSECPIX
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec/pixel
+Comment Format:    Image Scale along axis Y [arcsec/pixel]
+Description:       Image Scale along axis Y [arcsec/pixel]
+
+Parameter Name:    OCS CON ANGSGN
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Rotator angular sign
+Description:       Rotator angular sign
+
+Parameter Name:    OCS CON FC SAMP
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              s
+Comment Format:    Field compensation sampling [s]
+Description:       Keyword configuring the frequency used by the
+                   flexure compensation loop.
+
+Parameter Name:    OCS CON FC IMGSCALE
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcs/pixel
+Comment Format:    Detector image scale [arcs/pixel]
+Description:       Detector image scale [arcs/pixel]
+
+Parameter Name:    OCS CON FC MAXERRS
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of allowed consecutive errors
+Description:       Keyword configuring the maximum allowed
+                   consecutive errors during the flexure
+                   compensation before to stop the loop.
+
+Parameter Name:    OCS CON FC NMODES
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of FC models
+Description:       Keyword defining the number of flexure
+                   compensation models.
+
+Parameter Name:    OCS CON FC MNAMEi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    FC Model name
+Description:       Name of each flexure compensation model.
+
+Parameter Name:    OCS CON FC AXi
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Amplitud of the FC model along axis X
+Description:       Amplitud of the flexure compensation model
+                   along the axis X.
+
+Parameter Name:    OCS CON FC PHXi
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Phase of the FC model along axis X
+Description:       Phase fo the flexure compensation model
+                   along the axis X
+
+Parameter Name:    OCS CON FC AYi
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Amplitud of the FC model along axis Y
+Description:       Amplitud of the flexure compensation model
+                   along the axis Y.
+
+Parameter Name:    OCS CON FC PHYi
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              
+Comment Format:    Phase of the FC model along axis Y
+Description:       Phase fo the flexure compensation model
+                   along the axis Y.
+
+Parameter Name:    OCS CON MINTOFF
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec
+Comment Format:    Min. TCS offset throw [arcsec]
+Description:       Offset steps less that OCS.CON.MINTOFF are not sent to TCS
+
+Parameter Name:    OCS CON MAXTOFF
+Class:             config
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec
+Comment Format:    Max. allowed TCS offset throw [arcsec]
+Description:       This keyword defines the maximum offset
+                   that will be sent to the telescope.
+
+#########################################################################
+# FITS log
+#
+Parameter Name:    INS FITSLOG PERIOD
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              s
+Comment Format:    Sensor values FITS log period [s]
+Description:       Frequency of the fits logging loop
+                   for the special sensors (Lakeshore and Yokogawa).
+
+
+#########################################################################
+# INS.LPINi: LPIN device configuration keywords
+#
+Parameter Name:    INS LPINi SWSIM
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, function is software simulated
+Description:       If T, function is software simulated
+
+Parameter Name:    INS LPINi NAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device name.
+Description:       Device name.
+
+Parameter Name:    INS LPINi LCUID
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Id. of the LCU managing the device.
+Description:       Id. of the LCU managing the device.
+
+Parameter Name:    INS LPINi DEVNAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Name of the ICS device.(c)
+Description:       Name of the ICS device.(c)
+
+Parameter Name:    INS LPINi DEVDESC
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Description of the ICS device.
+Description:       Description of the ICS device.
+
+Parameter Name:    INS LPINi PREFIX
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device FITS prefix.
+Description:       Device FITS prefix.
+
+Parameter Name:    INS LPINi JUSTCHECK
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Only checks if action is possible
+Description:       Configure locking pin device to verify
+                   that action is possible but not to execute
+                   it. Special feature to verify if filter
+                   wheel motors are loosing steps.
+
+Parameter Name:    INS LPINi SIGNUM
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of signals configured.
+Description:       Number of signals configured.
+
+Parameter Name:    INS LPINi SIGCONFi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Signal configuration
+Description:       Keyword to define each entry of the
+                   locking pin signals table.
+
+Parameter Name:    INS LPINi POSNAME1
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    position status.
+Description:       Status reported when the locking pin is retracted (F).
+
+Parameter Name:    INS LPINi POSNAME2
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    position status.
+Description:       Status reported when the locking pin is inserted (T).
+
+Parameter Name:    INS LPINi CKLOCAL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Check local control.
+Description:       It verifies if locking pin is in manual mode.
+
+Parameter Name:    INS LPINi CKENABLE
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Check enable status bit
+Description:       It verifies if enable status bit is active
+                   before to insert the locking pin.
+
+Parameter Name:    INS LPINi BICONTROL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Enable bi-control.
+Description:       Enable bi-stable control. Two different
+                   control signals used for in and out.
+
+Parameter Name:    INS LPINi BISTATUS
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Enable bi-status.
+Description:       If T, locking pin is using two signals for status.
+
+Parameter Name:    INS LPINi RESET
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Reset control
+Description:       If T, locking pin will reset its status
+                   to retracted when going online. Only valid
+                   when bi-control is enabled.
+
+Parameter Name:    INS LPINi TIMEOUT
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              ms
+Comment Format:    Activation timeout [ms].
+Description:       Maximum timeout to reach the status of the
+                   locking pin.
+
+Parameter Name:    INS LPINi UIFCLASS
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    UIF class
+Description:       UIF class
+
+Parameter Name:    INS LPINi UIFSPECIAL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    UIF special device
+Description:       UIF special device
+
+Parameter Name:    INS LPINi UIFNB
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    UIF
+Description:       UIF
+
+Parameter Name:    INS LPINi UIFTB
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    UIF
+Description:       UIF
+
+Parameter Name:    INS LPINi PROCNAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Procedure Name
+Description:       Procedure Name
+
+Parameter Name:    INS LPINi TESTMAX
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Maximum number of test commands
+Description:       Maximum number of test commands
+
+Parameter Name:    INS LPINi TESTCMDi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Test Command name
+Description:       Test Command name
+
+Parameter Name:    INS LPINi TESTPARi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %256s
+Unit:              
+Comment Format:    Test Paramaters string
+Description:       Test Paramaters string
+
+Parameter Name:    INS LPINi TESTERRi
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Test Expected Error Reply
+Description:       Test Expected Error Reply
+
+#########################################################################
+# INS.SHUTi: SHUT device configuration keywords
+#
+Parameter Name:    INS SHUTi SWSIM
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, function is software simulated
+Description:       If T, function is software simulated
+
+Parameter Name:    INS SHUTi NAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device name.
+Description:       Device name.
+
+Parameter Name:    INS SHUTi LCUID
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Id. of the LCU managing the device.
+Description:       Id. of the LCU managing the device.
+
+Parameter Name:    INS SHUTi ID
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device ID
+Description:       Device ID
+
+Parameter Name:    INS SHUTi DEVNAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Name of the ICS device.(c)
+Description:       Name of the ICS device.(c)
+
+Parameter Name:    INS SHUTi DEVDESC
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Description of the ICS device.
+Description:       Description of the ICS device.
+
+Parameter Name:    INS SHUTi PREFIX
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device FITS prefix.
+Description:       Device FITS prefix.
+
+Parameter Name:    INS SHUTi SIGNUM
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of signals configured.
+Description:       Number of signals configured.
+
+Parameter Name:    INS SHUTi SIGCONFi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Signal configuration
+Description:       Keyword to define each entry of the
+                   shutter signals table.
+
+Parameter Name:    INS SHUTi POSNAME1
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    position status
+Description:       Status reported when the shutter is closed (F).
+
+Parameter Name:    INS SHUTi POSNAME2
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    position status
+Description:       Status reported when the shutter is open (F).
+
+Parameter Name:    INS SHUTi CKLOCAL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Check local control
+Description:       It verifies if shutter is in manual mode.
+
+Parameter Name:    INS SHUTi CKENABLE
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Check enable status bit
+Description:       It verifies if enable status bit is active
+                   before to open the shutter.
+
+Parameter Name:    INS SHUTi BICONTROL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Enable bi-control.
+Description:       Enable bi-stable control. Two different
+                   control signals used for open and close.
+
+Parameter Name:    INS SHUTi BISTATUS
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Enable bi-status.
+Description:       If T, shutter is using two signals for status.
+
+Parameter Name:    INS SHUTi RESET
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Reset control
+Description:       If T, shutter will reset its status
+                   to closed when going online. Only valid
+                   when bi-control is enabled.
+
+Parameter Name:    INS SHUTi TIMEOUT
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              ms
+Comment Format:    Activation timeout [ms].
+Description:       Activation timeout [ms].
+
+Parameter Name:    INS SHUTi UIFCLASS
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    UIF class
+Description:       UIF class
+
+Parameter Name:    INS SHUTi UIFSPECIAL
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    UIF special device
+Description:       UIF special device
+
+Parameter Name:    INS SHUTi UIFNB
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    UIF
+Description:       UIF
+
+Parameter Name:    INS SHUTi UIFTB
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    UIF
+Description:       UIF
+
+Parameter Name:    INS SHUTi PROCNAME
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Procedure Name
+Description:       Procedure Name
+
+Parameter Name:    INS SHUTi TESTMAX
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Maximum number of test commands
+Description:       Maximum number of test commands
+
+Parameter Name:    INS SHUTi TESTCMDi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Test Command name
+Description:       Test Command name
+
+Parameter Name:    INS SHUTi TESTPARi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %256s
+Unit:              
+Comment Format:    Test Paramaters string
+Description:       Test Paramaters string
+
+Parameter Name:    INS SHUTi TESTERRi
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Test Expected Error Reply
+Description:       Test Expected Error Reply
+
+#########################################################################
+# INS.SENSORi: Generic SENSOR device
+#
+Parameter Name:    INS SENSORi PREFIXi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Device prefix
+Description:       Device prefix
+
+Parameter Name:    INS SENSORi AVAILi
+Class:             config
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, sensor is available
+Description:       If T, sensor is available
+
+Parameter Name:    INS SENSORi STATi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Requested statistics
+Description:       Requested statistics
+
+Parameter Name:    INS SENSORi SPAREi
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Channel number of spare sensor
+Description:       Channel number of spare sensor
+
+Parameter Name:    INS SENSORi CHARBITSi
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Lakeshore: bits per character
+Description:       Lakeshore: bits per character
+
+Parameter Name:    INS SENSORi INFOi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %8s
+Unit:              
+Comment Format:    Sensor info: ALARM, WARN, STAT, N/A
+Description:       Sensor info: ALARM, WARN, STAT, N/A
+
+Parameter Name:    INS SENSORi MONTIME
+Class:             config
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              ms
+Comment Format:    Monitoring period [ms]
+Description:       Monitoring period [ms]
+
+
+#########################################################################
+# INS.SENSOR1: Yokogawa SENSOR device
+#
+Parameter Name:    INS SENSORi INITSi
+Class:             config
+Context:           Instrument
+Type:              string
+Value Format:      %16s
+Unit:              
+Comment Format:    Device initialization string
+Description:       Device initialization string
+
+#
+# ___HAWKI___
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calib/dic/ESO-VLT-DIC.HAWKI_ICS b/calib/dic/ESO-VLT-DIC.HAWKI_ICS
new file mode 100644
index 0000000..18648ce
--- /dev/null
+++ b/calib/dic/ESO-VLT-DIC.HAWKI_ICS
@@ -0,0 +1,1057 @@
+#*******************************************************************
+# E.S.O. - VLT project
+#
+# "@(#) $Id: ESO-VLT-DIC.HAWKI_ICS,v 1.1 2007/08/21 09:28:25 yjung Exp $"
+#
+# who       when      what
+# --------  --------  ----------------------------------------------
+# mkiekebu 2007-08-02 added INS.PIXSCALE
+# mkiekebu 2007-07-05 Overwritten temperature and sensor information.
+# mkiekebu 2007-07-03 corrected some keyword units according input
+#                     from Adam.
+# mkiekebu 2007-07-02 CLAMP replaced by LPIN
+# mkiekebu 2007-05-30 added JCHK keyword for locking pin devices
+# mkiekebu 2007-05-10 added shutter and locking pin actions keywords.
+# mkiekebu 2007-04-06 added CFILT assembly keyword
+# mkiekebu 2007-04-02 added SHUT and CLAMP keywords
+# pbiereic  01/12/06  created
+#
+
+#******************************************************************************
+#  DESCRIPTION
+#    HAWKI_ICS dictionary
+#    Refer to appendix A of document VLT-SPE-ESO-17240-1676 for details.
+#
+#    The letters within () indicate the class to which the keyword belongs to:
+#    c = config
+#    h = header
+#    l = conf-log
+#    p = private
+#    s = setup
+#    o = ops-log
+#
+#******************************************************************************
+
+Dictionary Name:   ESO-VLT-DIC.HAWKI_ICS
+Scope:             HAWKI
+Source:            ESO VLT
+Version Control:   @(#) $Id: ESO-VLT-DIC.HAWKI_ICS,v 1.1 2007/08/21 09:28:25 yjung Exp $
+Revision:          $Revision: 1.1 $
+Date:              2007-08-21
+Status:            Development
+Description:       HAWKI ICS keywords
+
+
+Parameter Name:    INSi ID
+Class:             conf-log|config|header
+Context:           Instrument
+Type:              string
+Value Format:      %30s
+Unit:              
+Comment Format:    Instrument ID
+Description:       Combines the ESO identification of the instrument
+                   and the software version of the control software.
+                   Format: NAME/HW-REV/SW-VERSION
+
+Parameter Name:    INSi DID
+Class:             config|header
+Context:           Instrument
+Type:              string
+Value Format:      %30s
+Unit:              
+Comment Format:    Data dictionary
+Description:       Name and version of ESO DID to which INS keywords
+                   comply to.
+
+Parameter Name:    INSi DATE
+Class:             conf-log|config|header
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Instrument release date (dd/mm/yy)
+Description:       Date of last release of the instrument system.
+
+Parameter Name:    INSi OPER
+Class:             header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %30s
+Unit:              
+Comment Format:    Instrument Operator
+Description:       Initials and family name of instrument operator or
+                   service observer.
+
+Parameter Name:    INSi SWSIM
+Class:             config|header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Software simulation
+Description:       Possible values:
+                   NORMAL:  no simulation.
+                   LCU_SIM: LCU is simulated by WS simulator.
+
+Parameter Name:    INSi MODE
+Class:             header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Instrument mode
+Description:       Acronym of instrument mode used. This acronym identifies
+                   the optical path within the instrument. Examples:
+                   BLUE, RED, DIC1, DIC2
+
+Parameter Name:    INSi PATH
+Class:             header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Optical path used
+Description:       The optical path within the instrument used for
+                   this exposure.
+
+Parameter Name:    INSi PIXSCALE
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec/pixel
+Comment Format:    Detector pixel scale [arcsec/pixel]
+Description:       Detector pixel scale [arcsec/pixel]
+
+#########################################################################
+# Assembly Keywords
+#
+Parameter Name:    INS LFILTi NAME
+Class:             conf-log|config|setup
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Element name
+Description:       Assembly keyword for locking pin and
+                   filter.
+
+#########################################################################
+# Shutter, DCONTROL devic
+#
+
+#########################################################################
+# Locking Pin, DCONTROL device
+Parameter Name:    INS LPINi ID
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Locking Pin ID
+Description:       Hardware identification of locking pin unit.
+
+Parameter Name:    INS LPINi NAME
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Locking Pin device name
+Description:       Name for the locking pin device.
+
+Parameter Name:    INS LPINi SWSIM
+Class:             config|header|ops-log
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, sw is simulated
+Description:       If T, sw is simulated
+
+Parameter Name:    INS LPINi STAT
+Class:             header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Locking Pin device position
+Description:       Status position of locking pin device:
+                   In or Out
+
+Parameter Name:    INS LPINi ST
+Class:             header|setup
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Locking Pin device status
+Description:       If T, locking pin is inserted otherwise
+                   is retracted.
+
+Parameter Name:    INS LPINi JCHK
+Class:             header
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Check only mode
+Description:       When this option is enabled, locking pin is
+                   used only to verify that it is possible to
+                   execute the action.
+
+Parameter Name:    INS LPINi IN
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Locking Pin In
+Description:       Action keyword to record when locking pin
+                   is inserted.
+
+Parameter Name:    INS LPINi OUT
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Locking Pin Out
+Description:       Action keyword to record when locking pin
+                   is retracted.
+
+Parameter Name:    INS SHUTi ID
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Moveable Cover  ID
+Description:       Hardware identification of the moveable cover unit.
+
+Parameter Name:    INS SHUTi NAME
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Moveable Cover name
+Description:       Name for the moveable cover.
+
+Parameter Name:    INS SHUTi SWSIM
+Class:             config|header|ops-log
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, sw is simulated
+Description:       If T, sw is simulated
+
+Parameter Name:    INS SHUTi STAT
+Class:             header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Moveable Cover position
+Description:       Moveable cover position: Closed or Open
+
+Parameter Name:    INS SHUTi ST
+Class:             header|setup
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Moveable Cover Status
+Description:       If T, moveable cover is open.
+
+Parameter Name:    INS SHUTi OPEN
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Moveable Cover Open
+Description:       Action keyword to record when moveable
+                   cover is open.
+
+Parameter Name:    INS SHUTi CLOSED
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Moveable Cover Closed
+Description:       Action keyword to record when moveable
+                   cover is closed.
+
+
+#########################################################################
+# Filter wheels, FILT device
+#
+Parameter Name:    INS FILTi SWSIM
+Class:             config|header|ops-log
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, function is software simulated
+Description:       If T, function is software simulated
+
+Parameter Name:    INS FILTi ID
+Class:             conf-log|config|setup
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Identification
+Description:       Hardware identification for filter wheels.
+
+Parameter Name:    INS FILTi NAME
+Class:             conf-log|config|header|setup
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Element name
+Description:       Element name
+
+Parameter Name:    INS FILTi TYPE
+Class:             conf-log|config|header
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Element type
+Description:       Element type
+
+Parameter Name:    INS FILTi NO
+Class:             conf-log|header|setup
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Element number
+Description:       Index of the selected position of the filter wheel.
+
+Parameter Name:    INS FILTi ENC
+Class:             header|ops-log|setup
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              Enc
+Comment Format:    Absolute position [Enc]
+Description:       Absolute position [Enc]
+
+Parameter Name:    INS FILTi ENCREL
+Class:             setup
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              Enc
+Comment Format:    Relative position [Enc]
+Description:       Relative position [Enc]
+
+Parameter Name:    INS FILTi LIMIT
+Class:             setup
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Move to the limit
+Description:       Move to lower or upper limit.
+
+Parameter Name:    INS FILTi TURN
+Class:             setup
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Turn the wheel right/left
+Description:       Turn the wheel to the right or to the left.
+
+Parameter Name:    INS FILTi SPEED
+Class:             setup
+Context:           Instrument
+Type:              double
+Value Format:      %.1f
+Unit:              
+Comment Format:    Moving speed
+Description:       Speed (default units) the wheel is turned (see TURN).
+
+Parameter Name:    INS FILTi POS
+Class:             header|ops-log|setup
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              deg
+Comment Format:    Position [deg]
+Description:       Position [deg]
+
+# Ops logs
+Parameter Name:    INS FILTi INIT
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Hardware initialisation
+Description:       Hardware initialisation
+
+Parameter Name:    INS FILTi MOVE
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Motion execution
+Description:       Motion execution
+
+Parameter Name:    INS FILTi STOP
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Motion stop
+Description:       Motion stop
+
+Parameter Name:    INS FILTi CHANGE
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Device was physically changed
+Description:       Filter element has been physically replaced.
+                   Maintenance operation.
+
+Parameter Name:    INS FILTi LPWIN
+Class:             ops-log
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              Enc
+Comment Format:    LPIN enable switch encoder window [Enc]
+Description:       Locking pin enable switch encoder window
+                   registered during the initialization.
+
+Parameter Name:    INS FILTi LPABS
+Class:             ops-log
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              Enc
+Comment Format:    LPIN enable center encoder position [Enc]
+Description:       Center of the locking pin enable encoder
+                   window registerd during the initialization.
+
+Parameter Name:    INS FILTi
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Filter Wheel device
+Description:       Filter Wheel device
+
+#########################################################################
+# Sensors (physical devices)
+#
+Parameter Name:    INSi SENSORi SWSIM
+Class:             config|header|ops-log
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    If T, function is software simulated
+Description:       If T, function is software simulated
+
+Parameter Name:    INSi SENSORi ID
+Class:             config|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Sensor device unique id
+Description:       ESO identification number for the sensor device.
+
+Parameter Name:    INSi SENSORi NAME
+Class:             config|header|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Sensor device common name
+Description:       ESO name for the sensor device.
+
+Parameter Name:    INSi SENSORi INIT
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Hardware initialisation
+Description:       Hardware initialisation
+
+Parameter Name:    INSi SENSORi OK
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    If sensor was operational
+Description:       Indicate if a complete sensor reading was succesful.
+
+Parameter Name:    INSi SENSORi DIRECT
+Class:             setup
+Context:           Instrument
+Type:              string
+Value Format:      %30s
+Unit:              
+Comment Format:    Direct command to sensor device
+Description:       Send direct commands to the sensor device.
+
+
+#########################################################################
+# Sensors header FITS keywords
+#
+Parameter Name:    INS SENSi ID
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Sensor type
+Description:       Hardware identification for generic sensor
+
+Parameter Name:    INS SENSi NAME
+Class:             header|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Sensor name
+Description:       Name of the generic sensor.
+
+Parameter Name:    INS SENSi VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Sensor numeric value
+Description:       Sensor numeric value
+
+Parameter Name:    INS SENSi STAT
+Class:             header|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Sensor string value
+Description:       Sensor string value
+
+Parameter Name:    INS SENSi UNITi
+Class:             config|header
+Context:           Instrument
+Type:              string
+Value Format:      %.8s
+Unit:              
+Comment Format:    Sensor unit
+Description:       Identifier of the generic sensor unit.
+
+# Sensor statistics values during an exposure (e.g. pressure, humidity)
+Parameter Name:    INS SENSi MIN
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Minimum value
+Description:       Minimum value
+
+Parameter Name:    INS SENSi MAX
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Maximum value
+Description:       Maximum value
+
+Parameter Name:    INS SENSi MEAN
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Average value
+Description:       Average value
+
+Parameter Name:    INS SENSi RMS
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    RMS of samples over exposure
+Description:       RMS of samples over exposure
+
+Parameter Name:    INS SENSi TMMEAN
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Time waighted average
+Description:       Time waighted average
+
+Parameter Name:    INS SENSi GRAD
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression slope
+Description:       Linear regression slope
+
+Parameter Name:    INS SENSi LRCONST
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression constant
+Description:       Linear regression constant
+
+Parameter Name:    INS SENSi LRRMS
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression RMS
+Description:       Linear regression RMS
+
+Parameter Name:    INS SENSi DETCOEF
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Determination coefficient
+Description:       Linear regression determination
+                   coefficient.
+
+# Temperature sensor statistics values during an exposure
+Parameter Name:    INS TEMPi ID
+Class:             header|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %10s
+Unit:              
+Comment Format:    Temperature sensor ID
+Description:       Hardware identification for temperature sensor
+
+Parameter Name:    INS TEMPi NAME
+Class:             header|ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %15s
+Unit:              
+Comment Format:    Temperature sensor name
+Description:       Name of the temperature sensor.
+
+Parameter Name:    INS TEMPi VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Temperature numeric sensor value [K]
+Description:       Temperature numeric sensor value [K]
+
+Parameter Name:    INS TEMPi UNITi
+Class:             config|header
+Context:           Instrument
+Type:              string
+Value Format:      %.8s
+Unit:              
+Comment Format:    Temperature sensor unit
+Description:       Identifier of the temperature sensor unit.
+
+Parameter Name:    INS TEMPi MIN
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Minimum temperature value
+Description:       Minimum temperature value
+
+Parameter Name:    INS TEMPi MAX
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Maximum temperature value
+Description:       Maximum temperature value
+
+Parameter Name:    INS TEMPi MEAN
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Average temperature value
+Description:       Average temperature value
+
+Parameter Name:    INS TEMPi RMS
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    RMS of samples over exposure
+Description:       RMS of samples over exposure
+
+Parameter Name:    INS TEMPi TMMEAN
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Time weighted average
+Description:       Time weighted average
+
+Parameter Name:    INS TEMPi GRAD
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression slope
+Description:       Linear regression slope
+
+Parameter Name:    INS TEMPi LRCONST
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression constant
+Description:       Linear regression constant
+
+Parameter Name:    INS TEMPi LRRMS
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Linear regression RMS
+Description:       Linear regression RMS
+
+Parameter Name:    INS TEMPi DETCOEF
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Determination coefficient
+Description:       Linear regression determination
+                   coefficient.
+
+# Redefinition of temperature keywords to overwrite generic
+# units and comments.
+Parameter Name:    INS TEMP1 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    M1 [K]
+Description:       M1 [K]
+
+Parameter Name:    INS TEMP2 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Heater of M1 [K]
+Description:       Heater of M1 [K]
+
+Parameter Name:    INS TEMP3 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Heater of M4 [K]
+Description:       Heater of M4 [K]
+
+Parameter Name:    INS TEMP4 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    M2 [K]
+Description:       M2 [K]
+
+Parameter Name:    INS TEMP5 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Heater of M2 [K]
+Description:       Heater of M2 [K]
+
+Parameter Name:    INS TEMP6 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Filter Wheel 1 [K]
+Description:       Filter Wheel 1 [K]
+
+Parameter Name:    INS TEMP7 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Filter Wheel 2 [K]
+Description:       Filter Wheel 2 [K]
+
+Parameter Name:    INS TEMP8 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Detector copper bar [K]
+Description:       Detector copper bar [K]
+
+Parameter Name:    INS TEMP9 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Cold structure [K]
+Description:       Cold structure [K]
+
+Parameter Name:    INS TEMP10 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    LN2 in [K]
+Description:       LN2 in [K]
+
+Parameter Name:    INS TEMP11 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Pollux [K]
+Description:       Pollux [K]
+
+Parameter Name:    INS TEMP12 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Castor [K]
+Description:       Castor [K]
+
+Parameter Name:    INS TEMP13 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Absortion pump [K]
+Description:       Absortion pump [K]
+
+Parameter Name:    INS TEMP14 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    LN2 out [K]
+Description:       LN2 out [K]
+
+Parameter Name:    INS TEMP15 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              C
+Comment Format:    Vessel  [C]
+Description:       Vessel  [C]
+
+Parameter Name:    INS TEMP16 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              C
+Comment Format:    Ambient [C]
+Description:       Ambient [C]
+
+Parameter Name:    INS TEMP17 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              C
+Comment Format:    Entrance Window 1 [C]
+Description:       Entrance Window 1 [C]
+
+Parameter Name:    INS TEMP18 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Cold structure 2 [K]
+Description:       Cold structure 2 [K]
+
+Parameter Name:    INS TEMP19 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Radiation Shield 3 [K]
+Description:       Radiation Shield 3 [K]
+# TEMP20 spare
+Parameter Name:    INS TEMP21 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              C
+Comment Format:    Defogging Heaters [C]
+Description:       Defogging Heaters [C]
+
+Parameter Name:    INS TEMP22 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              C
+Comment Format:    Dew point [C]
+Description:       Dew point [C]
+# TEMP23-27 spare
+Parameter Name:    INS SENS28 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              V
+Comment Format:    CLOCK Logo [V]
+Description:       CLOCK Logo [V]
+# TEMP29 spare
+Parameter Name:    INS SENS30 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3e
+Unit:              mb
+Comment Format:    Vaccum pressure [mb]
+Description:       Vaccum pressure [mb]
+
+Parameter Name:    INS TEMP31 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Detector Temperature [K]
+Description:       Detector Temperature [K]
+
+Parameter Name:    INS TEMP32 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              K
+Comment Format:    Detector setpoint [K]
+Description:       Detector setpoint [K]
+
+Parameter Name:    INS SENS33 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    LS Proportional value
+Description:       LakeShore PID control loop parameter (P).
+
+Parameter Name:    INS SENS34 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    LS Integral value
+Description:       LakeShore PID control loop parameter (I).
+
+Parameter Name:    INS SENS35 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    LS Derivative value
+Description:       LakeShore PID control loop parameter (D).
+
+Parameter Name:    INS SENS36 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    LS Heater Range value
+Description:       LakeShore Heater Range
+
+Parameter Name:    INS SENS37 VAL
+Class:             header|ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    LS Heater Output value
+Description:       LakeShore Heater output as a percentage.
+
+
+
+#
+# ___HAWKI___
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calib/dic/ESO-VLT-DIC.HAWKI_OS b/calib/dic/ESO-VLT-DIC.HAWKI_OS
new file mode 100644
index 0000000..9d85562
--- /dev/null
+++ b/calib/dic/ESO-VLT-DIC.HAWKI_OS
@@ -0,0 +1,409 @@
+#******************************************************************************
+# E.S.O. - VLT project
+#
+# "@(#) $Id: ESO-VLT-DIC.HAWKI_OS,v 1.1 2007/08/21 09:28:25 yjung Exp $"
+#
+# who       when      what
+# --------  --------  ----------------------------------------------
+# mkiekebu 2007-07-03 improved SEQ keywords description.
+# mkiekebu 2007-07-02 improved WCS keywords description.
+# mkiekebu 2007-07-02 added SEQ.FC.ST
+# mkiekebu 2007-05-29 added flexure compensation keywords
+# pbiereic  01/12/06  created
+#
+
+#******************************************************************************
+#  DESCRIPTION
+#    HAWKI_OS dictionary
+#
+#    The letters within () indicate the class to which the keyword belongs to:
+#    c = config
+#    h = header
+#    l = conf-log
+#    p = private
+#    s = setup
+#    o = ops-log
+#
+#******************************************************************************
+
+Dictionary Name:   ESO-VLT-DIC.HAWKI_OS
+Scope:             HAWKI
+Source:            ESO VLT
+Version Control:   @(#) $Id: ESO-VLT-DIC.HAWKI_OS,v 1.1 2007/08/21 09:28:25 yjung Exp $
+Revision:          $Revision: 1.1 $
+Date:              2007-08-21
+Status:            Development
+Description:       Template Instrument OS keywords
+
+
+#########################################################################
+# WCS keys
+#
+Parameter Name:    CTYPEi
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %.10s
+Unit:              
+Comment Format:    Pixel coordinate system
+Description:       Defines the coordinate system for CRPIXi.
+
+Parameter Name:    CRPIXi
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Ref. pixel of center of rotation.
+Description:       Reference pixel in the coordinate frame given by CTYPEi.
+                   The reference pixel is defined as the pixel
+                   (possibly with fraction if the accuracy is achieved)
+                   through which the center of rotation of the adapter.
+
+Parameter Name:    CRVALi
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.6e
+Unit:              
+Comment Format:    Value of ref pixel 1
+Description:       Value of ref pixel 1
+
+Parameter Name:    CD1_1
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.6e
+Unit:              
+Comment Format:    Translation matrix element.
+Description:       The PC translation matrix allows for general
+                   rotations and skew.
+
+Parameter Name:    CD1_2
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.6e
+Unit:              
+Comment Format:    Translation matrix element.
+Description:       The PC translation matrix allows for general
+                   rotations and skew.
+
+Parameter Name:    CD2_1
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.6e
+Unit:              
+Comment Format:    Translation matrix element.
+Description:       The PC translation matrix allows for general
+                   rotations and skew.
+
+Parameter Name:    CD2_2
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.6e
+Unit:              
+Comment Format:    Translation matrix element.
+Description:       The PC translation matrix allows for general
+                   rotations and skew.
+
+
+#########################################################################
+# RTD
+#
+Parameter Name:    OCS RTD ST
+Class:             setup
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Start/Stop RTD
+Description:       Keyword that allows to start/stop HAWKI RTD
+
+#########################################################################
+# Flexure Compensation (FC)
+#
+Parameter Name:    OCS FC START
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Flexure Compensation started
+Description:       Action keyword to register when OS flexure
+                   compensation has been started.
+
+Parameter Name:    OCS FC STOP
+Class:             ops-log
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Flexure Compensation stopped
+Description:       Action keyword to register when OS flexure
+                   compensation has been stopped.
+
+Parameter Name:    OCS FC OFFSALPHA
+Class:             ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec
+Comment Format:    Flexure Compensation in alpha [arcsec]
+Description:       Record alpha computed flexure compensation
+                   based on the rotator offset and the current
+                   flexure model.
+
+Parameter Name:    OCS FC OFFSDELTA
+Class:             ops-log
+Context:           Instrument
+Type:              double
+Value Format:      %f
+Unit:              arcsec
+Comment Format:    Flexure Compensation in delta [arcsec]
+Description:       Record delta computed flexure compensation
+                   based on the rotator offset and the current
+                   flexure model.
+
+#########################################################################
+# Template keys
+#
+Parameter Name:    SEQ JITTER WIDTH
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Jitter box width [arcsec]
+Description:       Defines the box where offsets will be randomly
+                   distributed.
+
+Parameter Name:    SEQ CUMOFFSETX
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              pixel
+Comment Format:    Cummulative offset along axis X [pixel]
+Description:       Cummulative offset along axis X [pixel]
+
+Parameter Name:    SEQ CUMOFFSETY
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              pixel
+Comment Format:    Cummulative offset along axis Y [pixel]
+Description:       Cummulative offset along axis Y [pixel]
+
+Parameter Name:    SEQ RELOFFSETX
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              pixel
+Comment Format:    Relative offset along axis X [pixel]
+Description:       Relative offset along axis X [pixel]
+
+Parameter Name:    SEQ RELOFFSETY
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              pixel
+Comment Format:    Relative offset along axis Y [pixel]
+Description:       Relative offset along axis Y [pixel]
+
+Parameter Name:    SEQ CUMOFFSETA
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Cummulative alpha offset [arcsec]
+Description:       Cummulative alpha offset [arcsec]
+
+Parameter Name:    SEQ CUMOFFSETD
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Cummulative delta offset [arcsec]
+Description:       Cummulative delta offset [arcsec]
+
+Parameter Name:    SEQ RELOFFSETA
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Relative alpha offset [arcsec]
+Description:       Relative alpha offset [arcsec]
+
+Parameter Name:    SEQ RELOFFSETD
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Relative delta offset [arcsec]
+Description:       Relative delta offset [arcsec]
+
+Parameter Name:    SEQ SKYTHROW
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Sky Offset Throw [arcsec]
+Description:       Defines the constant distance for sky
+                   observations from the original telescope
+                   position that will be randomly distributed
+                   between 0 and 360 degrees.
+
+Parameter Name:    SEQ SKYOFFSET ALPHA
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Sky Offset Alpha [arcsec]
+Description:       Defines fixed alpha offsets for which
+                   sky position will be randomly distributed
+                   around.
+
+Parameter Name:    SEQ SKYOFFSET DELTA
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              arcsec
+Comment Format:    Sky Offset Delta [arcsec]
+Description:       Defines fixed delta offsets for which
+                   sky position will be randomly distributed
+                   around.
+
+Parameter Name:    SEQ POISSON
+Class:             header
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Poisson value
+Description:       Randomness factor specifying the
+                   condition that the distance between any
+                   two points in a series of values is
+                   greater that a certain number.
+
+Parameter Name:    SEQ NABCYCLES
+Class:             header
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    Number of AB and BA cycles
+Description:       Number of OBJECT and SKY cycles to be executed.
+
+Parameter Name:    SEQ NDIT OBJECT
+Class:             header
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    NDIT on OBJECT positions
+Description:       It defines the number of
+                   subintegrations for object frames
+
+Parameter Name:    SEQ NDIT SKY
+Class:             header
+Context:           Instrument
+Type:              integer
+Value Format:      %d
+Unit:              
+Comment Format:    NDIT on SKY positions
+Description:       It defines the number of
+                   subintegrations for sky frames
+
+Parameter Name:    SEQ ROTPUPIL
+Class:             header
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Pupil rotation compensation
+Description:       Defines if instrument will be rotated
+                   between object and sky frames so that
+                   the pupil ghost can be minimized.
+
+Parameter Name:    SEQ NODPOS
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %.1s
+Unit:              
+Comment Format:    Nodding position (A or B)
+Description:       Used for the record of the nodding positions:
+                   object (A), sky (B).
+
+Parameter Name:    SEQ OBSTYPE
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %.1s
+Unit:              
+Comment Format:    Sequence observation type (O or S)
+Description:       Observation type defined for each image
+                   entered as list. O stands for OBJECT and
+                   assign the DPR CATG header keyword
+                   to SCIENCE. S stands for Sky and assigns
+                   the DPR CATG header keyword to SKY.
+
+Parameter Name:    SEQ OFFSET COORDS
+Class:             header
+Context:           Instrument
+Type:              string
+Value Format:      %s
+Unit:              
+Comment Format:    Offset coordinate type
+Description:       Indicates offsets coordinate type:
+                   (in SKY or DETECTOR coordinates)
+
+Parameter Name:    SEQ AIRMASS
+Class:             header
+Context:           Instrument
+Type:              double
+Value Format:      %.3f
+Unit:              
+Comment Format:    Airmass set by template
+Description:       Defines the airmass used for the
+                   skyflats observations.
+
+Parameter Name:    SEQ FC ST
+Class:             header
+Context:           Instrument
+Type:              logical
+Value Format:      %c
+Unit:              
+Comment Format:    Flexure compensation flag
+Description:       Indicates if OS flexure compensation will be
+                   used during observations.
+
+#
+#___HAWKI___
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calib/gasgano/config/HAWKI.prefs b/calib/gasgano/config/HAWKI.prefs
new file mode 100644
index 0000000..8f6a27e
--- /dev/null
+++ b/calib/gasgano/config/HAWKI.prefs
@@ -0,0 +1,53 @@
+# Gasgano Application Properties 
+# Date: Wed Mar 23 14:44:37 MET 2005
+AUTO_DISPLAY=false
+CLASSRULE_FILE=/cal/hawki/rul/hawki.oca
+COMPONENT_FONT=Dialog:14
+CUBE_TO_VIEWER=
+CUBE_VIEWER_TYPE=SKYCAT
+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;CRIRE;HAWKI
+DBOBS_PERIOD=66
+DBOBS_REQUIRED=false
+DBOBS_SERVER_ID=
+DBOBS_SERVER_URL=jdbc:sybase:Tds:
+DBOBS_USERID=
+DB_SERVER_URL=jdbc:sybase:Tds:
+DB_USER_NAME=qc
+DISPLAY_COLUMNS=OBS.NAME:DPR.TYPE:DPR.CATG:INS.FILT1.NAME:INS.FILT2.NAME:DET.DIT:DET.NDIT:PRO.CATG:TEL.AIRM.START
+DISPLAY_COLUMNS_SIZE=0:0:0:0:0
+FILTER_FILE=gasgano/filter.rul
+FITS_TO_VIEWER=skycat
+FITS_VIEWER_TYPE=SKYCAT
+FRAME_BOUNDS=331,0,920,891
+INSTRUMENT_GROUPING=ISAAC=;FORS1=;FORS2=;UVES=;VIMOS=;CONICA=;EFOSC=;CES=;SUSI=;SOFI=;EMMI=;WFI=;VINCI=;MIDI=;CRIRE=;HAWKI=;
+KEYWORDLIST_DIR=gasgano/keywords
+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:Completed L:released K:Cancelled 
+OB_STATUS_FROM_DB_REQUIRED=false
+PRINTER_NAME=lp
+PRINT_FONT=Monospaced:16
+PRINT_ORIENTATION=P
+RADEC_CONVERSION=true
+RECIPE_SET=hawki_cal_dark=/home/quality/pipelines/hawki/lib/esopipes-plugins/hawki-1.8.12/hawki_cal_dark.so;hawki_cal_flat=/home/quality/pipelines/hawki/lib/esopipes-plugins/hawki-1.8.12/hawki_cal_flat.so;hawki_cal_zpoint=/home/quality/pipelines/hawki/lib/esopipes-plugins/hawki-1.8.12/hawki_cal_zpoint.so;hawki_sci_jitter=/home/quality/pipelines/hawki/lib/esopipes-plugins/hawki-1.8.12/hawki_sci_jitter.so;hawki_cal_distortion=/home/quality/pipelines/hawki/lib/esopipes-plugins/hawki-1.8.12/ [...]
+SCRIPTS_DIR=gasgano/scripts
+SHORTEN_FILES_PATH=true
+SHORT_FILENAME=true
+SHOW_EXTENSIONS=true
+TEXTFILE_EXTENSIONS=ascii;paf;longlog
+TFITS_TO_VIEWER=
+TFITS_VIEWER_TYPE=SKYCAT
+UPDATE_TIMER=0
+VERBOSE_LEVEL=0
diff --git a/calib/gasgano/config/HAWKI.prefs.in b/calib/gasgano/config/HAWKI.prefs.in
new file mode 100644
index 0000000..f7f3b9b
--- /dev/null
+++ b/calib/gasgano/config/HAWKI.prefs.in
@@ -0,0 +1,53 @@
+# Gasgano Application Properties 
+# Date: Wed Mar 23 14:44:37 MET 2005
+AUTO_DISPLAY=false
+CLASSRULE_FILE=@sysconf@/gasgano/HAWKI.rul
+COMPONENT_FONT=Dialog:14
+CUBE_TO_VIEWER=
+CUBE_VIEWER_TYPE=SKYCAT
+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;CRIRE;HAWKI
+DBOBS_PERIOD=66
+DBOBS_REQUIRED=false
+DBOBS_SERVER_ID=
+DBOBS_SERVER_URL=jdbc:sybase:Tds:
+DBOBS_USERID=
+DB_SERVER_URL=jdbc:sybase:Tds:
+DB_USER_NAME=qc
+DISPLAY_COLUMNS=OBS.NAME:DPR.TYPE:DPR.CATG:INS.FILT1.NAME:INS.FILT2.NAME:DET.DIT:DET.NDIT:PRO.CATG:TEL.AIRM.START
+DISPLAY_COLUMNS_SIZE=0:0:0:0:0
+FILTER_FILE=gasgano/filter.rul
+FITS_TO_VIEWER=skycat
+FITS_VIEWER_TYPE=SKYCAT
+FRAME_BOUNDS=331,0,920,891
+INSTRUMENT_GROUPING=ISAAC=;FORS1=;FORS2=;UVES=;VIMOS=;CONICA=;EFOSC=;CES=;SUSI=;SOFI=;EMMI=;WFI=;VINCI=;MIDI=;CRIRE=;HAWKI=;
+KEYWORDLIST_DIR=gasgano/keywords
+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:Completed L:released K:Cancelled 
+OB_STATUS_FROM_DB_REQUIRED=false
+PRINTER_NAME=lp
+PRINT_FONT=Monospaced:16
+PRINT_ORIENTATION=P
+RADEC_CONVERSION=true
+RECIPE_SET=hawki_cal_dark=@plugindir@/hawki_cal_dark.so;hawki_cal_flat=@plugindir@/hawki_cal_flat.so;hawki_cal_zpoint=@plugindir@/hawki_cal_zpoint.so;hawki_sci_jitter=@plugindir@/hawki_sci_jitter.so;hawki_cal_illum=@plugindir@/hawki_cal_illum.so;hawki_cal_distortion=@plugindir@/hawki_cal_distortion.so;hawki_tec_filtchk=@plugindir@/hawki_tec_filtchk.so;hawki_step_basic_calib=@plugindir@/hawki_step_basic_calib.so;hawki_step_combine=@plugindir@/hawki_step_combine.so;hawki_step_compute_bkg=@ [...]
+SCRIPTS_DIR=gasgano/scripts
+SHORTEN_FILES_PATH=true
+SHORT_FILENAME=true
+SHOW_EXTENSIONS=true
+TEXTFILE_EXTENSIONS=ascii;paf;longlog
+TFITS_TO_VIEWER=
+TFITS_VIEWER_TYPE=SKYCAT
+UPDATE_TIMER=0
+VERBOSE_LEVEL=0
diff --git a/calib/gasgano/config/hawki.oca b/calib/gasgano/config/hawki.oca
new file mode 100644
index 0000000..42aae25
--- /dev/null
+++ b/calib/gasgano/config/hawki.oca
@@ -0,0 +1,375 @@
+if DPR.CATG like "%ACQUISITION%" then
+{
+  DO.CATG = "ACQ_IMAGE";
+}
+if DPR.TYPE like "%TEST%" then
+{
+  DO.CATG = "TEST";
+}
+if DPR.CATG like "%TECHNICAL%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%STD%" then
+{
+  DO.CATG = "TEC_STD";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%ASTROMETRY,OBJECT%"  then
+{
+  DO.CATG = "DISTOR_OBS";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%ASTROMETRY,SKY%"  then
+{
+  DO.CATG = "DISTOR_SKY";
+}
+if DPR.CATG like "%TECHNICAL%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%ASTROMETRY%" and DPR.TYPE like "%STD%" then
+{
+  DO.CATG = "TEC_ASTRO";
+}
+if DPR.CATG like "%TECHNICAL%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%FOCUS%" then
+{
+  DO.CATG = "TEC_FOCUS";
+}
+if DPR.CATG like "%TECHNICAL%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%FLAT%" then
+{
+  DO.CATG = "TEC_FLAT";
+}
+if DPR.CATG like "%SCIENCE%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%OBJECT%" then
+{
+  DO.CATG = "JITTER_OBS";
+}
+if DPR.CATG like "%SCIENCE%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%SKY%" then
+{
+  DO.CATG = "JITTER_SKY";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%DARK%" then
+{
+  DO.CATG = "DARK";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%FLAT%" then
+{
+  DO.CATG = "FLAT";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%STD%" then
+{
+  DO.CATG = "ZPOINT";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%LINEARITY,FLAT,DETCHAR%" then
+{
+  DO.CATG = "DETMON_LAMP_ON";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%LINEARITY,DARK,DETCHAR%" then
+{
+  DO.CATG = "DETMON_LAMP_OFF";
+}
+
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%FLAT,LAMP,DETCHECK%" then
+{
+  DO.CATG = "DETLIN_LAMP";
+}
+if DPR.CATG like "%CALIB%" and DPR.TECH like "%IMAGE%" and DPR.TYPE like "%DARK,DETCHECK%" then
+{
+  DO.CATG = "DETLIN_DARK";
+}
+
+if PRO.CATG == "COMBINED" then
+{
+  DO.CATG = "COMBINED";
+}
+
+if PRO.CATG == "STITCHED" then
+{
+  DO.CATG = "STITCHED";
+}
+
+if PRO.CATG == "DIST_CORRECTED" then
+{
+  DO.CATG = "DIST_CORRECTED";
+}
+
+if PRO.CATG == "ILLUM" then
+{
+  DO.CATG = "ILLUM";
+}
+
+if PRO.CATG == "BKG_IM" then
+{
+  DO.CATG = "BKG_IM";
+}
+
+if PRO.CATG == "BKG_MASK" then
+{
+  DO.CATG = "BKG_MASK";
+}
+
+if PRO.CATG == "OBJ_PARAM" then
+{
+  DO.CATG = "OBJ_PARAM";
+}
+
+if PRO.CATG == "OBJ_MASK" then
+{
+  DO.CATG = "OBJ_MASK";
+}
+
+if PRO.CATG == "SCIENCE_PCS" then
+{
+  DO.CATG = "SCIENCE_PCS";
+}
+
+if PRO.CATG == "FLAT_ERRMAP" then
+{
+  DO.CATG = "FLAT_ERRMAP";
+}
+
+if PRO.CATG == "BPM" then
+{
+  DO.CATG = "BPM";
+}
+
+if PRO.CATG == "BPM_HOT" then
+{
+  DO.CATG = "BPM_HOT";
+}
+
+if PRO.CATG == "BPM_COLD" then
+{
+  DO.CATG = "BPM_COLD";
+}
+
+if PRO.CATG == "FLAT_IM" then
+{
+  DO.CATG = "FLAT_IM";
+}
+
+if PRO.CATG == "FLAT_ERR" then
+{
+  DO.CATG = "FLAT_ERR";
+}
+
+if PRO.CATG == "FLAT_RECOMPUTED" then
+{
+  DO.CATG = "FLAT_RECOMPUTED";
+}
+
+if PRO.CATG == "DARK_IM" then
+{
+  DO.CATG = "DARK_IM";
+}
+
+if PRO.CATG == "DARK_ERR" then
+{
+  DO.CATG = "DARK_ERR";
+}
+
+if PRO.CATG == "ILLUM_PHOTOM" then
+{
+  DO.CATG = "ILLUM_PHOTOM";
+}
+
+if PRO.CATG == "FLAT_STATS" then
+{
+  DO.CATG = "FLAT_STATS";
+}
+
+if PRO.CATG == "FLAT_STATS_EVEN_COL" then
+{
+  DO.CATG = "FLAT_STATS_EVEN_COL";
+}
+
+if PRO.CATG == "FLAT_STATS_ODD_COL" then
+{
+  DO.CATG = "FLAT_STATS_ODD_COL";
+}
+
+if PRO.CATG == "FLAT_STATS_EVEN_ROW" then
+{
+  DO.CATG = "FLAT_STATS_EVEN_ROW";
+}
+
+if PRO.CATG == "FLAT_STATS_ODD_ROW" then
+{
+  DO.CATG = "FLAT_STATS_ODD_ROW";
+}
+
+if PRO.CATG == "DARK_STATS" then
+{
+  DO.CATG = "DARK_STATS";
+}
+
+if PRO.CATG == "ZPOINT_STATS" then
+{
+  DO.CATG = "ZPOINT_STATS";
+}
+
+if PRO.CATG == "JITTER_STATS" then
+{
+  DO.CATG = "JITTER_STATS";
+}
+
+if PRO.CATG == "BKG_STATS" then
+{
+  DO.CATG = "BKG_STATS";
+}
+
+if PRO.CATG == "STDSTARS_CATS" then
+{
+  DO.CATG = "STDSTARS_CATS";
+}
+
+if PRO.CATG == "DISTORTION_X" then
+{
+  DO.CATG = "DISTORTION_X";
+}
+
+if PRO.CATG == "DISTORTION_Y" then
+{
+  DO.CATG = "DISTORTION_Y";
+}
+
+if PRO.CATG == "ZPOINT_RES" then
+{
+  DO.CATG = "ZPOINT_RES";
+}
+
+if PRO.CATG == "ZPOINT_IMA" then
+{
+  DO.CATG = "ZPOINT_IMA";
+}
+
+if PRO.CATG == "DETLIN_A" then
+{
+  DO.CATG = "DETLIN_A";
+}
+
+if PRO.CATG == "DETLIN_B" then
+{
+  DO.CATG = "DETLIN_B";
+}
+
+if PRO.CATG == "DETLIN_C" then
+{
+  DO.CATG = "DETLIN_C";
+}
+
+if PRO.CATG == "DETLIN_Q" then
+{
+  DO.CATG = "DETLIN_Q";
+}
+
+if PRO.CATG == "LINGAIN_LIN" then
+{
+  DO.CATG = "LINGAIN_LIN";
+}
+
+if PRO.CATG == "LINGAIN_GAIN" then
+{
+  DO.CATG = "LINGAIN_GAIN";
+}
+
+if PRO.CATG == "LINGAIN_COEFFS" then
+{
+  DO.CATG = "LINGAIN_COEFFS";
+}
+
+if PRO.CATG == "LINGAIN_BPM" then
+{
+  DO.CATG = "LINGAIN_BPM";
+}
+
+if PRO.CATG == "LINGAIN_CORR" then
+{
+  DO.CATG = "LINGAIN_CORR";
+}
+
+if PRO.CATG == "LINGAIN_DIFF" then
+{
+  DO.CATG = "LINGAIN_DIFF";
+}
+
+if PRO.CATG == "BEST_FOCUS" then
+{
+  DO.CATG = "BEST_FOCUS";
+}
+
+if PRO.CATG == "BASIC_CALIBRATED" then
+{
+  DO.CATG = "BASIC_CALIBRATED";
+}
+
+if PRO.CATG == "SKY_BASIC_CALIBRATED" then
+{
+  DO.CATG = "SKY_BASIC_CALIBRATED";
+}
+
+if PRO.CATG == "BKG_SUBTRACTED" then
+{
+  DO.CATG = "BKG_SUBTRACTED";
+}
+
+if PRO.CATG == "FILTERPOS_CHECK_STATS" then
+{
+  DO.CATG = "FILTERPOS_CHECK_STATS";
+}
+
+if PRO.CATG == "OFFSETS_REFINED" then
+{
+  DO.CATG = "OFFSETS_REFINED";
+}
+
+select execute(hawki_cal_dark) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DARK"
+    group by DET.NCORRS.NAME,DET.DIT,DET.NDIT;
+select execute(hawki_tec_filtchk) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "TEC_FLAT"
+    group by INS.FILT1.NAME,INS.FILT2.NAME;
+select execute(hawki_cal_flat) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "FLAT"
+    group by DET.NCORRS.NAME,DET.DIT,DET.NDIT,INS.FILT1.NAME,INS.FILT2.NAME;
+select execute(hawki_cal_zpoint) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "ZPOINT"
+    group by INS.FILT1.NAME,INS.FILT2.NAME;
+select execute(detmon_ir_lg) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETMON_LAMP_ON";
+select execute(detmon_ir_lg) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETMON_LAMP_OFF";
+select execute(hawki_sci_jitter) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "JITTER_OBS";
+select execute(hawki_sci_jitter) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "JITTER_SKY";
+select execute(hawki_cal_distortion) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DISTOR_OBS"
+    group by ADA.POSANG;
+select execute(hawki_cal_distortion) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DISTOR_SKY"
+    group by ADA.POSANG;
+select execute(hawki_cal_illum) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "TEC_STD";
+
+action hawki_cal_illum
+{
+  recipe hawki_cal_illum;
+}
+action hawki_cal_distortion
+{
+  recipe hawki_cal_distortion;
+}
+action hawki_cal_dark
+{
+  recipe hawki_cal_dark;
+}
+action hawki_cal_flat
+{
+  minRet = 0; maxRet = 1;
+  recipe hawki_cal_flat
+  {
+    "--second_pass=false" ;
+  }
+}
+action detmon_ir_lg
+{
+  recipe detmon_ir_lg
+  {
+    "--exts=-1" ;
+  }
+}
+action hawki_cal_zpoint
+{
+  minRet = 1; maxRet = 1;
+  select file as STDSTARS_CATS from calibFiles 
+    where DO.CATG == "STDSTARS_CATS";
+  recipe hawki_cal_zpoint;
+}
+action hawki_sci_jitter
+{
+  recipe hawki_sci_jitter;
+}
+action hawki_tec_filtchk
+{
+  recipe hawki_tec_filtchk;
+}
diff --git a/calib/gasgano/config/hawki_wkf.oca b/calib/gasgano/config/hawki_wkf.oca
new file mode 100644
index 0000000..02c4410
--- /dev/null
+++ b/calib/gasgano/config/hawki_wkf.oca
@@ -0,0 +1,264 @@
+
+
+//CLASSIFICATION
+
+if DPR.CATG == "CALIB" and DPR.TECH == "IMAGE" and DPR.TYPE == "DARK"
+  and TPL.NEXP > 2 then
+{
+  RAW.TYPE = "DARK";
+  DO.CATG = "DARK";
+  PACK.DIR = "DARK";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "CALIB" and DPR.TECH == "IMAGE" and DPR.TYPE == "FLAT"
+  and TPL.ID != "HAWKI_img_tec_DetTest" and TPL.ID != "HAWKI_img_tec_DetLin"
+  and TPL.NEXP > 2 then
+{
+  RAW.TYPE = "FLAT";
+  DO.CATG = "FLAT";
+  PACK.DIR = "FLAT";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "CALIB" and DPR.TECH == "IMAGE" and DPR.TYPE == "STD"
+  and TPL.NEXP == 4
+  and (
+    INS.FILT1.NAME == "J" or
+    INS.FILT1.NAME == "H" or
+    INS.FILT1.NAME == "Ks" or
+    INS.FILT1.NAME == "Y"
+      ) and
+    INS.FILT2.NAME =="OPEN"
+  then
+{
+  RAW.TYPE = "STD";
+  DO.CATG = "ZPOINT";
+  PACK.DIR = "STD";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "TECHNICAL" and DPR.TECH == "IMAGE" and DPR.TYPE == "FLAT"
+  and TPL.NEXP > 1 then
+{
+  RAW.TYPE = "FILTCHK";
+  DO.CATG = "TEC_FLAT";
+  PACK.DIR = "NONE";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "ACQUISITION" then
+{
+  RAW.TYPE = "ACQUISITION";
+  DO.CATG = "ACQ_IMAGE";
+  PACK.DIR = "NONE";
+  CATG = "SCIENCE";
+}
+
+if DPR.CATG == "SCIENCE" and DPR.TECH == "IMAGE" and DPR.TYPE == "OBJECT" then
+{
+  RAW.TYPE = "SCIENCE_IMG";
+  DO.CATG = "JITTER_OBS";
+  PACK.DIR = "NONE";
+  CATG = "SCIENCE";
+}
+
+if DPR.CATG == "SCIENCE" and DPR.TECH == "IMAGE" and DPR.TYPE == "SKY" then
+{
+  RAW.TYPE = "SCIENCE_IMG";
+  DO.CATG = "JITTER_SKY";
+  PACK.DIR = "NONE";
+  CATG = "SCIENCE";
+}
+
+if DPR.CATG == "CALIB" and DPR.TYPE == "LINEARITY,DARK,DETCHAR" then
+{
+  RAW.TYPE = "DETLIN";
+  DO.CATG = "DETLIN_DARK";
+  PACK.DIR = "NONE";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "CALIB" and DPR.TYPE == "LINEARITY,FLAT,DETCHAR" then
+{
+  RAW.TYPE = "DETLIN";
+  DO.CATG = "DETLIN_LAMP";
+  PACK.DIR = "NONE";
+  CATG = "CALIB";
+}
+
+if DPR.CATG == "CALIB" and DPR.TECH == "IMAGE" and DPR.TYPE == "BIAS,DETCHECK" and TPL.ID == "HAWKI_img_tec_DetLin" then
+{
+  RAW.TYPE = "DETLIN";
+  DO.CATG = "DETLIN_DARK";
+  PACK.DIR = "NONE";
+  CATG = "CALIB";
+}
+if DPR.CATG == "CALIB" and DPR.TECH == "IMAGE" and DPR.TYPE == "FLAT" and TPL.ID == "HAWKI_img_tec_DetLin" then
+{
+  RAW.TYPE = "DETLIN";
+  DO.CATG = "DETLIN_LAMP";
+  PACK.DIR = "NONE";
+  CATG = "CALIB";
+}
+if DPR.CATG == "TECHNICAL" and DPR.TECH == "IMAGE" and DPR.TYPE == "STD" then
+{
+  RAW.TYPE = "TEC_STD";
+  DO.CATG = "TEC_STD";
+  PACK.DIR = "NONE";
+  CATG = "TECH";
+}
+if PRO.CATG == "DISTORTION_X" then
+{
+  DO.CATG  = "DISTORTION_X";
+  DO.CLASS = "DISTORTION_X";
+}
+if PRO.CATG == "DISTORTION_Y" then
+{
+  DO.CATG  = "DISTORTION_Y";
+  DO.CLASS = "DISTORTION_Y";
+}
+if CATNAME == "2mass" then
+{
+  DO.CATG  = "CAT_2MASS";
+  DO.CLASS = "CAT_2MASS";
+}
+
+
+
+//ORGANIZATION
+
+select execute(ACTION_DARK) from inputFiles where RAW.TYPE=="DARK"
+  group by DET.NCORRS.NAME,DET.DIT,DET.NDIT,TPL.START as (TPL_A,tpl);
+
+select execute(ACTION_FLAT) from inputFiles where RAW.TYPE=="FLAT"
+  group by DET.NCORRS.NAME,DET.DIT,DET.NDIT,INS.FILT1.NAME,INS.FILT2.NAME,TPL.START as (TPL_A,tpl);
+
+select execute(ACTION_STD) from inputFiles where RAW.TYPE=="STD"
+  group by DET.NCORRS.NAME,DET.DIT,DET.NDIT,INS.FILT1.NAME,INS.FILT2.NAME,OBS.TARG.NAME,TPL.START as (TPL_A,tpl);
+
+select execute(ACTION_FILTCHK) from inputFiles where RAW.TYPE=="FILTCHK"
+  group by DET.NCORRS.NAME,DET.DIT,INS.FILT1.NAME,INS.FILT2.NAME,TPL.START as (TPL_A,tpl);
+
+select execute(ACTION_SCIENCE_IMG) from inputFiles where RAW.TYPE=="SCIENCE_IMG"
+  group by DET.NCORRS.NAME,DET.DIT,INS.FILT1.NAME,INS.FILT2.NAME,TPL.START as (TPL_A,tpl);
+
+
+
+
+action ACTION_DARK
+{
+  recipe hawki_cal_dark {
+  "--sigma=10.0";
+}
+  product DARK_IM { PRO.CATG="DARK_IM"; PRO.EXT="tpl_0001.fits";}
+  product BPM_HOT { PRO.CATG="BPM_HOT"; PRO.EXT="tpl_0002.fits";}
+}
+
+
+action ACTION_FLAT
+{
+  minRet = 0; maxRet = 1;
+  select file as DARK_IM from calibFiles where
+     PRO.CATG=="DARK_IM"
+     and inputFile.DET.DIT==DET.DIT
+  ;
+  minRet = 1; maxRet = 1;
+  select file as BPM_HOT from calibFiles where
+     PRO.CATG=="BPM_HOT"
+  //   and inputFile.DET.DIT==DET.DIT
+  ;
+  recipe hawki_cal_flat{
+  "--normalise";
+  "--select_min_level=-1.0";
+  "--select_max_level=25000.0";
+  "--select_max_rms=4000.0";
+  "--select_auto=TRUE";
+  "--select_auto_max_bins=10";
+  "--select_min_nframes=3";
+  "--extra_stats=TRUE";
+  "--lowval_bpm=0.6" ;
+  "--highval_bpm=1.3" ;
+  }
+  product FLAT_IM { PRO.CATG="FLAT_IM"; PRO.EXT="tpl_0001.fits";}
+  product BPM_COLD { PRO.CATG="BPM_COLD"; PRO.EXT="tpl_0002.fits";}
+  product BPM_HOTCOLD { PRO.CATG="BPM"; PRO.EXT="tpl_0003.fits";}
+}
+
+action ACTION_STD
+{
+  minRet = 1; maxRet = 1;
+  select file as STDSTARS_CATS from calibFiles where
+     PRO.CATG=="STDSTARS_CATS"
+  ;
+  minRet = 1; maxRet = 1;
+  select file as FLAT_IM from calibFiles where
+     PRO.CATG=="FLAT_IM"
+     and inputFile.DET.NCORRS.NAME==DET.NCORRS.NAME
+     and inputFile.INS.FILT1.NAME==INS.FILT1.NAME and inputFile.INS.FILT2.NAME==INS.FILT2.NAME
+  ;
+  minRet = 1; maxRet = 1;
+  select file as BPM_HOTCOLD from calibFiles where
+     PRO.CATG=="BPM"
+     and inputFile.DET.NCORRS.NAME==DET.NCORRS.NAME
+     and inputFile.INS.FILT1.NAME==INS.FILT1.NAME and inputFile.INS.FILT2.NAME==INS.FILT2.NAME
+  ;
+  minRet = 0; maxRet = 1;
+  select file as DISTORTION_MASSOC from calibFiles where
+     PRO.CATG=="DISTORTION"
+  ;
+  minRet = 0; maxRet = 1;
+  select file as DARK_IM_MASSOC from calibFiles where
+     PRO.CATG=="DARK_IM"
+     and inputFile.DET.DIT==DET.DIT
+  ;
+  select file as BPM_HOT_MASSOC from calibFiles where
+     PRO.CATG=="BPM_HOT"
+     and inputFile.DET.DIT==DET.DIT
+  ;
+  minRet = 1; maxRet = 1;
+  select file as BPM_COLD_MASSOC from calibFiles where
+     PRO.CATG=="BPM_COLD"
+     and inputFile.DET.NCORRS.NAME==DET.NCORRS.NAME
+     and inputFile.INS.FILT1.NAME==INS.FILT1.NAME and inputFile.INS.FILT2.NAME==INS.FILT2.NAME
+  ;
+  recipe hawki_cal_zpoint;
+  product ZPOINT_IMA { PRO.CATG="ZPOINT_IMA"; PRO.EXT="tpl_0001.fits";}
+  product ZPOINT_RES { PRO.CATG="ZPOINT_RES"; PRO.EXT="tpl_0002.fits";}
+}
+
+action ACTION_SCIENCE_IMG
+{
+  minRet = 0; maxRet = 1;
+  select file as DISTORTION_X from calibFiles where
+     PRO.CATG=="DISTORTION_X";
+  select file as DISTORTION_Y from calibFiles where
+     PRO.CATG=="DISTORTION_Y";
+  minRet = 1; maxRet = 1;
+  select file as FLAT_IM from calibFiles where
+     PRO.CATG=="FLAT_IM"
+     and inputFile.DET.NCORRS.NAME==DET.NCORRS.NAME
+     and inputFile.INS.FILT1.NAME==INS.FILT1.NAME and inputFile.INS.FILT2.NAME==INS.FILT2.NAME;
+  minRet = 1; maxRet = 1;
+  select file as BPM_HOTCOLD from calibFiles where
+     PRO.CATG=="BPM"
+     and inputFile.DET.NCORRS.NAME==DET.NCORRS.NAME
+     and inputFile.INS.FILT1.NAME==INS.FILT1.NAME and inputFile.INS.FILT2.NAME==INS.FILT2.NAME;
+  minRet = 0; maxRet = 1;
+  select file as DARK_IM from calibFiles where
+     PRO.CATG=="DARK_IM"
+     and inputFile.DET.DIT==DET.DIT;
+  minRet = 0; maxRet = 1;
+  select file as CAT_2MASS from inputFiles where
+     DO.CATG =="CAT_2MASS";
+
+  recipe hawki_sci_jitter
+  {
+    "--refine";
+  }
+}
+
+action ACTION_FILTCHK
+{
+  recipe hawki_tec_filtchk;
+}
diff --git a/configure b/configure
index 70ebaae..da8ef96 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for HAWKI Instrument Pipeline 1.8.11.
+# Generated by GNU Autoconf 2.69 for HAWKI Instrument Pipeline 1.8.12.
 #
 # Report bugs to <usd-help at eso.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ 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
@@ -169,7 +192,8 @@ 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\$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'\" &&
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # 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
-	export CONFIG_SHELL
-	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+"$@"}
+  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 :
@@ -339,6 +367,14 @@ $as_echo X"$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
@@ -460,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   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 sensitive to this).
@@ -494,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... 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 -p'.
+    # 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 -p'
+      as_ln_s='cp -pR'
   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
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -515,28 +555,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+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'"
@@ -570,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='HAWKI Instrument Pipeline'
 PACKAGE_TARNAME='hawki'
-PACKAGE_VERSION='1.8.11'
-PACKAGE_STRING='HAWKI Instrument Pipeline 1.8.11'
+PACKAGE_VERSION='1.8.12'
+PACKAGE_STRING='HAWKI Instrument Pipeline 1.8.12'
 PACKAGE_BUGREPORT='usd-help at eso.org'
 PACKAGE_URL=''
 
@@ -682,6 +702,7 @@ CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -1284,8 +1305,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_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
@@ -1371,7 +1390,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 HAWKI Instrument Pipeline 1.8.11 to adapt to many kinds of systems.
+\`configure' configures HAWKI Instrument Pipeline 1.8.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1442,7 +1461,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of HAWKI Instrument Pipeline 1.8.11:";;
+     short | recursive ) echo "Configuration of HAWKI Instrument Pipeline 1.8.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1450,10 +1469,13 @@ 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-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]]
@@ -1469,7 +1491,7 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=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-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
@@ -1484,8 +1506,7 @@ Optional Packages:
   --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
@@ -1575,10 +1596,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-HAWKI Instrument Pipeline configure 1.8.11
-generated by GNU Autoconf 2.68
+HAWKI Instrument Pipeline configure 1.8.12
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 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
@@ -1729,7 +1750,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1952,7 +1973,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2111,8 +2132,8 @@ 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 HAWKI Instrument Pipeline $as_me 1.8.11, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by HAWKI Instrument Pipeline $as_me 1.8.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2603,7 +2624,7 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-am__api_version='1.11'
+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
@@ -2642,7 +2663,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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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.
@@ -2700,9 +2721,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -2713,32 +2731,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# 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".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   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
@@ -2750,6 +2776,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $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"
 # Use a double $ so make ignores it.
@@ -2776,8 +2812,8 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { $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;}
+  { $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
@@ -2789,10 +2825,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# 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.
+# 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.
@@ -2811,7 +2847,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -2851,7 +2887,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -2902,7 +2938,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   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) '* | \
@@ -2931,12 +2967,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 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.
@@ -2955,7 +2985,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -3041,7 +3071,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='hawki'
- VERSION='1.8.11'
+ VERSION='1.8.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3069,13 +3099,19 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+# 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.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# 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}'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -3240,7 +3276,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# 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
@@ -3273,6 +3309,7 @@ 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
   AMDEP_TRUE=
@@ -3305,7 +3342,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3345,7 +3382,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3398,7 +3435,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3439,7 +3476,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -3497,7 +3534,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3541,7 +3578,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3987,8 +4024,7 @@ 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);
@@ -4084,8 +4120,9 @@ else
   # 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.
@@ -4119,16 +4156,16 @@ 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"
+    # 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
+    # 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
@@ -4137,16 +4174,16 @@ else
       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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -4359,7 +4396,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4399,7 +4436,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4452,7 +4489,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4493,7 +4530,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -4551,7 +4588,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4595,7 +4632,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4791,8 +4828,7 @@ 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);
@@ -4888,8 +4924,9 @@ else
   # 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.
@@ -4923,16 +4960,16 @@ 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"
+    # 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
+    # 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
@@ -4941,16 +4978,16 @@ else
       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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -5032,7 +5069,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5076,7 +5113,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5272,8 +5309,9 @@ else
   # 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.
@@ -5307,16 +5345,16 @@ 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"
+    # 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
+    # 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
@@ -5325,16 +5363,16 @@ else
       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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -5543,14 +5581,19 @@ else
  choke me
 #endif
 #include <omp.h>
-int main () { return omp_get_num_threads (); }
+int var;
+#pragma omp threadprivate(var)
+int main () {
+return omp_get_num_threads ();
+}
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_prog_c_openmp='none needed'
 else
   ac_cv_prog_c_openmp='unsupported'
-													for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
+							            						for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \
+                     -Popenmp --openmp; do
 	  ac_save_CFLAGS=$CFLAGS
 	  CFLAGS="$CFLAGS $ac_option"
 	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5560,7 +5603,11 @@ else
  choke me
 #endif
 #include <omp.h>
-int main () { return omp_get_num_threads (); }
+int var;
+#pragma omp threadprivate(var)
+int main () {
+return omp_get_num_threads ();
+}
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
@@ -5572,7 +5619,7 @@ rm -f core conftest.err conftest.$ac_objext \
 	  if test "$ac_cv_prog_c_openmp" != unsupported; then
 	    break
 	  fi
-	  done
+    done
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -5581,9 +5628,9 @@ fi
 $as_echo "$ac_cv_prog_c_openmp" >&6; }
   case $ac_cv_prog_c_openmp in #(
   "none needed" | unsupported)
-	;; #(
+    ;; #(
   *)
-	OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;
+    OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;
   esac
 
 
@@ -6015,7 +6062,7 @@ do
     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"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      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
@@ -6081,7 +6128,7 @@ do
     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"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      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
@@ -6340,7 +6387,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_DOXYGEN="$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
@@ -6382,7 +6429,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LATEX="$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
@@ -6487,8 +6534,8 @@ esac
 
 
 
-macro_version='2.4'
-macro_revision='1.3293'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -6595,7 +6642,7 @@ do
     for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      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
@@ -6674,7 +6721,7 @@ do
     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"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      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
@@ -6930,7 +6977,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -6974,7 +7021,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7121,6 +7168,11 @@ else
     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
@@ -7160,7 +7212,7 @@ else
       # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      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
@@ -7382,7 +7434,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7422,7 +7474,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7589,7 +7641,7 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -7728,7 +7780,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7768,7 +7820,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7871,7 +7923,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -7915,7 +7967,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8040,7 +8092,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8080,7 +8132,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8139,7 +8191,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8179,7 +8231,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8229,13 +8281,13 @@ 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 -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -8382,6 +8434,7 @@ for ac_symprfx in "" "_"; do
     # 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};"\
@@ -8770,7 +8823,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*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
@@ -8781,7 +8834,20 @@ sparc*-*solaris*)
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      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"
@@ -8814,7 +8880,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8854,7 +8920,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8934,7 +9000,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -8974,7 +9040,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9026,7 +9092,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9066,7 +9132,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9118,7 +9184,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9158,7 +9224,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9210,7 +9276,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9250,7 +9316,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9302,7 +9368,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9342,7 +9408,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -9421,7 +9487,13 @@ else
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# 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
@@ -9432,6 +9504,7 @@ else
 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; }
+
     { $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 :
@@ -9464,6 +9537,7 @@ rm -f core conftest.err conftest.$ac_objext \
 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; }
+
     { $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 :
@@ -9485,7 +9559,9 @@ _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 -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      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
@@ -9704,7 +9780,22 @@ func_stripname_cnf ()
 
 # Check whether --with-pic was given.
 if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
+  withval=$with_pic; 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
 else
   pic_mode=default
 fi
@@ -9782,6 +9873,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
+
+
+
+
 test -z "$LN_S" && LN_S="ln -s"
 
 
@@ -10241,7 +10336,9 @@ lt_prog_compiler_static=
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       lt_prog_compiler_wl='-Xlinker '
-      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
       ;;
     esac
   else
@@ -10332,18 +10429,33 @@ lt_prog_compiler_static=
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ F* | *Sun*Fortran*)
+	*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
@@ -10705,7 +10817,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_direct=no
   hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
@@ -10955,8 +11066,7 @@ _LT_EOF
 	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=
-	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  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~
@@ -11335,6 +11445,7 @@ fi
 	# 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'
@@ -11380,6 +11491,7 @@ fi
   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\"`'
+
   else
     whole_archive_flag_spec=''
   fi
@@ -11408,10 +11520,6 @@ fi
       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
@@ -11424,7 +11532,7 @@ fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -11463,7 +11571,6 @@ fi
       fi
       if test "$with_gnu_ld" = no; then
 	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_flag_spec_ld='+b $libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
@@ -12087,11 +12194,6 @@ esac
 
 
 
-
-
-
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -12181,7 +12283,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  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
 
@@ -12190,7 +12292,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -12255,7 +12357,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  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'
@@ -12394,7 +12496,7 @@ darwin* | rhapsody*)
   ;;
 
 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'
@@ -12402,10 +12504,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -12413,7 +12511,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -12431,7 +12529,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -12451,17 +12549,18 @@ 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
+  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"
@@ -12522,7 +12621,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[3-9]*)
-  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}'
@@ -12538,7 +12637,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 ;;
@@ -12575,9 +12674,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-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}'
@@ -12663,7 +12762,7 @@ 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
@@ -12732,7 +12831,7 @@ rdos*)
   ;;
 
 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}'
@@ -12757,7 +12856,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
@@ -12781,7 +12880,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
@@ -12812,7 +12911,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  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}'
@@ -12822,7 +12921,7 @@ tpf*)
   ;;
 
 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
@@ -13747,7 +13846,6 @@ export_dynamic_flag_spec_CXX=
 hardcode_direct_CXX=no
 hardcode_direct_absolute_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
@@ -14331,6 +14429,7 @@ fi
   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
@@ -14375,7 +14474,7 @@ fi
         esac
         ;;
 
-      freebsd[12]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         ld_shlibs_CXX=no
@@ -15051,6 +15150,7 @@ _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
 
 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -15840,7 +15940,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
-    cl*) ;;
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
     *)
       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'
@@ -15993,8 +16095,6 @@ esac
 
 
 
-
-
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -16020,7 +16120,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  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
 
@@ -16029,7 +16129,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -16094,7 +16194,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  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'
@@ -16231,7 +16331,7 @@ darwin* | rhapsody*)
   ;;
 
 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'
@@ -16239,10 +16339,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -16250,7 +16346,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -16268,7 +16364,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -16288,17 +16384,18 @@ 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
+  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"
@@ -16359,7 +16456,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[3-9]*)
-  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}'
@@ -16375,7 +16472,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 ;;
@@ -16412,9 +16509,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-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}'
@@ -16500,7 +16597,7 @@ 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
@@ -16569,7 +16666,7 @@ rdos*)
   ;;
 
 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}'
@@ -16594,7 +16691,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
@@ -16618,7 +16715,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
@@ -16649,7 +16746,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  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}'
@@ -16659,7 +16756,7 @@ tpf*)
   ;;
 
 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
@@ -16798,6 +16895,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+
         ac_config_commands="$ac_config_commands libtool"
 
 
@@ -16988,11 +17087,11 @@ else
 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 cs;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -17009,8 +17108,9 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  { /* 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;
@@ -17026,10 +17126,10 @@ 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;
@@ -17278,7 +17378,7 @@ fi
     for i in $cpl_incdirs; do
         for j in $cpl_check_cpl_header; do
 
-            echo "configure: 17281: $i/$j" >&5
+            echo "configure: 17381: $i/$j" >&5
 
             if test -r "$i/$j"; then
                 echo "taking that" >&5
@@ -17328,7 +17428,7 @@ fi
     for i in $cpl_libdirs; do
         for j in $cpl_check_cpl_lib; do
 
-            echo "configure: 17331: $i/$j" >&5
+            echo "configure: 17431: $i/$j" >&5
 
             if test -r "$i/$j"; then
                 echo "taking that" >&5
@@ -17463,7 +17563,7 @@ fi
     for i in $cpl_cext_incdirs; do
         for j in $cpl_cext_check_header; do
 
-            echo "configure: 17466: $i/$j" >&5
+            echo "configure: 17566: $i/$j" >&5
 
             if test -r "$i/$j"; then
                 echo "taking that" >&5
@@ -17519,7 +17619,7 @@ fi
     for i in $cpl_cext_libdirs; do
         for j in $cpl_cext_check_lib; do
 
-            echo "configure: 17522: $i/$j" >&5
+            echo "configure: 17622: $i/$j" >&5
 
             if test -r "$i/$j"; then
                 echo "taking that" >&5
@@ -17751,6 +17851,7 @@ $as_echo "$as_me: WARNING: CPL checks have been disabled! This package may not b
 
 
 
+
 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.
@@ -17771,7 +17872,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -17814,7 +17915,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  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
@@ -17896,6 +17997,7 @@ if test -n "$GSL_CFLAGS"; then
   $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
@@ -17912,6 +18014,7 @@ if test -n "$GSL_LIBS"; then
   $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
@@ -17931,9 +18034,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gsl" 2>&1`
+	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl" 2>&1`
         else
-	        GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors "gsl" 2>&1`
+	        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
@@ -17992,7 +18095,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_PURIFY_CMD="purify"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -18335,6 +18438,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $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='#'
@@ -18665,16 +18776,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... 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 -p'.
+    # 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 -p'
+      as_ln_s='cp -pR'
   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
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -18734,28 +18845,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# 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'"
@@ -18776,8 +18875,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by HAWKI Instrument Pipeline $as_me 1.8.11, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by HAWKI Instrument Pipeline $as_me 1.8.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -18842,11 +18941,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-HAWKI Instrument Pipeline config.status 1.8.11
-configured by $0, generated by GNU Autoconf 2.68,
+HAWKI Instrument Pipeline config.status 1.8.12
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 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."
 
@@ -18937,7 +19036,7 @@ fi
 _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
+  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'
@@ -18979,6 +19078,7 @@ 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"`'
@@ -19061,7 +19161,6 @@ 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_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $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"`'
@@ -19133,7 +19232,6 @@ 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_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_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"`'
@@ -19172,6 +19270,7 @@ _LTECHO_EOF'
 # Quote evaled strings.
 for var in SHELL \
 ECHO \
+PATH_SEPARATOR \
 SED \
 GREP \
 EGREP \
@@ -19222,7 +19321,6 @@ with_gnu_ld \
 allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
 hardcode_libdir_separator \
 exclude_expsyms \
 include_expsyms \
@@ -19256,7 +19354,6 @@ with_gnu_ld_CXX \
 allow_undefined_flag_CXX \
 no_undefined_flag_CXX \
 hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_ld_CXX \
 hardcode_libdir_separator_CXX \
 exclude_expsyms_CXX \
 include_expsyms_CXX \
@@ -19973,7 +20070,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # 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
+    # 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.
@@ -20007,21 +20104,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # 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
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
@@ -20075,8 +20170,8 @@ $as_echo X"$file" |
 # 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 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -20130,6 +20225,9 @@ SHELL=$lt_SHELL
 # An echo program that protects backslashes.
 ECHO=$lt_ECHO
 
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
 # The host system.
 host_alias=$host_alias
 host=$host
@@ -20431,10 +20529,6 @@ no_undefined_flag=$lt_no_undefined_flag
 # 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
 
@@ -20777,10 +20871,6 @@ no_undefined_flag=$lt_no_undefined_flag_CXX
 # 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
 
diff --git a/configure.ac b/configure.ac
index 2ea7a73..3bf753f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([HAWKI Instrument Pipeline], [1.8.11], [usd-help at eso.org], [hawki])
+AC_INIT([HAWKI Instrument Pipeline], [1.8.12], [usd-help at eso.org], [hawki])
 AC_PREREQ([2.58])
 
 AC_CONFIG_SRCDIR([Makefile.am])
@@ -10,7 +10,7 @@ AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
 AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 
 AM_MAINTAINER_MODE
 
diff --git a/hawki/Makefile.am b/hawki/Makefile.am
index f410f3c..7fd1aa0 100644
--- a/hawki/Makefile.am
+++ b/hawki/Makefile.am
@@ -30,13 +30,10 @@ MAINTAINERCLEANFILES = Makefile.in
 endif
 
 
-CPPFLAGS = -DCX_LOG_DOMAIN=\"HawkiLib\"
+AM_CPPFLAGS = -DCX_LOG_DOMAIN=\"HawkiLib\"  $(all_includes)
 
-
-#AM_CPPFLAGS = $(GSL_CFLAGS) $(OPENMP_CFLAGS)
 AM_CFLAGS = $(GSL_CFLAGS) $(OPENMP_CFLAGS)
 
-INCLUDES = $(all_includes)
 
 noinst_HEADERS =    hawki_utils.h \
                     hawki_alloc.h \
diff --git a/hawki/Makefile.in b/hawki/Makefile.in
index 50d416b..f2dd314 100644
--- a/hawki/Makefile.in
+++ b/hawki/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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.
@@ -17,6 +16,23 @@
 
 
 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@
@@ -38,7 +54,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = hawki
 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/gsl.m4 \
@@ -77,6 +94,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)$(pkgincludedir)"
 LTLIBRARIES = $(privatelib_LTLIBRARIES)
@@ -122,6 +145,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-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) $(pkginclude_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
@@ -170,7 +198,7 @@ CFLAGS = @CFLAGS@
 CPL_INCLUDES = @CPL_INCLUDES@
 CPL_LDFLAGS = @CPL_LDFLAGS@
 CPP = @CPP@
-CPPFLAGS = -DCX_LOG_DOMAIN=\"HawkiLib\"
+CPPFLAGS = @CPPFLAGS@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
@@ -326,10 +354,8 @@ AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 SUBDIRS = tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-
-#AM_CPPFLAGS = $(GSL_CFLAGS) $(OPENMP_CFLAGS)
+AM_CPPFLAGS = -DCX_LOG_DOMAIN=\"HawkiLib\"  $(all_includes)
 AM_CFLAGS = $(GSL_CFLAGS) $(OPENMP_CFLAGS)
-INCLUDES = $(all_includes)
 noinst_HEADERS = hawki_utils.h \
                     hawki_alloc.h \
                     hawki_pfits.h \
@@ -409,7 +435,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-privatelibLTLIBRARIES: $(privatelib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(privatelibdir)" || $(MKDIR_P) "$(DESTDIR)$(privatelibdir)"
 	@list='$(privatelib_LTLIBRARIES)'; test -n "$(privatelibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -417,6 +442,8 @@ install-privatelibLTLIBRARIES: $(privatelib_LTLIBRARIES)
 	  else :; fi; \
 	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)"; \
 	}
@@ -432,13 +459,15 @@ uninstall-privatelibLTLIBRARIES:
 
 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
-libhawki.la: $(libhawki_la_OBJECTS) $(libhawki_la_DEPENDENCIES) 
+	@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}; \
+	}
+libhawki.la: $(libhawki_la_OBJECTS) $(libhawki_la_DEPENDENCIES) $(EXTRA_libhawki_la_DEPENDENCIES) 
 	$(libhawki_la_LINK) -rpath $(privatelibdir) $(libhawki_la_OBJECTS) $(libhawki_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -515,8 +544,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -530,17 +562,15 @@ uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+	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):
+# 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 \
@@ -550,7 +580,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; \
@@ -564,37 +598,6 @@ $(RECURSIVE_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-$(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; \
-	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; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -603,6 +606,10 @@ 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)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -666,6 +673,20 @@ GTAGS:
 	  && $(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
 
@@ -701,13 +722,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || 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; \
@@ -745,10 +763,15 @@ 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:
@@ -835,18 +858,20 @@ ps-am:
 uninstall-am: uninstall-pkgincludeHEADERS \
 	uninstall-privatelibLTLIBRARIES
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	clean-privatelibLTLIBRARIES 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-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 \
+	clean-privatelibLTLIBRARIES 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-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 \
diff --git a/hawki/hawki_alloc.c b/hawki/hawki_alloc.c
index b3fe4a1..0b08591 100644
--- a/hawki/hawki_alloc.c
+++ b/hawki/hawki_alloc.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2008/11/26 09:53:31 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_alloc.h b/hawki/hawki_alloc.h
index 6ed5454..aef99d7 100644
--- a/hawki/hawki_alloc.h
+++ b/hawki/hawki_alloc.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2008/11/26 09:53:21 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_ALLOC_H
diff --git a/hawki/hawki_bkg.cc b/hawki/hawki_bkg.cc
index 372a70a..b08d1ff 100644
--- a/hawki/hawki_bkg.cc
+++ b/hawki/hawki_bkg.cc
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/07 13:39:40 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_bkg.h b/hawki/hawki_bkg.h
index c807ec5..ea8d688 100644
--- a/hawki/hawki_bkg.h
+++ b/hawki/hawki_bkg.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/10 12:31:33 $
  * $Revision: 1.11 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_BKG_H
diff --git a/hawki/hawki_calib.c b/hawki/hawki_calib.c
index bcf7844..136b407 100644
--- a/hawki/hawki_calib.c
+++ b/hawki/hawki_calib.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2010/11/03 18:50:38 $
  * $Revision: 1.6 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_calib.h b/hawki/hawki_calib.h
index f118085..1044cbc 100644
--- a/hawki/hawki_calib.h
+++ b/hawki/hawki_calib.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2010/11/03 18:50:47 $
  * $Revision: 1.6 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_CALIB_H
diff --git a/hawki/hawki_combine.c b/hawki/hawki_combine.c
index 07dc10e..5840583 100644
--- a/hawki/hawki_combine.c
+++ b/hawki/hawki_combine.c
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2007/02/13 16:03:30 $
  * $Revision: 1.1.1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_combine.h b/hawki/hawki_combine.h
index fb05a7c..21a9015 100644
--- a/hawki/hawki_combine.h
+++ b/hawki/hawki_combine.h
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2007/02/13 16:03:30 $
  * $Revision: 1.1.1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_COMBINE_H
diff --git a/hawki/hawki_dfs.c b/hawki/hawki_dfs.c
index bcff000..626d129 100644
--- a/hawki/hawki_dfs.c
+++ b/hawki/hawki_dfs.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/07 09:36:29 $
  * $Revision: 1.29 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_dfs.h b/hawki/hawki_dfs.h
index 4a11f05..9d2040f 100644
--- a/hawki/hawki_dfs.h
+++ b/hawki/hawki_dfs.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/05 14:56:34 $
  * $Revision: 1.57 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_DFS_H
diff --git a/hawki/hawki_distortion.c b/hawki/hawki_distortion.c
index a8437ce..8844ef6 100644
--- a/hawki/hawki_distortion.c
+++ b/hawki/hawki_distortion.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/02/23 11:49:37 $
  * $Revision: 1.32 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_distortion.h b/hawki/hawki_distortion.h
index 5bb73f3..a076f15 100644
--- a/hawki/hawki_distortion.h
+++ b/hawki/hawki_distortion.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/07 14:09:12 $
  * $Revision: 1.13 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_DISTORTION_H
diff --git a/hawki/hawki_image.c b/hawki/hawki_image.c
index b324a20..eac483f 100644
--- a/hawki/hawki_image.c
+++ b/hawki/hawki_image.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/04 09:17:04 $
  * $Revision: 1.3 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_image.h b/hawki/hawki_image.h
index a7f57b0..f39b7a4 100644
--- a/hawki/hawki_image.h
+++ b/hawki/hawki_image.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/07 13:45:04 $
  * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_IMAGE_H
diff --git a/hawki/hawki_image_stats.c b/hawki/hawki_image_stats.c
index 73639de..ae50925 100644
--- a/hawki/hawki_image_stats.c
+++ b/hawki/hawki_image_stats.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/05/03 10:42:32 $
  * $Revision: 1.8 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_image_stats.h b/hawki/hawki_image_stats.h
index 325a492..4216f78 100644
--- a/hawki/hawki_image_stats.h
+++ b/hawki/hawki_image_stats.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/11/25 16:24:13 $
  * $Revision: 1.4 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_IMAGE_STATS_H
diff --git a/hawki/hawki_load.c b/hawki/hawki_load.c
index 94254cc..7ef24f2 100644
--- a/hawki/hawki_load.c
+++ b/hawki/hawki_load.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/12/04 10:39:14 $
  * $Revision: 1.40 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_load.h b/hawki/hawki_load.h
index d062a4a..241e6c3 100644
--- a/hawki/hawki_load.h
+++ b/hawki/hawki_load.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/05 14:56:52 $
  * $Revision: 1.22 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_LOAD_H
diff --git a/hawki/hawki_mask.c b/hawki/hawki_mask.c
index 2aa389d..eab3ae9 100644
--- a/hawki/hawki_mask.c
+++ b/hawki/hawki_mask.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2010/03/12 12:55:17 $
  * $Revision: 1.3 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_mask.h b/hawki/hawki_mask.h
index 1ac8539..b98c633 100644
--- a/hawki/hawki_mask.h
+++ b/hawki/hawki_mask.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/11/26 09:51:54 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_MASK_H
diff --git a/hawki/hawki_match_cats.c b/hawki/hawki_match_cats.c
index dc61ffe..8f87af4 100644
--- a/hawki/hawki_match_cats.c
+++ b/hawki/hawki_match_cats.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/11/26 09:52:32 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_match_cats.h b/hawki/hawki_match_cats.h
index bc61c3a..07e93fd 100644
--- a/hawki/hawki_match_cats.h
+++ b/hawki/hawki_match_cats.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/11/26 09:52:32 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_MATCH_CATS_H
diff --git a/hawki/hawki_obj_det.c b/hawki/hawki_obj_det.c
index a94f85b..94e4d82 100644
--- a/hawki/hawki_obj_det.c
+++ b/hawki/hawki_obj_det.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/09/29 09:13:00 $
  * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_obj_det.h b/hawki/hawki_obj_det.h
index ae2877e..c5695fb 100644
--- a/hawki/hawki_obj_det.h
+++ b/hawki/hawki_obj_det.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2008/10/22 10:42:04 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_OBJ_DET_H
diff --git a/hawki/hawki_pfits.c b/hawki/hawki_pfits.c
index 0bff27c..cb96e4a 100644
--- a/hawki/hawki_pfits.c
+++ b/hawki/hawki_pfits.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_pfits.c,v 1.18 2010/02/23 10:58:44 cgarcia Exp $
+/* $Id: hawki_pfits.c,v 1.19 2013/01/15 09:57:13 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2010/02/23 10:58:44 $
- * $Revision: 1.18 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/15 09:57:13 $
+ * $Revision: 1.19 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -123,6 +123,22 @@ double hawki_pfits_get_targ_alpha(const cpl_propertylist * plist)
 
 /*----------------------------------------------------------------------------*/
 /**
+  @brief    find out the target RA in HHMMSS format
+  @param    plist       property list to read from
+  @return   the requested value in degrees
+  
+  This function reads the keywords as it is, in HHMMSS.SS format
+ */
+/*----------------------------------------------------------------------------*/
+double hawki_pfits_get_targ_alpha_hhmmss(const cpl_propertylist * plist)
+{
+    double alpha_coded;
+    alpha_coded = cpl_propertylist_get_double(plist, "ESO TEL TARG ALPHA");
+    return alpha_coded;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
   @brief    find out the target DEC
   @param    plist       property list to read from
   @return   the requested value in degrees
@@ -145,6 +161,22 @@ double hawki_pfits_get_targ_delta(const cpl_propertylist * plist)
 
 /*----------------------------------------------------------------------------*/
 /**
+  @brief    find out the target DEC in DDMMSS format
+  @param    plist       property list to read from
+  @return   the requested value in degrees
+  
+  This function reads the keywords as it is, in DDMMSS.SS format
+ */
+/*----------------------------------------------------------------------------*/
+double hawki_pfits_get_targ_delta_ddmmss(const cpl_propertylist * plist)
+{
+    double delta_coded;
+    delta_coded = cpl_propertylist_get_double(plist, "ESO TEL TARG DELTA");
+    return delta_coded;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
   @brief    find out the target equinox
   @param    plist       property list to read from
   @return   the requested value in years
diff --git a/hawki/hawki_pfits.h b/hawki/hawki_pfits.h
index 3b60077..b59f7ae 100644
--- a/hawki/hawki_pfits.h
+++ b/hawki/hawki_pfits.h
@@ -1,4 +1,4 @@
-/* $Id: hawki_pfits.h,v 1.15 2012/12/07 13:45:43 cgarcia Exp $
+/* $Id: hawki_pfits.h,v 1.16 2013/01/15 09:57:13 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/12/07 13:45:43 $
- * $Revision: 1.15 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/15 09:57:13 $
+ * $Revision: 1.16 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_PFITS_H
@@ -44,7 +44,9 @@ double hawki_pfits_get_airmass_start(const cpl_propertylist * plist) ;
 double hawki_pfits_get_airmass_end(const cpl_propertylist * plist) ;
 double hawki_pfits_get_humidity_level(const cpl_propertylist * plist) ;
 double hawki_pfits_get_targ_alpha(const cpl_propertylist * plist) ;
+double hawki_pfits_get_targ_alpha_hhmmss(const cpl_propertylist * plist) ;
 double hawki_pfits_get_targ_delta(const cpl_propertylist * plist) ;
+double hawki_pfits_get_targ_delta_ddmmss(const cpl_propertylist * plist) ;
 double hawki_pfits_get_targ_equinox(const cpl_propertylist * plist);
 double hawki_pfits_get_targ_epoch(const cpl_propertylist * plist);
 double hawki_pfits_get_ra(const cpl_propertylist * plist) ;
diff --git a/hawki/hawki_properties_tel.c b/hawki/hawki_properties_tel.c
index 53582fe..12f5ea5 100644
--- a/hawki/hawki_properties_tel.c
+++ b/hawki/hawki_properties_tel.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2008/07/08 14:23:18 $
  * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_properties_tel.h b/hawki/hawki_properties_tel.h
index d37e855..94c0529 100644
--- a/hawki/hawki_properties_tel.h
+++ b/hawki/hawki_properties_tel.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2008/06/25 13:04:25 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_PROPERTIES_TEL_H
diff --git a/hawki/hawki_saa.c b/hawki/hawki_saa.c
index 6c1645d..cd4108a 100644
--- a/hawki/hawki_saa.c
+++ b/hawki/hawki_saa.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2010/03/08 16:20:54 $
  * $Revision: 1.10 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_saa.h b/hawki/hawki_saa.h
index 91d42d1..34cab94 100644
--- a/hawki/hawki_saa.h
+++ b/hawki/hawki_saa.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/02/05 12:51:14 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_SAA_H
diff --git a/hawki/hawki_save.c b/hawki/hawki_save.c
index 021b810..de1f2e3 100644
--- a/hawki/hawki_save.c
+++ b/hawki/hawki_save.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2010/11/29 03:37:15 $
  * $Revision: 1.11 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_save.h b/hawki/hawki_save.h
index 916b0e5..fe0fba7 100644
--- a/hawki/hawki_save.h
+++ b/hawki/hawki_save.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/05 14:57:03 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_SAVE_H
diff --git a/hawki/hawki_utils.c b/hawki/hawki_utils.c
index 9215c6f..2fc9159 100644
--- a/hawki/hawki_utils.c
+++ b/hawki/hawki_utils.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/06 16:55:32 $
  * $Revision: 1.54 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_utils.h b/hawki/hawki_utils.h
index b380641..98be0f1 100644
--- a/hawki/hawki_utils.h
+++ b/hawki/hawki_utils.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/12/06 16:55:32 $
  * $Revision: 1.43 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_UTILS_H
diff --git a/hawki/hawki_variance.c b/hawki/hawki_variance.c
index 95e82d1..1056578 100644
--- a/hawki/hawki_variance.c
+++ b/hawki/hawki_variance.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/03/13 11:52:06 $
  * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/hawki/hawki_variance.h b/hawki/hawki_variance.h
index 3433e08..31d59b9 100644
--- a/hawki/hawki_variance.h
+++ b/hawki/hawki_variance.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/03/13 11:52:14 $
  * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef HAWKI_VARIANCE_H
diff --git a/hawki/tests/Makefile.am b/hawki/tests/Makefile.am
index a3028ee..470350e 100644
--- a/hawki/tests/Makefile.am
+++ b/hawki/tests/Makefile.am
@@ -28,15 +28,15 @@ MAINTAINERCLEANFILES = Makefile.in
 endif
 
 
-INCLUDES = $(all_includes)
-
-LDADD = $(LIBHAWKI)
-AM_LDFLAGS =
+AM_CPPFLAGS = $(all_includes)
 
 #check_PROGRAMS = hawki_distortion-test  hawki_image-test hawki_robust_fit-test
 check_PROGRAMS = hawki_image-test 
 
 hawki_image_test_SOURCES = hawki_image-test.c 
+hawki_image_test_LDFLAGS = $(CPL_LDFLAGS)
+hawki_image_test_LDADD = $(LIBCPLCORE) $(LIBHAWKI)
+
 
 #hawki_distortion_test_SOURCES = hawki_distortion-test.c 
 
diff --git a/hawki/tests/Makefile.in b/hawki/tests/Makefile.in
index 6a1318f..b2139b6 100644
--- a/hawki/tests/Makefile.in
+++ b/hawki/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +14,23 @@
 
 @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@
@@ -36,7 +52,8 @@ host_triplet = @host@
 target_triplet = @target@
 check_PROGRAMS = hawki_image-test$(EXEEXT)
 subdir = hawki/tests
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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 \
@@ -56,9 +73,12 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am_hawki_image_test_OBJECTS = hawki_image-test.$(OBJEXT)
 hawki_image_test_OBJECTS = $(am_hawki_image_test_OBJECTS)
-hawki_image_test_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
-hawki_image_test_DEPENDENCIES = $(am__DEPENDENCIES_1)
+hawki_image_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+hawki_image_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(hawki_image_test_LDFLAGS) $(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
@@ -74,10 +94,17 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(hawki_image_test_SOURCES)
 DIST_SOURCES = $(hawki_image_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 = \
-red=; grn=; lgn=; blu=; std=
+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@
@@ -247,10 +274,10 @@ wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = $(all_includes)
-LDADD = $(LIBHAWKI)
-AM_LDFLAGS = 
+AM_CPPFLAGS = $(all_includes)
 hawki_image_test_SOURCES = hawki_image-test.c 
+hawki_image_test_LDFLAGS = $(CPL_LDFLAGS)
+hawki_image_test_LDADD = $(LIBCPLCORE) $(LIBHAWKI)
 
 #hawki_distortion_test_SOURCES = hawki_distortion-test.c 
 
@@ -306,9 +333,9 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-hawki_image-test$(EXEEXT): $(hawki_image_test_OBJECTS) $(hawki_image_test_DEPENDENCIES) 
+hawki_image-test$(EXEEXT): $(hawki_image_test_OBJECTS) $(hawki_image_test_DEPENDENCIES) $(EXTRA_hawki_image_test_DEPENDENCIES) 
 	@rm -f hawki_image-test$(EXEEXT)
-	$(LINK) $(hawki_image_test_OBJECTS) $(hawki_image_test_LDADD) $(LIBS)
+	$(hawki_image_test_LINK) $(hawki_image_test_OBJECTS) $(hawki_image_test_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -394,6 +421,20 @@ GTAGS:
 	  && $(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
 
@@ -407,7 +448,7 @@ check-TESTS: $(TESTS)
 	    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[\ \	]*) \
@@ -478,14 +519,15 @@ check-TESTS: $(TESTS)
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
 	  if test "$$failed" -eq 0; then \
-	    echo "$$grn$$dashes"; \
+	    col="$$grn"; \
 	  else \
-	    echo "$$red$$dashes"; \
+	    col="$$red"; \
 	  fi; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes$$std"; \
+	  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
 
@@ -535,10 +577,15 @@ 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:
@@ -627,7 +674,7 @@ uninstall-am:
 
 .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-dvi install-dvi-am install-exec \
diff --git a/hawki/tests/hawki_image-test.c b/hawki/tests/hawki_image-test.c
index 4751e54..aed7da5 100644
--- a/hawki/tests/hawki_image-test.c
+++ b/hawki/tests/hawki_image-test.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_image-test.c,v 1.2 2012/12/07 14:12:31 cgarcia Exp $
+/* $Id: hawki_image-test.c,v 1.3 2013/01/15 18:06:16 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/12/07 14:12:31 $
- * $Revision: 1.2 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/15 18:06:16 $
+ * $Revision: 1.3 $
+ * $Name: hawki-1_8_12 $
  */
 
 
@@ -34,6 +34,7 @@
                                    Includes
  -----------------------------------------------------------------------------*/
 
+#include "cpl_test.h"
 #include "hawki_image.h"
 
 /*-----------------------------------------------------------------------------
diff --git a/html/annotated.html b/html/annotated.html
index 1b8a630..abcea77 100644
--- a/html/annotated.html
+++ b/html/annotated.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: Data Structures</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -35,18 +41,23 @@
       <li><a href="classes.html"><span>Data Structure Index</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">Data Structures</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="textblock">Here are the data structures with brief descriptions:</div><table>
-  <tr><td class="indexkey"><a class="el" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a></td><td class="indexvalue"></td></tr>
+<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="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__hawki__distortion__obj__function__args__.html" target="_self">_hawki_distortion_obj_function_args_</a></td><td class="desc"></td></tr>
 </table>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+</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
index e401862..224b29a 100644
Binary files a/html/bc_s.png 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 1543a15..6670383 100644
--- a/html/classes.html
+++ b/html/classes.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: Data Structure Index</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -35,19 +41,27 @@
       <li class="current"><a href="classes.html"><span>Data Structure Index</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">Data Structure Index</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <div class="qindex"><a class="qindex" href="#letter__">_</a></div>
-<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
-<tr><td><a name="letter__"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  _  </div></td></tr></table>
-</td><td><a class="el" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a>   </td></tr></table><div class="qindex"><a class="qindex" href="#letter__">_</a></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<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__"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  _  </div></td></tr></table>
+</td><td></td></tr>
+<tr><td></td></tr>
+<tr><td valign="top"><a class="el" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a>   </td><td></td></tr>
+<tr><td></td><td></td></tr>
+</table>
+<div class="qindex"><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
index b7d4bd9..98cc2c9 100644
Binary files a/html/closed.png and b/html/closed.png differ
diff --git a/html/dir_0bffb7ec63ae446defe2a91d65f62d26.html b/html/dir_0bffb7ec63ae446defe2a91d65f62d26.html
new file mode 100644
index 0000000..6fc7724
--- /dev/null
+++ b/html/dir_0bffb7ec63ae446defe2a91d65f62d26.html
@@ -0,0 +1,130 @@
+<!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>HAWKI Pipeline Reference Manual: hawki 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">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">hawki 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:hawki__alloc_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_alloc.c</b> <a href="hawki__alloc_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__alloc_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_alloc.h</b> <a href="hawki__alloc_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__bkg_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_bkg.h</b> <a href="hawki__bkg_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__calib_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_calib.c</b> <a href="hawki__calib_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__calib_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_calib.h</b> <a href="hawki__calib_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__combine_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_combine.c</b> <a href="hawki__combine_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__combine_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_combine.h</b> <a href="hawki__combine_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__dfs_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_dfs.c</b> <a href="hawki__dfs_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__dfs_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_dfs.h</b> <a href="hawki__dfs_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__distortion_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_distortion.c</b> <a href="hawki__distortion_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__distortion_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_distortion.h</b> <a href="hawki__distortion_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__image_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image.c</b> <a href="hawki__image_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__image_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image.h</b> <a href="hawki__image_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__image__stats_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image_stats.c</b> <a href="hawki__image__stats_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__image__stats_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image_stats.h</b> <a href="hawki__image__stats_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__load_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_load.c</b> <a href="hawki__load_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__load_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_load.h</b> <a href="hawki__load_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__mask_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_mask.c</b> <a href="hawki__mask_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__mask_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_mask.h</b> <a href="hawki__mask_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__match__cats_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_match_cats.c</b> <a href="hawki__match__cats_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__match__cats_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_match_cats.h</b> <a href="hawki__match__cats_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__obj__det_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_obj_det.c</b> <a href="hawki__obj__det_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__obj__det_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_obj_det.h</b> <a href="hawki__obj__det_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__pfits_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_pfits.c</b> <a href="hawki__pfits_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__pfits_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_pfits.h</b> <a href="hawki__pfits_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__properties__tel_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_properties_tel.c</b> <a href="hawki__properties__tel_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__properties__tel_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_properties_tel.h</b> <a href="hawki__properties__tel_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__saa_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_saa.c</b> <a href="hawki__saa_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__saa_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_saa.h</b> <a href="hawki__saa_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__save_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_save.c</b> <a href="hawki__save_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__save_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_save.h</b> <a href="hawki__save_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__utils_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_utils.c</b> <a href="hawki__utils_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__utils_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_utils.h</b> <a href="hawki__utils_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__variance_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_variance.c</b> <a href="hawki__variance_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__variance_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_variance.h</b> <a href="hawki__variance_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_38d6ca2a11734cc7d27e97ffc4930ba5.html b/html/dir_38d6ca2a11734cc7d27e97ffc4930ba5.html
deleted file mode 100644
index 3beb938..0000000
--- a/html/dir_38d6ca2a11734cc7d27e97ffc4930ba5.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!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"/>
-<title>HAWKI Pipeline Reference Manual: /home/cgarcia/SDD/tmp/1.8.11/hawkip/recipes/ Directory Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td style="padding-left: 0.5em;">
-   <div id="projectname">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-  <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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
-    </ul>
-  </div>
-  <div id="nav-path" class="navpath">
-    <ul>
-      <li class="navelem"><a class="el" href="dir_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</a>      </li>
-    </ul>
-  </div>
-</div>
-<div class="header">
-  <div class="headertitle">
-<div class="title">recipes Directory Reference</div>  </div>
-</div>
-<div class="contents">
-<table class="memberdecls">
-<tr><td colspan="2"><h2><a name="files"></a>
-Files</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_dark.c</b> <a href="hawki__cal__dark_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_distortion.c</b> <a href="hawki__cal__distortion_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_flat.c</b> <a href="hawki__cal__flat_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_illum.c</b> <a href="hawki__cal__illum_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_lingain.c</b> <a href="hawki__cal__lingain_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_zpoint.c</b> <a href="hawki__cal__zpoint_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_sci_jitter.c</b> <a href="hawki__sci__jitter_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_apply_dist.c</b> <a href="hawki__step__apply__dist_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_basic_calib.c</b> <a href="hawki__step__basic__calib_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_combine.c</b> <a href="hawki__step__combine_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_detect_obj.c</b> <a href="hawki__step__detect__obj_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_photom_2mass.c</b> <a href="hawki__step__photom__2mass_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_refine_offsets.c</b> <a href="hawki__step__refine__offsets_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_stats.c</b> <a href="hawki__step__stats_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_stitch.c</b> <a href="hawki__step__stitch_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_subtract_bkg.c</b> <a href="hawki__step__subtract__bkg_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_tec_filtchk.c</b> <a href="hawki__tec__filtchk_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_extinction.c</b> <a href="hawki__util__extinction_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_gendist.c</b> <a href="hawki__util__gendist_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_stdstars.c</b> <a href="hawki__util__stdstars_8c_source.html">[code]</a></td></tr>
-</table>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
-</body>
-</html>
diff --git a/html/dir_8028944ee79da36d001a678d64addfcc.html b/html/dir_8028944ee79da36d001a678d64addfcc.html
deleted file mode 100644
index f4d23e5..0000000
--- a/html/dir_8028944ee79da36d001a678d64addfcc.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!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"/>
-<title>HAWKI Pipeline Reference Manual: /home/cgarcia/SDD/tmp/1.8.11/hawkip/hawki/ Directory Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td style="padding-left: 0.5em;">
-   <div id="projectname">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-  <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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
-    </ul>
-  </div>
-  <div id="nav-path" class="navpath">
-    <ul>
-      <li class="navelem"><a class="el" href="dir_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
-</div>
-<div class="header">
-  <div class="headertitle">
-<div class="title">hawki Directory Reference</div>  </div>
-</div>
-<div class="contents">
-<table class="memberdecls">
-<tr><td colspan="2"><h2><a name="files"></a>
-Files</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_alloc.c</b> <a href="hawki__alloc_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_alloc.h</b> <a href="hawki__alloc_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_bkg.h</b> <a href="hawki__bkg_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_calib.c</b> <a href="hawki__calib_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_calib.h</b> <a href="hawki__calib_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_combine.c</b> <a href="hawki__combine_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_combine.h</b> <a href="hawki__combine_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_dfs.c</b> <a href="hawki__dfs_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_dfs.h</b> <a href="hawki__dfs_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_distortion.c</b> <a href="hawki__distortion_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_distortion.h</b> <a href="hawki__distortion_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image.c</b> <a href="hawki__image_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image.h</b> <a href="hawki__image_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image_stats.c</b> <a href="hawki__image__stats_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_image_stats.h</b> <a href="hawki__image__stats_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_load.c</b> <a href="hawki__load_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_load.h</b> <a href="hawki__load_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_mask.c</b> <a href="hawki__mask_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_mask.h</b> <a href="hawki__mask_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_match_cats.c</b> <a href="hawki__match__cats_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_match_cats.h</b> <a href="hawki__match__cats_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_obj_det.c</b> <a href="hawki__obj__det_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_obj_det.h</b> <a href="hawki__obj__det_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_pfits.c</b> <a href="hawki__pfits_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_pfits.h</b> <a href="hawki__pfits_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_properties_tel.c</b> <a href="hawki__properties__tel_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_properties_tel.h</b> <a href="hawki__properties__tel_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_saa.c</b> <a href="hawki__saa_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_saa.h</b> <a href="hawki__saa_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_save.c</b> <a href="hawki__save_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_save.h</b> <a href="hawki__save_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_utils.c</b> <a href="hawki__utils_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_utils.h</b> <a href="hawki__utils_8h_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_variance.c</b> <a href="hawki__variance_8c_source.html">[code]</a></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_variance.h</b> <a href="hawki__variance_8h_source.html">[code]</a></td></tr>
-</table>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
-</body>
-</html>
diff --git a/html/dir_b351cdfeb4656d7d168dc72b273024e7.html b/html/dir_b351cdfeb4656d7d168dc72b273024e7.html
new file mode 100644
index 0000000..06e5ed5
--- /dev/null
+++ b/html/dir_b351cdfeb4656d7d168dc72b273024e7.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>HAWKI 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">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:hawki__cal__dark_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_dark.c</b> <a href="hawki__cal__dark_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__cal__distortion_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_distortion.c</b> <a href="hawki__cal__distortion_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__cal__flat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_flat.c</b> <a href="hawki__cal__flat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__cal__illum_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_illum.c</b> <a href="hawki__cal__illum_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__cal__lingain_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_lingain.c</b> <a href="hawki__cal__lingain_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__cal__zpoint_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_cal_zpoint.c</b> <a href="hawki__cal__zpoint_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__sci__jitter_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_sci_jitter.c</b> <a href="hawki__sci__jitter_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__apply__dist_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_apply_dist.c</b> <a href="hawki__step__apply__dist_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__basic__calib_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_basic_calib.c</b> <a href="hawki__step__basic__calib_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__combine_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_combine.c</b> <a href="hawki__step__combine_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__detect__obj_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_detect_obj.c</b> <a href="hawki__step__detect__obj_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__photom__2mass_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_photom_2mass.c</b> <a href="hawki__step__photom__2mass_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__refine__offsets_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_refine_offsets.c</b> <a href="hawki__step__refine__offsets_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__stats_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_stats.c</b> <a href="hawki__step__stats_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__stitch_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_stitch.c</b> <a href="hawki__step__stitch_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__step__subtract__bkg_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_step_subtract_bkg.c</b> <a href="hawki__step__subtract__bkg_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__tec__filtchk_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_tec_filtchk.c</b> <a href="hawki__tec__filtchk_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__util__extinction_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_extinction.c</b> <a href="hawki__util__extinction_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__util__gendist_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_gendist.c</b> <a href="hawki__util__gendist_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:hawki__util__stdstars_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>hawki_util_stdstars.c</b> <a href="hawki__util__stdstars_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/dirs.html b/html/dirs.html
deleted file mode 100644
index a92d9f9..0000000
--- a/html/dirs.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!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"/>
-<title>HAWKI Pipeline Reference Manual: Directories</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td style="padding-left: 0.5em;">
-   <div id="projectname">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-  <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>
-      <li class="current"><a href="dirs.html"><span>Directories</span></a></li>
-    </ul>
-  </div>
-</div>
-<div class="header">
-  <div class="headertitle">
-<div class="title">Directories</div>  </div>
-</div>
-<div class="contents">
-<div class="textblock">This directory hierarchy is sorted roughly, but not completely, alphabetically:</div><ul>
-<li><a class="el" href="dir_8028944ee79da36d001a678d64addfcc.html">hawki</a></li>
-<li><a class="el" href="dir_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</a></li>
-</ul>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
-</body>
-</html>
diff --git a/html/doxygen.css b/html/doxygen.css
index 74445fe..dabaff2 100644
--- a/html/doxygen.css
+++ b/html/doxygen.css
@@ -1,13 +1,12 @@
-/* The standard CSS for doxygen */
+/* The standard CSS for doxygen 1.8.3.1 */
 
 body, table, div, p, dl {
-	font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
-	font-size: 12px;
+	font: 400 14px/19px Roboto,sans-serif;
 }
 
 /* @group Heading Levels */
 
-h1 {
+h1.groupheader {
 	font-size: 150%;
 }
 
@@ -17,14 +16,34 @@ h1 {
 	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 {
+h3.groupheader {
 	font-size: 100%;
 }
 
+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;
 }
@@ -72,8 +91,6 @@ div.qindex, div.navtab{
 	background-color: #EBEFF6;
 	border: 1px solid #A3B4D7;
 	text-align: center;
-	margin: 2px;
-	padding: 2px;
 }
 
 div.qindex, div.navpath {
@@ -123,12 +140,12 @@ a.el {
 a.elRef {
 }
 
-a.code {
-	color: #4665A2;
+a.code, a.code:visited {
+	color: #4665A2; 
 }
 
-a.codeRef {
-	color: #4665A2;
+a.codeRef, a.codeRef:visited {
+	color: #4665A2; 
 }
 
 /* @end */
@@ -137,20 +154,72 @@ dl.el {
 	margin-left: -1cm;
 }
 
-.fragment {
+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: 105%;
+        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;
 }
 
-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%;
+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 {
@@ -183,15 +252,15 @@ div.groupText {
 }
 
 body {
-	background: white;
+	background-color: white;
 	color: black;
         margin: 0;
 }
 
 div.contents {
 	margin-top: 10px;
-	margin-left: 10px;
-	margin-right: 5px;
+	margin-left: 12px;
+	margin-right: 8px;
 }
 
 td.indexkey {
@@ -200,6 +269,8 @@ td.indexkey {
 	border: 1px solid #C4CFE5;
 	margin: 2px 0px 2px 0;
 	padding: 2px 10px;
+        white-space: nowrap;
+        vertical-align: top;
 }
 
 td.indexvalue {
@@ -292,6 +363,13 @@ span.vhdllogic {
 	color: #ff0000 
 }
 
+blockquote {
+        background-color: #F7F8FB;
+        border-left: 2px solid #9CAFD4;
+        margin: 0 24px 0 4px;
+        padding: 0 12px 0 16px;
+}
+
 /* @end */
 
 /*
@@ -345,6 +423,24 @@ table.memberdecls {
 	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 {
@@ -359,8 +455,11 @@ table.memberdecls {
 	color: #555;
 }
 
-.memItemLeft, .memItemRight, .memTemplParams {
-	border-top: 1px solid #C4CFE5;
+.memSeparator {
+        border-bottom: 1px solid #DEE4F0;
+        line-height: 1px;
+        margin: 0px;
+        padding: 0px;
 }
 
 .memItemLeft, .memTemplItemLeft {
@@ -374,6 +473,7 @@ table.memberdecls {
 .memTemplParams {
 	color: #4665A2;
         white-space: nowrap;
+	font-size: 80%;
 }
 
 /* @end */
@@ -406,15 +506,29 @@ table.memberdecls {
 	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;
         margin-left: 6px;
 }
 
-.memproto {
+.memname td {
+	vertical-align: bottom;
+}
+
+.memproto, dl.reflist dt {
         border-top: 1px solid #A8B8D9;
         border-left: 1px solid #A8B8D9;
         border-right: 1px solid #A8B8D9;
@@ -422,45 +536,55 @@ table.memberdecls {
         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: 8px;
-        border-top-left-radius: 8px;
+        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: 8px;
-        -moz-border-radius-topleft: 8px;
+        -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: 8px;
-        -webkit-border-top-left-radius: 8px;
-        background-image:url('nav_f.png');
-        background-repeat:repeat-x;
-        background-color: #E2E8F2;
+        -webkit-border-top-right-radius: 4px;
+        -webkit-border-top-left-radius: 4px;
 
 }
 
-.memdoc {
+.memdoc, dl.reflist dd {
         border-bottom: 1px solid #A8B8D9;      
         border-left: 1px solid #A8B8D9;      
         border-right: 1px solid #A8B8D9; 
-        padding: 2px 5px;
+        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: 8px;
-        border-bottom-right-radius: 8px;
+        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: 8px;
-        -moz-border-radius-bottomright: 8px;
+        -moz-border-radius-bottomleft: 4px;
+        -moz-border-radius-bottomright: 4px;
         -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
-        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
         /* webkit specific markup */
-        -webkit-border-bottom-left-radius: 8px;
-        -webkit-border-bottom-right-radius: 8px;
+        -webkit-border-bottom-left-radius: 4px;
+        -webkit-border-bottom-right-radius: 4px;
         -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+dl.reflist dt {
+        padding: 5px;
+}
+
+dl.reflist dd {
+        margin: 0px 0px 10px 0px;
+        padding: 5px;
 }
 
 .paramkey {
@@ -478,9 +602,13 @@ table.memberdecls {
 .paramname em {
 	font-style: normal;
 }
+.paramname code {
+        line-height: 14px;
+}
 
 .params, .retval, .exception, .tparams {
-        border-spacing: 6px 2px;
+        margin-left: 0px;
+        padding-left: 0px;
 }       
 
 .params .paramname, .retval .paramname {
@@ -498,105 +626,116 @@ table.memberdecls {
         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;
+}
 
-/* @end */
-
-/* @group Directory (tree) */
-
-/* for the tree view */
+span.mlabels {
+        margin-left: 8px;
+}
 
-.ftvtree {
-	font-family: sans-serif;
-	margin: 0px;
+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;
 }
 
-/* these are for tree view when used as main index */
 
-.directory {
-	font-size: 9pt;
-	font-weight: bold;
-	margin: 5px;
-}
 
-.directory h3 {
-	margin: 0px;
-	margin-top: 1em;
-	font-size: 11pt;
-}
+/* @end */
 
-/*
-The following two styles can be used to replace the root node title
-with an image of your choice.  Simply uncomment the next two styles,
-specify the name of your image and be sure to set 'height' to the
-proper pixel height of your image.
-*/
+/* these are for tree view when not used as main index */
 
-/*
-.directory h3.swap {
-	height: 61px;
-	background-repeat: no-repeat;
-	background-image: url("yourimage.gif");
-}
-.directory h3.swap span {
-	display: none;
+div.directory {
+        margin: 10px 0px;
+        border-top: 1px solid #A8B8D9;
+        border-bottom: 1px solid #A8B8D9;
+        width: 100%;
 }
-*/
 
-.directory > h3 {
-	margin-top: 0;
+.directory table {
+        border-collapse:collapse;
 }
 
-.directory p {
-	margin: 0px;
-	white-space: nowrap;
+.directory td {
+        margin: 0px;
+        padding: 0px;
+	vertical-align: top;
 }
 
-.directory div {
-	display: none;
-	margin: 0px;
+.directory td.entry {
+        white-space: nowrap;
+        padding-right: 6px;
 }
 
-.directory img {
-	vertical-align: -30%;
+.directory td.entry a {
+        outline:none;
 }
 
-/* these are for tree view when not used as main index */
-
-.directory-alt {
-	font-size: 100%;
-	font-weight: bold;
+.directory td.entry a img {
+        border: none;
 }
 
-.directory-alt h3 {
-	margin: 0px;
-	margin-top: 1em;
-	font-size: 11pt;
+.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-alt > h3 {
-	margin-top: 0;
+.directory tr.even {
+	padding-left: 6px;
+	background-color: #F7F8FB;
 }
 
-.directory-alt p {
-	margin: 0px;
-	white-space: nowrap;
+.directory img {
+	vertical-align: -30%;
 }
 
-.directory-alt div {
-	display: none;
-	margin: 0px;
+.directory .levels {
+        white-space: nowrap;
+        width: 100%;
+        text-align: right;
+        font-size: 9pt;
 }
 
-.directory-alt img {
-	vertical-align: -30%;
+.directory .levels span {
+        cursor: pointer;
+        padding-left: 2px;
+        padding-right: 2px;
+	color: #3D578C;
 }
 
-/* @end */
-
 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 {
@@ -606,6 +745,8 @@ address {
 
 table.doxtable {
 	border-collapse:collapse;
+        margin-top: 4px;
+        margin-bottom: 4px;
 }
 
 table.doxtable td, table.doxtable th {
@@ -619,9 +760,72 @@ table.doxtable th {
 	font-size: 110%;
 	padding-bottom: 4px;
 	padding-top: 5px;
-	text-align:left;
 }
 
+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;
@@ -637,6 +841,7 @@ table.doxtable th {
 	font-size: 11px;
 	background-image:url('tab_b.png');
 	background-repeat:repeat-x;
+	background-position: 0 -5px;
 	height:30px;
 	line-height:30px;
 	color:#8AA0CC;
@@ -664,6 +869,10 @@ table.doxtable th {
 	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
@@ -702,7 +911,6 @@ div.summary a
 div.ingroups
 {
 	font-size: 8pt;
-	padding-left: 5px;
 	width: 50%;
 	text-align: left;
 }
@@ -731,47 +939,74 @@ 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.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
+dl.section
 {
-        border-left:4px solid;
-        padding: 0 0 0 6px;
+	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;
@@ -833,3 +1068,117 @@ dl.bug
 	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 635ed52..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 26abfe2..048a762 100644
--- a/html/files.html
+++ b/html/files.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: File List</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,72 +40,77 @@
       <li class="current"><a href="files.html"><span>File List</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">File List</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="textblock">Here is a list of all documented files with brief descriptions:</div><table>
-  <tr><td class="indexkey"><b>hawki_alloc.c</b> <a href="hawki__alloc_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_alloc.h</b> <a href="hawki__alloc_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_bkg.h</b> <a href="hawki__bkg_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_dark.c</b> <a href="hawki__cal__dark_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_distortion.c</b> <a href="hawki__cal__distortion_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_flat.c</b> <a href="hawki__cal__flat_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_illum.c</b> <a href="hawki__cal__illum_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_lingain.c</b> <a href="hawki__cal__lingain_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_cal_zpoint.c</b> <a href="hawki__cal__zpoint_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_calib.c</b> <a href="hawki__calib_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_calib.h</b> <a href="hawki__calib_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_combine.c</b> <a href="hawki__combine_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_combine.h</b> <a href="hawki__combine_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_dfs.c</b> <a href="hawki__dfs_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_dfs.h</b> <a href="hawki__dfs_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_distortion.c</b> <a href="hawki__distortion_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_distortion.h</b> <a href="hawki__distortion_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_image.c</b> <a href="hawki__image_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_image.h</b> <a href="hawki__image_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_image_stats.c</b> <a href="hawki__image__stats_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_image_stats.h</b> <a href="hawki__image__stats_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_load.c</b> <a href="hawki__load_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_load.h</b> <a href="hawki__load_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_mask.c</b> <a href="hawki__mask_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_mask.h</b> <a href="hawki__mask_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_match_cats.c</b> <a href="hawki__match__cats_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_match_cats.h</b> <a href="hawki__match__cats_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_obj_det.c</b> <a href="hawki__obj__det_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_obj_det.h</b> <a href="hawki__obj__det_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_pfits.c</b> <a href="hawki__pfits_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_pfits.h</b> <a href="hawki__pfits_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_properties_tel.c</b> <a href="hawki__properties__tel_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_properties_tel.h</b> <a href="hawki__properties__tel_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_saa.c</b> <a href="hawki__saa_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_saa.h</b> <a href="hawki__saa_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_save.c</b> <a href="hawki__save_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_save.h</b> <a href="hawki__save_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_sci_jitter.c</b> <a href="hawki__sci__jitter_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_apply_dist.c</b> <a href="hawki__step__apply__dist_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_basic_calib.c</b> <a href="hawki__step__basic__calib_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_combine.c</b> <a href="hawki__step__combine_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_detect_obj.c</b> <a href="hawki__step__detect__obj_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_photom_2mass.c</b> <a href="hawki__step__photom__2mass_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_refine_offsets.c</b> <a href="hawki__step__refine__offsets_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_stats.c</b> <a href="hawki__step__stats_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_stitch.c</b> <a href="hawki__step__stitch_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_step_subtract_bkg.c</b> <a href="hawki__step__subtract__bkg_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_tec_filtchk.c</b> <a href="hawki__tec__filtchk_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_util_extinction.c</b> <a href="hawki__util__extinction_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_util_gendist.c</b> <a href="hawki__util__gendist_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_util_stdstars.c</b> <a href="hawki__util__stdstars_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_utils.c</b> <a href="hawki__utils_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_utils.h</b> <a href="hawki__utils_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_variance.c</b> <a href="hawki__variance_8c_source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>hawki_variance.h</b> <a href="hawki__variance_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
+<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="hawki__alloc_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_alloc.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="hawki__alloc_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_alloc.h</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="hawki__bkg_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_bkg.h</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="hawki__cal__dark_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_dark.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="hawki__cal__distortion_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_distortion.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="hawki__cal__flat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_flat.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="hawki__cal__illum_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_illum.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="hawki__cal__lingain_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_lingain.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="hawki__cal__zpoint_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_cal_zpoint.c</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="hawki__calib_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_calib.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="hawki__calib_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_calib.h</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="hawki__combine_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_combine.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="hawki__combine_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_combine.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="hawki__dfs_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_dfs.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="hawki__dfs_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_dfs.h</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="hawki__distortion_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_distortion.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="hawki__distortion_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_distortion.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="hawki__image_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_image.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="hawki__image_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_image.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="hawki__image__stats_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_image_stats.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="hawki__image__stats_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_image_stats.h</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="hawki__load_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_load.c</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="hawki__load_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_load.h</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="hawki__mask_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_mask.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="hawki__mask_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_mask.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="hawki__match__cats_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_match_cats.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="hawki__match__cats_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_match_cats.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="hawki__obj__det_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_obj_det.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="hawki__obj__det_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_obj_det.h</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="hawki__pfits_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_pfits.c</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="hawki__pfits_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_pfits.h</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="hawki__properties__tel_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_properties_tel.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="hawki__properties__tel_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_properties_tel.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="hawki__saa_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_saa.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="hawki__saa_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_saa.h</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="hawki__save_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_save.c</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="hawki__save_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_save.h</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="hawki__sci__jitter_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_sci_jitter.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="hawki__step__apply__dist_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_apply_dist.c</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="hawki__step__basic__calib_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_basic_calib.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="hawki__step__combine_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_combine.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="hawki__step__detect__obj_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_detect_obj.c</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="hawki__step__photom__2mass_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_photom_2mass.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="hawki__step__refine__offsets_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_refine_offsets.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="hawki__step__stats_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_stats.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="hawki__step__stitch_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_stitch.c</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="hawki__step__subtract__bkg_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_step_subtract_bkg.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="hawki__tec__filtchk_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_tec_filtchk.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="hawki__util__extinction_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_util_extinction.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="hawki__util__gendist_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_util_gendist.c</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="hawki__util__stdstars_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_util_stdstars.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="hawki__utils_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_utils.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="hawki__utils_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_utils.h</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="hawki__variance_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_variance.c</b></td><td class="desc"></td></tr>
+<tr id="row_54_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a href="hawki__variance_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>hawki_variance.h</b></td><td class="desc"></td></tr>
 </table>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+</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/form_0.png b/html/form_0.png
index 28e622a..701d0fc 100644
Binary files a/html/form_0.png and b/html/form_0.png differ
diff --git a/html/form_1.png b/html/form_1.png
index cbb3673..f64a008 100644
Binary files a/html/form_1.png and b/html/form_1.png differ
diff --git a/html/form_2.png b/html/form_2.png
index 07fffae..4682a40 100644
Binary files a/html/form_2.png and b/html/form_2.png differ
diff --git a/html/form_3.png b/html/form_3.png
index fdc4c01..ec54246 100644
Binary files a/html/form_3.png and b/html/form_3.png differ
diff --git a/html/form_4.png b/html/form_4.png
index b609c5c..a452800 100644
Binary files a/html/form_4.png and b/html/form_4.png differ
diff --git a/html/form_5.png b/html/form_5.png
index c8f0517..1b50aac 100644
Binary files a/html/form_5.png and b/html/form_5.png differ
diff --git a/html/form_6.png b/html/form_6.png
index 29e3343..782eb57 100644
Binary files a/html/form_6.png and b/html/form_6.png differ
diff --git a/html/form_7.png b/html/form_7.png
index 2edd18b..2187c3b 100644
Binary files a/html/form_7.png and b/html/form_7.png differ
diff --git a/html/form_8.png b/html/form_8.png
index c6e01ed..26f568e 100644
Binary files a/html/form_8.png and b/html/form_8.png differ
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/group__hawki__alloc.html b/html/group__hawki__alloc.html
index 585d63b..f241ffb 100644
--- a/html/group__hawki__alloc.html
+++ b/html/group__hawki__alloc.html
@@ -2,51 +2,60 @@
 <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>HAWKI Pipeline Reference Manual: Allocation rutines</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Allocation rutines</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd">hawki_table_delete</a> (cpl_table **table)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocates a set of four tables.  <a href="#ga2c7746115db289a6cea907e2025d93bd"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_table ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080">hawki_table_new</a> (int nrow)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates a set of four tables.  <a href="#gad7e4f1acdafde6f40fac069f727c9080"></a><br/></td></tr>
+<tr class="memitem:ga2c7746115db289a6cea907e2025d93bd"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd">hawki_table_delete</a> (cpl_table **table)</td></tr>
+<tr class="memdesc:ga2c7746115db289a6cea907e2025d93bd"><td class="mdescLeft"> </td><td class="mdescRight">Deallocates a set of four tables.  <a href="#ga2c7746115db289a6cea907e2025d93bd">More...</a><br/></td></tr>
+<tr class="separator:ga2c7746115db289a6cea907e2025d93bd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad7e4f1acdafde6f40fac069f727c9080"><td class="memItemLeft" align="right" valign="top">cpl_table ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080">hawki_table_new</a> (int nrow)</td></tr>
+<tr class="memdesc:gad7e4f1acdafde6f40fac069f727c9080"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a set of four tables.  <a href="#gad7e4f1acdafde6f40fac069f727c9080">More...</a><br/></td></tr>
+<tr class="separator:gad7e4f1acdafde6f40fac069f727c9080"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga2c7746115db289a6cea907e2025d93bd"></a><!-- doxytag: member="hawki_alloc.c::hawki_table_delete" ref="ga2c7746115db289a6cea907e2025d93bd" args="(cpl_table **table)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga2c7746115db289a6cea907e2025d93bd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -58,23 +67,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Deallocates a set of four tables. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">tables</td><td>The tables to deallocate </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__alloc_8c_source.html#l00054">54</a> of file <a class="el" href="hawki__alloc_8c_source.html">hawki_alloc.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gad7e4f1acdafde6f40fac069f727c9080"></a><!-- doxytag: member="hawki_alloc.c::hawki_table_new" ref="gad7e4f1acdafde6f40fac069f727c9080" args="(int nrow)" -->
+<a class="anchor" id="gad7e4f1acdafde6f40fac069f727c9080"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -86,25 +94,27 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Allocates a set of four tables. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">nrow</td><td>The number of rows of each table </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The allocated tables </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The allocated tables </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__alloc_8c_source.html#l00072">72</a> of file <a class="el" href="hawki__alloc_8c_source.html">hawki_alloc.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__calib.html b/html/group__hawki__calib.html
index 757c749..e7161ae 100644
--- a/html/group__hawki__calib.html
+++ b/html/group__hawki__calib.html
@@ -2,61 +2,75 @@
 <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>HAWKI Pipeline Reference Manual: Basic calibration Utilities</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Basic calibration Utilities</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75">hawki_bkg_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *bkg)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the background subtraction to the images.  <a href="#ga648180245b7cace291a654d5b31e5f75"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b">hawki_bpm_calib</a> (cpl_image *ima, const char *bpm, int idet)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the BPM correction to an image.  <a href="#gacab5ec7e7db02bd1f46661c443a6c16b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571">hawki_flat_bpm_detector_calib</a> (cpl_imagelist *ilist, cpl_image *flat, cpl_image *bpm)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#ga07a2392c998d129862af73b06e1d0571"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c">hawki_flat_bpm_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *bpm)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#gabf25546801362d0be3ac42779e8fb29c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d">hawki_flat_dark_bpm_detector_calib</a> (cpl_imagelist *ilist, cpl_image *flat, cpl_image *dark, cpl_image *bpm)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#ga5602d5f6a5703dff30afa41235c9686d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489">hawki_flat_dark_bpm_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *dark, cpl_imagelist *bpm)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#gaa722d4147127c2af3088266c63d79489"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f">hawki_trim_detector_calib</a> (cpl_imagelist *imalist, int nborder)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Trim a list of hawki images (usually from one detector)  <a href="#ga5013786f602800e5899b011b21f9547f"></a><br/></td></tr>
+<tr class="memitem:ga648180245b7cace291a654d5b31e5f75"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75">hawki_bkg_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *bkg)</td></tr>
+<tr class="memdesc:ga648180245b7cace291a654d5b31e5f75"><td class="mdescLeft"> </td><td class="mdescRight">Apply the background subtraction to the images.  <a href="#ga648180245b7cace291a654d5b31e5f75">More...</a><br/></td></tr>
+<tr class="separator:ga648180245b7cace291a654d5b31e5f75"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacab5ec7e7db02bd1f46661c443a6c16b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b">hawki_bpm_calib</a> (cpl_image *ima, const char *bpm, int idet)</td></tr>
+<tr class="memdesc:gacab5ec7e7db02bd1f46661c443a6c16b"><td class="mdescLeft"> </td><td class="mdescRight">Apply the BPM correction to an image.  <a href="#gacab5ec7e7db02bd1f46661c443a6c16b">More...</a><br/></td></tr>
+<tr class="separator:gacab5ec7e7db02bd1f46661c443a6c16b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga07a2392c998d129862af73b06e1d0571"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571">hawki_flat_bpm_detector_calib</a> (cpl_imagelist *ilist, cpl_image *flat, cpl_image *bpm)</td></tr>
+<tr class="memdesc:ga07a2392c998d129862af73b06e1d0571"><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#ga07a2392c998d129862af73b06e1d0571">More...</a><br/></td></tr>
+<tr class="separator:ga07a2392c998d129862af73b06e1d0571"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabf25546801362d0be3ac42779e8fb29c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c">hawki_flat_bpm_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *bpm)</td></tr>
+<tr class="memdesc:gabf25546801362d0be3ac42779e8fb29c"><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#gabf25546801362d0be3ac42779e8fb29c">More...</a><br/></td></tr>
+<tr class="separator:gabf25546801362d0be3ac42779e8fb29c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5602d5f6a5703dff30afa41235c9686d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d">hawki_flat_dark_bpm_detector_calib</a> (cpl_imagelist *ilist, cpl_image *flat, cpl_image *dark, cpl_image *bpm)</td></tr>
+<tr class="memdesc:ga5602d5f6a5703dff30afa41235c9686d"><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#ga5602d5f6a5703dff30afa41235c9686d">More...</a><br/></td></tr>
+<tr class="separator:ga5602d5f6a5703dff30afa41235c9686d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa722d4147127c2af3088266c63d79489"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489">hawki_flat_dark_bpm_imglist_calib</a> (cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *dark, cpl_imagelist *bpm)</td></tr>
+<tr class="memdesc:gaa722d4147127c2af3088266c63d79489"><td class="mdescLeft"> </td><td class="mdescRight">Apply the calibration to the images.  <a href="#gaa722d4147127c2af3088266c63d79489">More...</a><br/></td></tr>
+<tr class="separator:gaa722d4147127c2af3088266c63d79489"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5013786f602800e5899b011b21f9547f"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f">hawki_trim_detector_calib</a> (cpl_imagelist *imalist, int nborder)</td></tr>
+<tr class="memdesc:ga5013786f602800e5899b011b21f9547f"><td class="mdescLeft"> </td><td class="mdescRight">Trim a list of hawki images (usually from one detector)  <a href="#ga5013786f602800e5899b011b21f9547f">More...</a><br/></td></tr>
+<tr class="separator:ga5013786f602800e5899b011b21f9547f"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga648180245b7cace291a654d5b31e5f75"></a><!-- doxytag: member="hawki_calib.c::hawki_bkg_imglist_calib" ref="ga648180245b7cace291a654d5b31e5f75" args="(cpl_imagelist *ilist, cpl_imagelist *bkg)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga648180245b7cace291a654d5b31e5f75"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -78,24 +92,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the background subtraction to the images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list </td></tr>
     <tr><td class="paramname">bkg</td><td>the background images </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__calib_8c_source.html#l00226">226</a> of file <a class="el" href="hawki__calib_8c_source.html">hawki_calib.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gacab5ec7e7db02bd1f46661c443a6c16b"></a><!-- doxytag: member="hawki_calib.c::hawki_bpm_calib" ref="gacab5ec7e7db02bd1f46661c443a6c16b" args="(cpl_image *ima, const char *bpm, int idet)" -->
+<a class="anchor" id="gacab5ec7e7db02bd1f46661c443a6c16b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -123,11 +136,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the BPM correction to an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ima</td><td>the image to correct </td></tr>
     <tr><td class="paramname">idet</td><td>the detector the image comes from </td></tr>
@@ -135,7 +147,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__calib_8c_source.html#l00450">450</a> of file <a class="el" href="hawki__calib_8c_source.html">hawki_calib.c</a>.</p>
 
@@ -143,7 +155,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga07a2392c998d129862af73b06e1d0571"></a><!-- doxytag: member="hawki_calib.c::hawki_flat_bpm_detector_calib" ref="ga07a2392c998d129862af73b06e1d0571" args="(cpl_imagelist *ilist, cpl_image *flat, cpl_image *bpm)" -->
+<a class="anchor" id="ga07a2392c998d129862af73b06e1d0571"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -171,11 +183,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the calibration to the images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list </td></tr>
     <tr><td class="paramname">flat</td><td>the flat field </td></tr>
@@ -184,7 +195,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes as an input a list of images which in principle should belong to the same HAWK-I detector. It also takes as an input an image for the flat, the dark and bpm for that detector. It is the responsability of the caller to ensure that the detector of all these inputs is the same. For dark and flat corrections the formula is as follows: </p>
 <p class="formulaDsp">
 <img class="formulaDsp" alt="\[ bc = \frac{(raw-dark)}{flat}\]" src="form_0.png"/>
@@ -194,7 +205,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gabf25546801362d0be3ac42779e8fb29c"></a><!-- doxytag: member="hawki_calib.c::hawki_flat_bpm_imglist_calib" ref="gabf25546801362d0be3ac42779e8fb29c" args="(cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *bpm)" -->
+<a class="anchor" id="gabf25546801362d0be3ac42779e8fb29c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -222,11 +233,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the calibration to the images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list </td></tr>
     <tr><td class="paramname">flat</td><td>the flat field </td></tr>
@@ -234,14 +244,14 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes as an input an image list that contains four images, one for each HAWK-I detector and the same for the flat and bpm. It applies the 2 corrections (if images are not null) to each detector. </p>
 
 <p>Definition at line <a class="el" href="hawki__calib_8c_source.html#l00161">161</a> of file <a class="el" href="hawki__calib_8c_source.html">hawki_calib.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga5602d5f6a5703dff30afa41235c9686d"></a><!-- doxytag: member="hawki_calib.c::hawki_flat_dark_bpm_detector_calib" ref="ga5602d5f6a5703dff30afa41235c9686d" args="(cpl_imagelist *ilist, cpl_image *flat, cpl_image *dark, cpl_image *bpm)" -->
+<a class="anchor" id="ga5602d5f6a5703dff30afa41235c9686d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -275,11 +285,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the calibration to the images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list </td></tr>
     <tr><td class="paramname">flat</td><td>the flat field </td></tr>
@@ -289,7 +298,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes as an input a list of images which in principle should belong to the same HAWK-I detector. It also takes as an input an image for the flat, the dark and bpm for that detector. It is the responsibility of the caller to ensure that the detector of all these inputs is the same. Take into account that the dark is just subtracted, no scaling is done. For dark and flat corrections the formula is as follows: </p>
 <p class="formulaDsp">
 <img class="formulaDsp" alt="\[ bc = \frac{(raw-dark)}{flat}\]" src="form_0.png"/>
@@ -299,7 +308,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaa722d4147127c2af3088266c63d79489"></a><!-- doxytag: member="hawki_calib.c::hawki_flat_dark_bpm_imglist_calib" ref="gaa722d4147127c2af3088266c63d79489" args="(cpl_imagelist *ilist, cpl_imagelist *flat, cpl_imagelist *dark, cpl_imagelist *bpm)" -->
+<a class="anchor" id="gaa722d4147127c2af3088266c63d79489"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -333,11 +342,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the calibration to the images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list </td></tr>
     <tr><td class="paramname">flat</td><td>the flat field </td></tr>
@@ -346,7 +354,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes as an input an image list that contains four images, one for each HAWK-I detector and the same for the flat, dark and bpm. It applies the 3 corrections (if images are not null) to each detector. Take into account that the dark is just subtracted, no scaling is done. For dark and flat corrections the formula is as follows: </p>
 <p class="formulaDsp">
 <img class="formulaDsp" alt="\[ bc = \frac{(raw-dark)}{flat}\]" src="form_0.png"/>
@@ -356,7 +364,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga5013786f602800e5899b011b21f9547f"></a><!-- doxytag: member="hawki_calib.c::hawki_trim_detector_calib" ref="ga5013786f602800e5899b011b21f9547f" args="(cpl_imagelist *imalist, int nborder)" -->
+<a class="anchor" id="ga5013786f602800e5899b011b21f9547f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -378,27 +386,29 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Trim a list of hawki images (usually from one detector) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>The image list </td></tr>
     <tr><td class="paramname">nborder</td><td>The number of pixels to trim in each border </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The trimmed images. NULL otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The trimmed images. NULL otherwise</dd></dl>
 <p>Not that the original ilist is emptied, but the user is still responsible to deallocate it with cpl_imagelist_delete() </p>
 
 <p>Definition at line <a class="el" href="hawki__calib_8c_source.html#l00413">413</a> of file <a class="el" href="hawki__calib_8c_source.html">hawki_calib.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__combine.html b/html/group__hawki__combine.html
index d52115e..adbbdba 100644
--- a/html/group__hawki__combine.html
+++ b/html/group__hawki__combine.html
@@ -2,44 +2,51 @@
 <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>HAWKI Pipeline Reference Manual: Images combination routines</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">Images combination routines</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<table class="memberdecls">
-</table>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__dfs.html b/html/group__hawki__dfs.html
index eda062a..de50838 100644
--- a/html/group__hawki__dfs.html
+++ b/html/group__hawki__dfs.html
@@ -2,51 +2,58 @@
 <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>HAWKI Pipeline Reference Manual: DFS related functions</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">DFS related functions</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b">hawki_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="#ga6d79b77b5f9d13aa0ceeb461410bb03b"></a><br/></td></tr>
+<tr class="memitem:ga6d79b77b5f9d13aa0ceeb461410bb03b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b">hawki_dfs_set_groups</a> (cpl_frameset *set)</td></tr>
+<tr class="memdesc:ga6d79b77b5f9d13aa0ceeb461410bb03b"><td class="mdescLeft"> </td><td class="mdescRight">Set the group as RAW or CALIB in a frameset.  <a href="#ga6d79b77b5f9d13aa0ceeb461410bb03b">More...</a><br/></td></tr>
+<tr class="separator:ga6d79b77b5f9d13aa0ceeb461410bb03b"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
 <p>TBD </p>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga6d79b77b5f9d13aa0ceeb461410bb03b"></a><!-- doxytag: member="hawki_dfs.c::hawki_dfs_set_groups" ref="ga6d79b77b5f9d13aa0ceeb461410bb03b" args="(cpl_frameset *set)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga6d79b77b5f9d13aa0ceeb461410bb03b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -58,25 +65,27 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Set the group as RAW or CALIB in a frameset. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<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>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__dfs_8c_source.html#l00060">60</a> of file <a class="el" href="hawki__dfs_8c_source.html">hawki_dfs.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__distortion.html b/html/group__hawki__distortion.html
index 79caebe..b096d2c 100644
--- a/html/group__hawki__distortion.html
+++ b/html/group__hawki__distortion.html
@@ -2,77 +2,99 @@
 <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>HAWKI Pipeline Reference Manual: Distortion correction</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#nested-classes">Data Structures</a> |
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Distortion correction</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="nested-classes"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
 Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a></td></tr>
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</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="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f">hawki_distortion_apply_maps</a> (cpl_imagelist *ilist, cpl_image **dist_x, cpl_image **dist_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction.  <a href="#ga4ad09d8cbb7f3ed8fddeb451f3b2056f"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea">hawki_distortion_compute_rms</a> (const cpl_table **ref_catalogues, const cpl_bivector *cat_offsets, const cpl_table *matching_sets, int ncats, hawki_distortion *distortion)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">This private function computes the rms, which is the objective function of the minimization algorithm.  <a href="#ga8a38c008060d64d9e62198505617e5ea"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484">hawki_distortion_correct_alldetectors</a> (cpl_image **ilist, const cpl_frame *frame_dist_x, const cpl_frame *frame_dist_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction.  <a href="#ga52da9acfab98a1592e65df9c6bfba484"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e">hawki_distortion_correct_coords</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distcorr, double *y_pos_distcorr)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction to one detector position.  <a href="#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c">hawki_distortion_correct_detector</a> (cpl_image *image, cpl_image *dist_x, cpl_image *dist_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction to one chip.  <a href="#ga872e536210e467ff47f70959f5390b7c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712">hawki_distortion_delete</a> (hawki_distortion *distortion)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocates a hawki_distortion structure.  <a href="#ga12a902f30ad5f4a6012b9df508d06712"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968">hawki_distortion_get_flag_vars</a> (double *x_val, double *y_val, int *pos_flag, int nvals, int *nvalid, double *var_x, double *var_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the standard deviation of two vectors, not using flagged values.  <a href="#gaa7dc1bd3e8cd954c453ecfdf2b0fe968"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345">hawki_distortion_get_size_x</a> (const hawki_distortion *distortion)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Gives the dimension in X of the distortion solution.  <a href="#gaaeaf96920122f1d4f64c164289588345"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c">hawki_distortion_get_size_y</a> (const hawki_distortion *distortion)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Gives the dimension in Y of the distortion solution.  <a href="#ga990c10037636042cfcc0b40332821e9c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">hawki_distortion * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d">hawki_distortion_grid_new</a> (int detector_nx, int detector_ny, int grid_size)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocate a new distortion solution.  <a href="#gae37defaaf5c0bd86686df3285b89763d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d">hawki_distortion_interpolate_distortion</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_dist, double *y_dist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Interpolates the distortion solution at a given position.  <a href="#ga27bd7baaf0df89d1d58b69968638b14d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3">hawki_distortion_inverse_correct_coords</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distinvcorr, double *y_pos_distinvcorr)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the inverse distortion correction to one detector position.  <a href="#ga9462a4c3d7e6d3cac66f7bef27f6cbe3"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">hawki_distortion * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7">hawki_distortion_load</a> (const cpl_frame *dist_x, const cpl_frame *dist_y, int idet)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Loads the distortion solution for one detector.  <a href="#gab9c3ebd02585f319d08b5149b44528e7"></a><br/></td></tr>
+<tr class="memitem:ga4ad09d8cbb7f3ed8fddeb451f3b2056f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f">hawki_distortion_apply_maps</a> (cpl_imagelist *ilist, cpl_image **dist_x, cpl_image **dist_y)</td></tr>
+<tr class="memdesc:ga4ad09d8cbb7f3ed8fddeb451f3b2056f"><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction.  <a href="#ga4ad09d8cbb7f3ed8fddeb451f3b2056f">More...</a><br/></td></tr>
+<tr class="separator:ga4ad09d8cbb7f3ed8fddeb451f3b2056f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8a38c008060d64d9e62198505617e5ea"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea">hawki_distortion_compute_rms</a> (const cpl_table **ref_catalogues, const cpl_bivector *cat_offsets, const cpl_table *matching_sets, int ncats, hawki_distortion *distortion)</td></tr>
+<tr class="memdesc:ga8a38c008060d64d9e62198505617e5ea"><td class="mdescLeft"> </td><td class="mdescRight">This private function computes the rms, which is the objective function of the minimization algorithm.  <a href="#ga8a38c008060d64d9e62198505617e5ea">More...</a><br/></td></tr>
+<tr class="separator:ga8a38c008060d64d9e62198505617e5ea"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga52da9acfab98a1592e65df9c6bfba484"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484">hawki_distortion_correct_alldetectors</a> (cpl_image **ilist, const cpl_frame *frame_dist_x, const cpl_frame *frame_dist_y)</td></tr>
+<tr class="memdesc:ga52da9acfab98a1592e65df9c6bfba484"><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction.  <a href="#ga52da9acfab98a1592e65df9c6bfba484">More...</a><br/></td></tr>
+<tr class="separator:ga52da9acfab98a1592e65df9c6bfba484"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e">hawki_distortion_correct_coords</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distcorr, double *y_pos_distcorr)</td></tr>
+<tr class="memdesc:ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction to one detector position.  <a href="#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e">More...</a><br/></td></tr>
+<tr class="separator:ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga872e536210e467ff47f70959f5390b7c"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c">hawki_distortion_correct_detector</a> (cpl_image *image, cpl_image *dist_x, cpl_image *dist_y)</td></tr>
+<tr class="memdesc:ga872e536210e467ff47f70959f5390b7c"><td class="mdescLeft"> </td><td class="mdescRight">Apply the distortion correction to one chip.  <a href="#ga872e536210e467ff47f70959f5390b7c">More...</a><br/></td></tr>
+<tr class="separator:ga872e536210e467ff47f70959f5390b7c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga12a902f30ad5f4a6012b9df508d06712"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712">hawki_distortion_delete</a> (hawki_distortion *distortion)</td></tr>
+<tr class="memdesc:ga12a902f30ad5f4a6012b9df508d06712"><td class="mdescLeft"> </td><td class="mdescRight">Deallocates a hawki_distortion structure.  <a href="#ga12a902f30ad5f4a6012b9df508d06712">More...</a><br/></td></tr>
+<tr class="separator:ga12a902f30ad5f4a6012b9df508d06712"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa7dc1bd3e8cd954c453ecfdf2b0fe968"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968">hawki_distortion_get_flag_vars</a> (double *x_val, double *y_val, int *pos_flag, int nvals, int *nvalid, double *var_x, double *var_y)</td></tr>
+<tr class="memdesc:gaa7dc1bd3e8cd954c453ecfdf2b0fe968"><td class="mdescLeft"> </td><td class="mdescRight">Compute the standard deviation of two vectors, not using flagged values.  <a href="#gaa7dc1bd3e8cd954c453ecfdf2b0fe968">More...</a><br/></td></tr>
+<tr class="separator:gaa7dc1bd3e8cd954c453ecfdf2b0fe968"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaaeaf96920122f1d4f64c164289588345"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345">hawki_distortion_get_size_x</a> (const hawki_distortion *distortion)</td></tr>
+<tr class="memdesc:gaaeaf96920122f1d4f64c164289588345"><td class="mdescLeft"> </td><td class="mdescRight">Gives the dimension in X of the distortion solution.  <a href="#gaaeaf96920122f1d4f64c164289588345">More...</a><br/></td></tr>
+<tr class="separator:gaaeaf96920122f1d4f64c164289588345"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga990c10037636042cfcc0b40332821e9c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c">hawki_distortion_get_size_y</a> (const hawki_distortion *distortion)</td></tr>
+<tr class="memdesc:ga990c10037636042cfcc0b40332821e9c"><td class="mdescLeft"> </td><td class="mdescRight">Gives the dimension in Y of the distortion solution.  <a href="#ga990c10037636042cfcc0b40332821e9c">More...</a><br/></td></tr>
+<tr class="separator:ga990c10037636042cfcc0b40332821e9c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae37defaaf5c0bd86686df3285b89763d"><td class="memItemLeft" align="right" valign="top">hawki_distortion * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d">hawki_distortion_grid_new</a> (int detector_nx, int detector_ny, int grid_size)</td></tr>
+<tr class="memdesc:gae37defaaf5c0bd86686df3285b89763d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate a new distortion solution.  <a href="#gae37defaaf5c0bd86686df3285b89763d">More...</a><br/></td></tr>
+<tr class="separator:gae37defaaf5c0bd86686df3285b89763d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga27bd7baaf0df89d1d58b69968638b14d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d">hawki_distortion_interpolate_distortion</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_dist, double *y_dist)</td></tr>
+<tr class="memdesc:ga27bd7baaf0df89d1d58b69968638b14d"><td class="mdescLeft"> </td><td class="mdescRight">Interpolates the distortion solution at a given position.  <a href="#ga27bd7baaf0df89d1d58b69968638b14d">More...</a><br/></td></tr>
+<tr class="separator:ga27bd7baaf0df89d1d58b69968638b14d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9462a4c3d7e6d3cac66f7bef27f6cbe3"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3">hawki_distortion_inverse_correct_coords</a> (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distinvcorr, double *y_pos_distinvcorr)</td></tr>
+<tr class="memdesc:ga9462a4c3d7e6d3cac66f7bef27f6cbe3"><td class="mdescLeft"> </td><td class="mdescRight">Apply the inverse distortion correction to one detector position.  <a href="#ga9462a4c3d7e6d3cac66f7bef27f6cbe3">More...</a><br/></td></tr>
+<tr class="separator:ga9462a4c3d7e6d3cac66f7bef27f6cbe3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab9c3ebd02585f319d08b5149b44528e7"><td class="memItemLeft" align="right" valign="top">hawki_distortion * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7">hawki_distortion_load</a> (const cpl_frame *dist_x, const cpl_frame *dist_y, int idet)</td></tr>
+<tr class="memdesc:gab9c3ebd02585f319d08b5149b44528e7"><td class="mdescLeft"> </td><td class="mdescRight">Loads the distortion solution for one detector.  <a href="#gab9c3ebd02585f319d08b5149b44528e7">More...</a><br/></td></tr>
+<tr class="separator:gab9c3ebd02585f319d08b5149b44528e7"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga4ad09d8cbb7f3ed8fddeb451f3b2056f"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_apply_maps" ref="ga4ad09d8cbb7f3ed8fddeb451f3b2056f" args="(cpl_imagelist *ilist, cpl_image **dist_x, cpl_image **dist_y)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga4ad09d8cbb7f3ed8fddeb451f3b2056f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -100,18 +122,17 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the distortion correction. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list (chips 1 2 3 4) </td></tr>
     <tr><td class="paramname">dist</td><td>the distortion file </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00617">617</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -119,7 +140,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga8a38c008060d64d9e62198505617e5ea"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_compute_rms" ref="ga8a38c008060d64d9e62198505617e5ea" args="(const cpl_table **ref_catalogues, const cpl_bivector *cat_offsets, const cpl_table *matching_sets, int ncats, hawki_distortion *distortion)" -->
+<a class="anchor" id="ga8a38c008060d64d9e62198505617e5ea"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -159,11 +180,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>This private function computes the rms, which is the objective function of the minimization algorithm. </p>
-<dl class="see"><dt><b>See also:</b></dt><dd>hawki_distortion_compute_solution </dd></dl>
+<dl class="section see"><dt>See Also</dt><dd>hawki_distortion_compute_solution </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00930">930</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -171,7 +191,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga52da9acfab98a1592e65df9c6bfba484"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_correct_alldetectors" ref="ga52da9acfab98a1592e65df9c6bfba484" args="(cpl_image **ilist, const cpl_frame *frame_dist_x, const cpl_frame *frame_dist_y)" -->
+<a class="anchor" id="ga52da9acfab98a1592e65df9c6bfba484"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -199,18 +219,17 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the distortion correction. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ilist</td><td>the input image list (chips 1 2 3 4) </td></tr>
     <tr><td class="paramname">dist</td><td>the distortion file </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00287">287</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -218,7 +237,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_correct_coords" ref="ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e" args="(const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distcorr, double *y_pos_distcorr)" -->
+<a class="anchor" id="ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -258,11 +277,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the distortion correction to one detector position. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">distortion</td><td>the distortion solution </td></tr>
     <tr><td class="paramname">x_pos</td><td>the X position in detector that we want to correct. </td></tr>
@@ -272,9 +290,9 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-<p>This function will interpolate the distortion solution (given in variable distortion, </p>
-<dl class="see"><dt><b>See also:</b></dt><dd>hawki_distortion_new) </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>This function will interpolate the distortion solution (given in variable distortion,</p>
+<dl class="section see"><dt>See Also</dt><dd>hawki_distortion_new) </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00423">423</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -282,7 +300,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga872e536210e467ff47f70959f5390b7c"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_correct_detector" ref="ga872e536210e467ff47f70959f5390b7c" args="(cpl_image *image, cpl_image *dist_x, cpl_image *dist_y)" -->
+<a class="anchor" id="ga872e536210e467ff47f70959f5390b7c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -310,18 +328,17 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the distortion correction to one chip. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image</td><td>the input image </td></tr>
     <tr><td class="paramname">dist</td><td>the distortion table </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00371">371</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -329,7 +346,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga12a902f30ad5f4a6012b9df508d06712"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_delete" ref="ga12a902f30ad5f4a6012b9df508d06712" args="(hawki_distortion *distortion)" -->
+<a class="anchor" id="ga12a902f30ad5f4a6012b9df508d06712"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -341,11 +358,10 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Deallocates a hawki_distortion structure. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">distortion</td><td>The distortion to allocate </td></tr>
   </table>
@@ -358,7 +374,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaa7dc1bd3e8cd954c453ecfdf2b0fe968"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_get_flag_vars" ref="gaa7dc1bd3e8cd954c453ecfdf2b0fe968" args="(double *x_val, double *y_val, int *pos_flag, int nvals, int *nvalid, double *var_x, double *var_y)" -->
+<a class="anchor" id="gaa7dc1bd3e8cd954c453ecfdf2b0fe968"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -410,11 +426,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the standard deviation of two vectors, not using flagged values. </p>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The standard deviation </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The standard deviation </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l01198">1198</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -422,7 +437,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaaeaf96920122f1d4f64c164289588345"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_get_size_x" ref="gaaeaf96920122f1d4f64c164289588345" args="(const hawki_distortion *distortion)" -->
+<a class="anchor" id="gaaeaf96920122f1d4f64c164289588345"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -434,23 +449,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Gives the dimension in X of the distortion solution. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">dist</td><td>the distortion solution </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The dimension in X </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The dimension in X </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00252">252</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga990c10037636042cfcc0b40332821e9c"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_get_size_y" ref="ga990c10037636042cfcc0b40332821e9c" args="(const hawki_distortion *distortion)" -->
+<a class="anchor" id="ga990c10037636042cfcc0b40332821e9c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -462,23 +476,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Gives the dimension in Y of the distortion solution. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">dist</td><td>the distortion solution </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The dimension in Y </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The dimension in Y </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00269">269</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gae37defaaf5c0bd86686df3285b89763d"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_grid_new" ref="gae37defaaf5c0bd86686df3285b89763d" args="(int detector_nx, int detector_ny, int grid_size)" -->
+<a class="anchor" id="gae37defaaf5c0bd86686df3285b89763d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -506,11 +519,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Allocate a new distortion solution. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">detector_nx</td><td>The dimensions in X of a HAWK-I detector </td></tr>
     <tr><td class="paramname">detector_nx</td><td>The dimensions in Y of a HAWK-I detector </td></tr>
@@ -518,13 +530,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The allocated distortion if everything is ok , NULL otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The allocated distortion if everything is ok , NULL otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00132">132</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga27bd7baaf0df89d1d58b69968638b14d"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_interpolate_distortion" ref="ga27bd7baaf0df89d1d58b69968638b14d" args="(const hawki_distortion *distortion, double x_pos, double y_pos, double *x_dist, double *y_dist)" -->
+<a class="anchor" id="ga27bd7baaf0df89d1d58b69968638b14d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -564,11 +576,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Interpolates the distortion solution at a given position. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">distortion</td><td>the distortion solution </td></tr>
     <tr><td class="paramname">x_pos</td><td>the X position in detector that we want to correct. </td></tr>
@@ -578,7 +589,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This private function uses the four reference points found in distortion closer to x_pos, y_pos. Then it weights each point with the 3rd power of the distance to the target pixel and uses a linear interpolation.</p>
 <p>If this function is used in a multithread environment with a CPL version not thread-safe, there is no risk as long as these two premises are hold: -The caller must check if distortion->dist_x and distortion->dist_y are not null before calling this function, because this is check by cpl_image_get_size_x and cpl_image_get. -The caller must check in advance that the mask has all the points valid, because cpl_image_get checks for the validity of the pixel in the mask, if it is not v [...]
 
@@ -588,7 +599,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga9462a4c3d7e6d3cac66f7bef27f6cbe3"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_inverse_correct_coords" ref="ga9462a4c3d7e6d3cac66f7bef27f6cbe3" args="(const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distinvcorr, double *y_pos_distinvcorr)" -->
+<a class="anchor" id="ga9462a4c3d7e6d3cac66f7bef27f6cbe3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -628,11 +639,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the inverse distortion correction to one detector position. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">distortion</td><td>the distortion solution </td></tr>
     <tr><td class="paramname">x_pos</td><td>the X position in detector that we want to decorrect. </td></tr>
@@ -642,7 +652,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function is the inverse function of hawki_distortion_correct_coords. WARNING: Although this is the "inverse" of hawki_distortion_correct_coords, applying this function to positions delivered by hawki_distortion_correct_coords will not provide the original positions back. We are simply not using the same position to interpolate the distortion table. </p>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00467">467</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
@@ -651,7 +661,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gab9c3ebd02585f319d08b5149b44528e7"></a><!-- doxytag: member="hawki_distortion.c::hawki_distortion_load" ref="gab9c3ebd02585f319d08b5149b44528e7" args="(const cpl_frame *dist_x, const cpl_frame *dist_y, int idet)" -->
+<a class="anchor" id="gab9c3ebd02585f319d08b5149b44528e7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -679,11 +689,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Loads the distortion solution for one detector. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">dist_x</td><td>the image with distortion in X </td></tr>
     <tr><td class="paramname">dist_y</td><td>the image with distortion in Y </td></tr>
@@ -691,7 +700,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The allocated distortion if everything is ok , NULL otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The allocated distortion if everything is ok , NULL otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00182">182</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 
@@ -701,9 +710,12 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__image.html b/html/group__hawki__image.html
index 4fa6bd8..0136012 100644
--- a/html/group__hawki__image.html
+++ b/html/group__hawki__image.html
@@ -2,49 +2,57 @@
 <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>HAWKI Pipeline Reference Manual: Image manipulation</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Image manipulation</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d">hawki_image_copy_to_intersection</a> (cpl_image *target, const cpl_image *from, cpl_size target_shift_x, cpl_size target_shift_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copies the values of an image to the intersection of two images.  <a href="#ga346a296d47b16f2b677665c01adbd41d"></a><br/></td></tr>
+<tr class="memitem:ga346a296d47b16f2b677665c01adbd41d"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d">hawki_image_copy_to_intersection</a> (cpl_image *target, const cpl_image *from, cpl_size target_shift_x, cpl_size target_shift_y)</td></tr>
+<tr class="memdesc:ga346a296d47b16f2b677665c01adbd41d"><td class="mdescLeft"> </td><td class="mdescRight">Copies the values of an image to the intersection of two images.  <a href="#ga346a296d47b16f2b677665c01adbd41d">More...</a><br/></td></tr>
+<tr class="separator:ga346a296d47b16f2b677665c01adbd41d"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga346a296d47b16f2b677665c01adbd41d"></a><!-- doxytag: member="hawki_image.c::hawki_image_copy_to_intersection" ref="ga346a296d47b16f2b677665c01adbd41d" args="(cpl_image *target, const cpl_image *from, cpl_size target_shift_x, cpl_size target_shift_y)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga346a296d47b16f2b677665c01adbd41d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -78,11 +86,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Copies the values of an image to the intersection of two images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">target</td><td>The image where the values will be copied </td></tr>
     <tr><td class="paramname">from</td><td>The image from where the values are copied </td></tr>
@@ -97,9 +104,12 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__image__stats.html b/html/group__hawki__image__stats.html
index 64d62f7..9ea0059 100644
--- a/html/group__hawki__image__stats.html
+++ b/html/group__hawki__image__stats.html
@@ -2,57 +2,69 @@
 <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>HAWKI Pipeline Reference Manual: Compute several statistics on images</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Compute several statistics on images</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651">hawki_image_float_get_sigma_from_quartile</a> (cpl_image *image)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a robust estimation of the sigma based on the quartiles.  <a href="#gade5ca3e76e59c9ab510cb85bc02dd651"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836">hawki_image_stats_fill_from_frame</a> (cpl_table **image_stats, const cpl_frame *frame, int irow)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fills a table with the statistics of the four detectors of a frame.  <a href="#ga07a4f45b2ba4af9420f7d8600dbbe836"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f">hawki_image_stats_fill_from_image</a> (cpl_table **image_stats, const cpl_image *image, int llx, int lly, int urx, int ury, int idet, int irow)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fills a table with the statistics of an image.  <a href="#gaddd6e9623519487c0775de8c3a0aee0f"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6">hawki_image_stats_initialize</a> (cpl_table **raw_stats)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the table with all the statistics columns.  <a href="#ga788a4b7f6fba705eddcebd1f2fe26fd6"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928">hawki_image_stats_stats</a> (cpl_table **image_stats, cpl_propertylist **stats_stats)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Make the statistics (over image serie) of the each image statistics.  <a href="#gaaf82f2c0930f1c2bfcbc5cbef16b3928"></a><br/></td></tr>
+<tr class="memitem:gade5ca3e76e59c9ab510cb85bc02dd651"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651">hawki_image_float_get_sigma_from_quartile</a> (cpl_image *image)</td></tr>
+<tr class="memdesc:gade5ca3e76e59c9ab510cb85bc02dd651"><td class="mdescLeft"> </td><td class="mdescRight">Get a robust estimation of the sigma based on the quartiles.  <a href="#gade5ca3e76e59c9ab510cb85bc02dd651">More...</a><br/></td></tr>
+<tr class="separator:gade5ca3e76e59c9ab510cb85bc02dd651"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga07a4f45b2ba4af9420f7d8600dbbe836"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836">hawki_image_stats_fill_from_frame</a> (cpl_table **image_stats, const cpl_frame *frame, int irow)</td></tr>
+<tr class="memdesc:ga07a4f45b2ba4af9420f7d8600dbbe836"><td class="mdescLeft"> </td><td class="mdescRight">Fills a table with the statistics of the four detectors of a frame.  <a href="#ga07a4f45b2ba4af9420f7d8600dbbe836">More...</a><br/></td></tr>
+<tr class="separator:ga07a4f45b2ba4af9420f7d8600dbbe836"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaddd6e9623519487c0775de8c3a0aee0f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f">hawki_image_stats_fill_from_image</a> (cpl_table **image_stats, const cpl_image *image, int llx, int lly, int urx, int ury, int idet, int irow)</td></tr>
+<tr class="memdesc:gaddd6e9623519487c0775de8c3a0aee0f"><td class="mdescLeft"> </td><td class="mdescRight">Fills a table with the statistics of an image.  <a href="#gaddd6e9623519487c0775de8c3a0aee0f">More...</a><br/></td></tr>
+<tr class="separator:gaddd6e9623519487c0775de8c3a0aee0f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga788a4b7f6fba705eddcebd1f2fe26fd6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6">hawki_image_stats_initialize</a> (cpl_table **raw_stats)</td></tr>
+<tr class="memdesc:ga788a4b7f6fba705eddcebd1f2fe26fd6"><td class="mdescLeft"> </td><td class="mdescRight">Initialize the table with all the statistics columns.  <a href="#ga788a4b7f6fba705eddcebd1f2fe26fd6">More...</a><br/></td></tr>
+<tr class="separator:ga788a4b7f6fba705eddcebd1f2fe26fd6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaaf82f2c0930f1c2bfcbc5cbef16b3928"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928">hawki_image_stats_stats</a> (cpl_table **image_stats, cpl_propertylist **stats_stats)</td></tr>
+<tr class="memdesc:gaaf82f2c0930f1c2bfcbc5cbef16b3928"><td class="mdescLeft"> </td><td class="mdescRight">Make the statistics (over image serie) of the each image statistics.  <a href="#gaaf82f2c0930f1c2bfcbc5cbef16b3928">More...</a><br/></td></tr>
+<tr class="separator:gaaf82f2c0930f1c2bfcbc5cbef16b3928"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="gade5ca3e76e59c9ab510cb85bc02dd651"></a><!-- doxytag: member="hawki_image_stats.c::hawki_image_float_get_sigma_from_quartile" ref="gade5ca3e76e59c9ab510cb85bc02dd651" args="(cpl_image *image)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gade5ca3e76e59c9ab510cb85bc02dd651"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -64,23 +76,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get a robust estimation of the sigma based on the quartiles. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image</td><td>The image where to compute the statistic </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The sigma </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The sigma </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__image__stats_8c_source.html#l00582">582</a> of file <a class="el" href="hawki__image__stats_8c_source.html">hawki_image_stats.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga07a4f45b2ba4af9420f7d8600dbbe836"></a><!-- doxytag: member="hawki_image_stats.c::hawki_image_stats_fill_from_frame" ref="ga07a4f45b2ba4af9420f7d8600dbbe836" args="(cpl_table **image_stats, const cpl_frame *frame, int irow)" -->
+<a class="anchor" id="ga07a4f45b2ba4af9420f7d8600dbbe836"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -108,11 +119,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Fills a table with the statistics of the four detectors of a frame. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image_stats</td><td>Table to fill with the statistics </td></tr>
     <tr><td class="paramname">frame</td><td>The target frame </td></tr>
@@ -124,7 +134,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes the rectangle of the image given by llx, lly, urx, ury and computes the image statistics. This statistics are stored in the four tables image_stats, one for each detector, using the columns MINIMUM, MAXIMUM, MEDIAN, MEAN, RMS, USED. The USED column is set to 1. The table must have already these columns (call hawki_image_stats_initialize before) The statistics are stored in the row irow. </p>
 
 <p>Definition at line <a class="el" href="hawki__image__stats_8c_source.html#l00430">430</a> of file <a class="el" href="hawki__image__stats_8c_source.html">hawki_image_stats.c</a>.</p>
@@ -133,7 +143,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaddd6e9623519487c0775de8c3a0aee0f"></a><!-- doxytag: member="hawki_image_stats.c::hawki_image_stats_fill_from_image" ref="gaddd6e9623519487c0775de8c3a0aee0f" args="(cpl_table **image_stats, const cpl_image *image, int llx, int lly, int urx, int ury, int idet, int irow)" -->
+<a class="anchor" id="gaddd6e9623519487c0775de8c3a0aee0f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -191,11 +201,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Fills a table with the statistics of an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image_stats</td><td>Table to fill with the statistics </td></tr>
     <tr><td class="paramname">image</td><td>The target image </td></tr>
@@ -208,7 +217,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function takes the rectangle of the image given by llx, lly, urx, ury and computes the image statistics. This statistics are stored in the table image_stats, using the columns MINIMUM, MAXIMUM, MEDIAN, MEAN, RMS, USED. The USED column is set to 1. The table must have already these columns (call hawki_image_stats_initialize before) The table used to store the data is image_stats[idet], in the row irow. </p>
 
 <p>Definition at line <a class="el" href="hawki__image__stats_8c_source.html#l00137">137</a> of file <a class="el" href="hawki__image__stats_8c_source.html">hawki_image_stats.c</a>.</p>
@@ -217,7 +226,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga788a4b7f6fba705eddcebd1f2fe26fd6"></a><!-- doxytag: member="hawki_image_stats.c::hawki_image_stats_initialize" ref="ga788a4b7f6fba705eddcebd1f2fe26fd6" args="(cpl_table **raw_stats)" -->
+<a class="anchor" id="ga788a4b7f6fba705eddcebd1f2fe26fd6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -229,24 +238,23 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Initialize the table with all the statistics columns. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image_stats</td><td>Table to fill with the statistics </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function creates the following columns in the given table: MINIMUM, MAXIMUM, MEDIAN, MEAN, RMS, USED </p>
 
 <p>Definition at line <a class="el" href="hawki__image__stats_8c_source.html#l00070">70</a> of file <a class="el" href="hawki__image__stats_8c_source.html">hawki_image_stats.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaaf82f2c0930f1c2bfcbc5cbef16b3928"></a><!-- doxytag: member="hawki_image_stats.c::hawki_image_stats_stats" ref="gaaf82f2c0930f1c2bfcbc5cbef16b3928" args="(cpl_table **image_stats, cpl_propertylist **stats_stats)" -->
+<a class="anchor" id="gaaf82f2c0930f1c2bfcbc5cbef16b3928"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -268,26 +276,28 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Make the statistics (over image serie) of the each image statistics. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">stats_stats</td><td>Property list where to store the statistics </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function computes the mean, median, minimum, maximum and stdev of each of the columns found in the image_stats table. </p>
 
 <p>Definition at line <a class="el" href="hawki__image__stats_8c_source.html#l00512">512</a> of file <a class="el" href="hawki__image__stats_8c_source.html">hawki_image_stats.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__load.html b/html/group__hawki__load.html
index fed7a43..b38f650 100644
--- a/html/group__hawki__load.html
+++ b/html/group__hawki__load.html
@@ -2,83 +2,108 @@
 <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>HAWKI Pipeline Reference Manual: Loading related functions</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Loading related functions</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_frameset * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a">hawki_extract_frameset</a> (const cpl_frameset *in, const char *tag)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract the frames with the given tag from a frameset.  <a href="#ga080ffcf787c686caacf741989e6e796a"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756">hawki_get_detector_from_ext</a> (const char *fname, int ext)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the chip to store in the wished extension.  <a href="#gac57166de157def8422f2e7e2d12dd756"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9">hawki_get_ext_detector_mapping</a> (const char *fname)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the mapping between extensions and detectors.  <a href="#ga509bd22f6e838f82f7b2c6bc97ccc3a9"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1">hawki_get_ext_from_detector</a> (const char *fname, int chip)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the extension corresponding to the wished chip.  <a href="#gac0cd4814dd4a106963bb5e639132aac1"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895">hawki_load_detector</a> (const cpl_frameset *fset, int chip, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the chips of HAWKI frameset in an image list.  <a href="#gad4d9d26496599a54ebc31e2a43814895"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d">hawki_load_extensions</a> (const cpl_frameset *fset, int extension, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Loads a given extension from a HAWKI frameset in an image list.  <a href="#ga1cf51c1b905de7941d7fcf3e249e536d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751">hawki_load_frame</a> (const cpl_frame *frame, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load all the chips of HAWKI images from a frame into an image list.  <a href="#gaa83706a01275860daf2d743f315e1751"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1">hawki_load_frame_detector</a> (const cpl_frame *frame, int idet, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load one the chips of HAWKI images from a frame into an image.  <a href="#gada33a0608b91dc44f69f821e6f40b8d1"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef">hawki_load_frame_extension</a> (const cpl_frame *frame, int iextension, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load one the extensions of HAWKI images from a frame into an image.  <a href="#ga43ebac74ab2f9da7a452f23ec76803ef"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32">hawki_load_frameset</a> (const cpl_frameset *fset, int chip, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the chip of HAWKI images from a frameset in an image list.  <a href="#gacfb4bdd556642042208b93924ee13a32"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed">hawki_load_image</a> (const cpl_frameset *fset, int fnum, int chip, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the chip of HAWKI image from a frameset in an image.  <a href="#ga5b9129188e69306c15cec2d4568ddeed"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a">hawki_load_quadrant</a> (const cpl_frameset *fset, int fnum, int chip, int quad, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a frameset in an image.  <a href="#gaf2bd8a92a7abfe4adc8eb7b6b917739a"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7">hawki_load_quadrant_from_file</a> (const char *fname, int chip, int quad, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a file in an image.  <a href="#ga686f0c5897e92abd1b6aff98636f56c7"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438">hawki_load_quadrants</a> (const cpl_frameset *fset, int chip, int quad, cpl_type ptype)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a frameset in an image list.  <a href="#gad5cbc1d866e88c8776ed605e5afa9438"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_bivector ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1">hawki_load_refined_offsets</a> (const cpl_frame *offsets_frame)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a table containing refined offsets.  <a href="#gaf91b09d357b426f387123767e4a4fec1"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_table ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0">hawki_load_tables</a> (const cpl_frame *frame)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a table with four extensions, one for each chip.  <a href="#ga8ad708e19bdb35ac89abc2d9ba3932f0"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0">hawki_rebuild_detectors</a> (const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Rebuild the 4 chips.  <a href="#ga0ee685ab967af593a9fd9f5f90cc7dd0"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df">hawki_rebuild_quadrants</a> (const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Rebuild the 4 quadrants.  <a href="#ga2e96e882a8e61743837030dcc2db02df"></a><br/></td></tr>
+<tr class="memitem:ga080ffcf787c686caacf741989e6e796a"><td class="memItemLeft" align="right" valign="top">cpl_frameset * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a">hawki_extract_frameset</a> (const cpl_frameset *in, const char *tag)</td></tr>
+<tr class="memdesc:ga080ffcf787c686caacf741989e6e796a"><td class="mdescLeft"> </td><td class="mdescRight">Extract the frames with the given tag from a frameset.  <a href="#ga080ffcf787c686caacf741989e6e796a">More...</a><br/></td></tr>
+<tr class="separator:ga080ffcf787c686caacf741989e6e796a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac57166de157def8422f2e7e2d12dd756"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756">hawki_get_detector_from_ext</a> (const char *fname, int ext)</td></tr>
+<tr class="memdesc:gac57166de157def8422f2e7e2d12dd756"><td class="mdescLeft"> </td><td class="mdescRight">Get the chip to store in the wished extension.  <a href="#gac57166de157def8422f2e7e2d12dd756">More...</a><br/></td></tr>
+<tr class="separator:gac57166de157def8422f2e7e2d12dd756"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga509bd22f6e838f82f7b2c6bc97ccc3a9"><td class="memItemLeft" align="right" valign="top">int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9">hawki_get_ext_detector_mapping</a> (const char *fname)</td></tr>
+<tr class="memdesc:ga509bd22f6e838f82f7b2c6bc97ccc3a9"><td class="mdescLeft"> </td><td class="mdescRight">Get the mapping between extensions and detectors.  <a href="#ga509bd22f6e838f82f7b2c6bc97ccc3a9">More...</a><br/></td></tr>
+<tr class="separator:ga509bd22f6e838f82f7b2c6bc97ccc3a9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac0cd4814dd4a106963bb5e639132aac1"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1">hawki_get_ext_from_detector</a> (const char *fname, int chip)</td></tr>
+<tr class="memdesc:gac0cd4814dd4a106963bb5e639132aac1"><td class="mdescLeft"> </td><td class="mdescRight">Get the extension corresponding to the wished chip.  <a href="#gac0cd4814dd4a106963bb5e639132aac1">More...</a><br/></td></tr>
+<tr class="separator:gac0cd4814dd4a106963bb5e639132aac1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad4d9d26496599a54ebc31e2a43814895"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895">hawki_load_detector</a> (const cpl_frameset *fset, int chip, cpl_type ptype)</td></tr>
+<tr class="memdesc:gad4d9d26496599a54ebc31e2a43814895"><td class="mdescLeft"> </td><td class="mdescRight">Load the chips of HAWKI frameset in an image list.  <a href="#gad4d9d26496599a54ebc31e2a43814895">More...</a><br/></td></tr>
+<tr class="separator:gad4d9d26496599a54ebc31e2a43814895"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1cf51c1b905de7941d7fcf3e249e536d"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d">hawki_load_extensions</a> (const cpl_frameset *fset, int extension, cpl_type ptype)</td></tr>
+<tr class="memdesc:ga1cf51c1b905de7941d7fcf3e249e536d"><td class="mdescLeft"> </td><td class="mdescRight">Loads a given extension from a HAWKI frameset in an image list.  <a href="#ga1cf51c1b905de7941d7fcf3e249e536d">More...</a><br/></td></tr>
+<tr class="separator:ga1cf51c1b905de7941d7fcf3e249e536d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa83706a01275860daf2d743f315e1751"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751">hawki_load_frame</a> (const cpl_frame *frame, cpl_type ptype)</td></tr>
+<tr class="memdesc:gaa83706a01275860daf2d743f315e1751"><td class="mdescLeft"> </td><td class="mdescRight">Load all the chips of HAWKI images from a frame into an image list.  <a href="#gaa83706a01275860daf2d743f315e1751">More...</a><br/></td></tr>
+<tr class="separator:gaa83706a01275860daf2d743f315e1751"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gada33a0608b91dc44f69f821e6f40b8d1"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1">hawki_load_frame_detector</a> (const cpl_frame *frame, int idet, cpl_type ptype)</td></tr>
+<tr class="memdesc:gada33a0608b91dc44f69f821e6f40b8d1"><td class="mdescLeft"> </td><td class="mdescRight">Load one the chips of HAWKI images from a frame into an image.  <a href="#gada33a0608b91dc44f69f821e6f40b8d1">More...</a><br/></td></tr>
+<tr class="separator:gada33a0608b91dc44f69f821e6f40b8d1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga43ebac74ab2f9da7a452f23ec76803ef"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef">hawki_load_frame_extension</a> (const cpl_frame *frame, int iextension, cpl_type ptype)</td></tr>
+<tr class="memdesc:ga43ebac74ab2f9da7a452f23ec76803ef"><td class="mdescLeft"> </td><td class="mdescRight">Load one the extensions of HAWKI images from a frame into an image.  <a href="#ga43ebac74ab2f9da7a452f23ec76803ef">More...</a><br/></td></tr>
+<tr class="separator:ga43ebac74ab2f9da7a452f23ec76803ef"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacfb4bdd556642042208b93924ee13a32"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32">hawki_load_frameset</a> (const cpl_frameset *fset, int chip, cpl_type ptype)</td></tr>
+<tr class="memdesc:gacfb4bdd556642042208b93924ee13a32"><td class="mdescLeft"> </td><td class="mdescRight">Load the chip of HAWKI images from a frameset in an image list.  <a href="#gacfb4bdd556642042208b93924ee13a32">More...</a><br/></td></tr>
+<tr class="separator:gacfb4bdd556642042208b93924ee13a32"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5b9129188e69306c15cec2d4568ddeed"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed">hawki_load_image</a> (const cpl_frameset *fset, int fnum, int chip, cpl_type ptype)</td></tr>
+<tr class="memdesc:ga5b9129188e69306c15cec2d4568ddeed"><td class="mdescLeft"> </td><td class="mdescRight">Load the chip of HAWKI image from a frameset in an image.  <a href="#ga5b9129188e69306c15cec2d4568ddeed">More...</a><br/></td></tr>
+<tr class="separator:ga5b9129188e69306c15cec2d4568ddeed"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf2bd8a92a7abfe4adc8eb7b6b917739a"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a">hawki_load_quadrant</a> (const cpl_frameset *fset, int fnum, int chip, int quad, cpl_type ptype)</td></tr>
+<tr class="memdesc:gaf2bd8a92a7abfe4adc8eb7b6b917739a"><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a frameset in an image.  <a href="#gaf2bd8a92a7abfe4adc8eb7b6b917739a">More...</a><br/></td></tr>
+<tr class="separator:gaf2bd8a92a7abfe4adc8eb7b6b917739a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga686f0c5897e92abd1b6aff98636f56c7"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7">hawki_load_quadrant_from_file</a> (const char *fname, int chip, int quad, cpl_type ptype)</td></tr>
+<tr class="memdesc:ga686f0c5897e92abd1b6aff98636f56c7"><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a file in an image.  <a href="#ga686f0c5897e92abd1b6aff98636f56c7">More...</a><br/></td></tr>
+<tr class="separator:ga686f0c5897e92abd1b6aff98636f56c7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad5cbc1d866e88c8776ed605e5afa9438"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438">hawki_load_quadrants</a> (const cpl_frameset *fset, int chip, int quad, cpl_type ptype)</td></tr>
+<tr class="memdesc:gad5cbc1d866e88c8776ed605e5afa9438"><td class="mdescLeft"> </td><td class="mdescRight">Load the quarter of a chip from a frameset in an image list.  <a href="#gad5cbc1d866e88c8776ed605e5afa9438">More...</a><br/></td></tr>
+<tr class="separator:gad5cbc1d866e88c8776ed605e5afa9438"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf91b09d357b426f387123767e4a4fec1"><td class="memItemLeft" align="right" valign="top">cpl_bivector ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1">hawki_load_refined_offsets</a> (const cpl_frame *offsets_frame)</td></tr>
+<tr class="memdesc:gaf91b09d357b426f387123767e4a4fec1"><td class="mdescLeft"> </td><td class="mdescRight">Load a table containing refined offsets.  <a href="#gaf91b09d357b426f387123767e4a4fec1">More...</a><br/></td></tr>
+<tr class="separator:gaf91b09d357b426f387123767e4a4fec1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8ad708e19bdb35ac89abc2d9ba3932f0"><td class="memItemLeft" align="right" valign="top">cpl_table ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0">hawki_load_tables</a> (const cpl_frame *frame)</td></tr>
+<tr class="memdesc:ga8ad708e19bdb35ac89abc2d9ba3932f0"><td class="mdescLeft"> </td><td class="mdescRight">Load a table with four extensions, one for each chip.  <a href="#ga8ad708e19bdb35ac89abc2d9ba3932f0">More...</a><br/></td></tr>
+<tr class="separator:ga8ad708e19bdb35ac89abc2d9ba3932f0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0ee685ab967af593a9fd9f5f90cc7dd0"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0">hawki_rebuild_detectors</a> (const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)</td></tr>
+<tr class="memdesc:ga0ee685ab967af593a9fd9f5f90cc7dd0"><td class="mdescLeft"> </td><td class="mdescRight">Rebuild the 4 chips.  <a href="#ga0ee685ab967af593a9fd9f5f90cc7dd0">More...</a><br/></td></tr>
+<tr class="separator:ga0ee685ab967af593a9fd9f5f90cc7dd0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2e96e882a8e61743837030dcc2db02df"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df">hawki_rebuild_quadrants</a> (const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)</td></tr>
+<tr class="memdesc:ga2e96e882a8e61743837030dcc2db02df"><td class="mdescLeft"> </td><td class="mdescRight">Rebuild the 4 quadrants.  <a href="#ga2e96e882a8e61743837030dcc2db02df">More...</a><br/></td></tr>
+<tr class="separator:ga2e96e882a8e61743837030dcc2db02df"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga080ffcf787c686caacf741989e6e796a"></a><!-- doxytag: member="hawki_load.c::hawki_extract_frameset" ref="ga080ffcf787c686caacf741989e6e796a" args="(const cpl_frameset *in, const char *tag)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga080ffcf787c686caacf741989e6e796a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -100,25 +125,24 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Extract the frames with the given tag from a frameset. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>A non-empty frameset </td></tr>
     <tr><td class="paramname">tag</td><td>The tag of the requested frames </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The newly created frameset or NULL on error</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The newly created frameset or NULL on error</dd></dl>
 <p>The returned frameset must be de allocated with cpl_frameset_delete() </p>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00063">63</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gac57166de157def8422f2e7e2d12dd756"></a><!-- doxytag: member="hawki_load.c::hawki_get_detector_from_ext" ref="gac57166de157def8422f2e7e2d12dd756" args="(const char *fname, int ext)" -->
+<a class="anchor" id="gac57166de157def8422f2e7e2d12dd756"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -140,28 +164,27 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the chip to store in the wished extension. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fname</td><td>The input frame name </td></tr>
     <tr><td class="paramname">ext</td><td>the extension number (1 to HAWKI_NB_DETECTORS) </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The chip number (1 to HAWKI_NB_DETECTORS) or -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The chip number (1 to HAWKI_NB_DETECTORS) or -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00817">817</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
-<p>References <a class="el" href="hawki__pfits_8c_source.html#l00203">hawki_pfits_get_extname()</a>.</p>
+<p>References <a class="el" href="hawki__pfits_8c_source.html#l00235">hawki_pfits_get_extname()</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__save_8c_source.html#l00514">hawki_distortion_save()</a>, <a class="el" href="hawki__load_8c_source.html#l00897">hawki_get_ext_detector_mapping()</a>, <a class="el" href="hawki__save_8c_source.html#l00227">hawki_image_ext_save()</a>, <a class="el" href="hawki__save_8c_source.html#l00072">hawki_imagelist_save()</a>, <a class="el" href="hawki__save_8c_source.html#l00302">hawki_images_save()</a>, and <a class="el" href="hawki__save_8c_source.html#l [...]
 
 </div>
 </div>
-<a class="anchor" id="ga509bd22f6e838f82f7b2c6bc97ccc3a9"></a><!-- doxytag: member="hawki_load.c::hawki_get_ext_detector_mapping" ref="ga509bd22f6e838f82f7b2c6bc97ccc3a9" args="(const char *fname)" -->
+<a class="anchor" id="ga509bd22f6e838f82f7b2c6bc97ccc3a9"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -173,17 +196,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the mapping between extensions and detectors. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fname</td><td>The input frame name </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the mapping if everything goes well, NULL otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the mapping if everything goes well, NULL otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00897">897</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -193,7 +215,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gac0cd4814dd4a106963bb5e639132aac1"></a><!-- doxytag: member="hawki_load.c::hawki_get_ext_from_detector" ref="gac0cd4814dd4a106963bb5e639132aac1" args="(const char *fname, int chip)" -->
+<a class="anchor" id="gac0cd4814dd4a106963bb5e639132aac1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -215,28 +237,27 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the extension corresponding to the wished chip. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fname</td><td>The input frame name </td></tr>
     <tr><td class="paramname">chip</td><td>The chip number (1 to HAWKI_NB_DETECTORS) </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the extension number (1 to HAWKI_NB_DETECTORS) </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the extension number (1 to HAWKI_NB_DETECTORS) </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00846">846</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
-<p>References <a class="el" href="hawki__pfits_8c_source.html#l00203">hawki_pfits_get_extname()</a>.</p>
+<p>References <a class="el" href="hawki__pfits_8c_source.html#l00235">hawki_pfits_get_extname()</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__calib_8c_source.html#l00450">hawki_bpm_calib()</a>, <a class="el" href="hawki__utils_8c_source.html#l00837">hawki_detectors_locate_star()</a>, <a class="el" href="hawki__distortion_8c_source.html#l00182">hawki_distortion_load()</a>, <a class="el" href="hawki__load_8c_source.html#l00209">hawki_load_detector()</a>, <a class="el" href="hawki__load_8c_source.html#l00547">hawki_load_frame_detector()</a>, <a class="el" href="hawki__load_8c_source.htm [...]
 
 </div>
 </div>
-<a class="anchor" id="gad4d9d26496599a54ebc31e2a43814895"></a><!-- doxytag: member="hawki_load.c::hawki_load_detector" ref="gad4d9d26496599a54ebc31e2a43814895" args="(const cpl_frameset *fset, int chip, cpl_type ptype)" -->
+<a class="anchor" id="gad4d9d26496599a54ebc31e2a43814895"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -264,11 +285,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the chips of HAWKI frameset in an image list. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">chip</td><td>the chip to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -276,7 +296,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00209">209</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -284,7 +304,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga1cf51c1b905de7941d7fcf3e249e536d"></a><!-- doxytag: member="hawki_load.c::hawki_load_extensions" ref="ga1cf51c1b905de7941d7fcf3e249e536d" args="(const cpl_frameset *fset, int extension, cpl_type ptype)" -->
+<a class="anchor" id="ga1cf51c1b905de7941d7fcf3e249e536d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -312,11 +332,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Loads a given extension from a HAWKI frameset in an image list. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">ext</td><td>the chip to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -324,13 +343,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00266">266</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaa83706a01275860daf2d743f315e1751"></a><!-- doxytag: member="hawki_load.c::hawki_load_frame" ref="gaa83706a01275860daf2d743f315e1751" args="(const cpl_frame *frame, cpl_type ptype)" -->
+<a class="anchor" id="gaa83706a01275860daf2d743f315e1751"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -352,18 +371,17 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load all the chips of HAWKI images from a frame into an image list. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frame</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">ptype</td><td>the pixel type </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00445">445</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -373,7 +391,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gada33a0608b91dc44f69f821e6f40b8d1"></a><!-- doxytag: member="hawki_load.c::hawki_load_frame_detector" ref="gada33a0608b91dc44f69f821e6f40b8d1" args="(const cpl_frame *frame, int idet, cpl_type ptype)" -->
+<a class="anchor" id="gada33a0608b91dc44f69f821e6f40b8d1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -401,11 +419,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load one the chips of HAWKI images from a frame into an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frame</td><td>the input frame </td></tr>
     <tr><td class="paramname">idet</td><td>the detector to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -413,7 +430,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00547">547</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -423,7 +440,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga43ebac74ab2f9da7a452f23ec76803ef"></a><!-- doxytag: member="hawki_load.c::hawki_load_frame_extension" ref="ga43ebac74ab2f9da7a452f23ec76803ef" args="(const cpl_frame *frame, int iextension, cpl_type ptype)" -->
+<a class="anchor" id="ga43ebac74ab2f9da7a452f23ec76803ef"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -451,11 +468,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load one the extensions of HAWKI images from a frame into an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frame</td><td>the input frame </td></tr>
     <tr><td class="paramname">extension</td><td>the extension to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -463,13 +479,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00513">513</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gacfb4bdd556642042208b93924ee13a32"></a><!-- doxytag: member="hawki_load.c::hawki_load_frameset" ref="gacfb4bdd556642042208b93924ee13a32" args="(const cpl_frameset *fset, int chip, cpl_type ptype)" -->
+<a class="anchor" id="gacfb4bdd556642042208b93924ee13a32"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -497,11 +513,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the chip of HAWKI images from a frameset in an image list. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">chip</td><td>the chip to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -509,7 +524,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00407">407</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -517,7 +532,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga5b9129188e69306c15cec2d4568ddeed"></a><!-- doxytag: member="hawki_load.c::hawki_load_image" ref="ga5b9129188e69306c15cec2d4568ddeed" args="(const cpl_frameset *fset, int fnum, int chip, cpl_type ptype)" -->
+<a class="anchor" id="ga5b9129188e69306c15cec2d4568ddeed"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -551,11 +566,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the chip of HAWKI image from a frameset in an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">fnum</td><td>the frame to load from (start from 0) </td></tr>
@@ -564,7 +578,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00313">313</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -574,7 +588,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaf2bd8a92a7abfe4adc8eb7b6b917739a"></a><!-- doxytag: member="hawki_load.c::hawki_load_quadrant" ref="gaf2bd8a92a7abfe4adc8eb7b6b917739a" args="(const cpl_frameset *fset, int fnum, int chip, int quad, cpl_type ptype)" -->
+<a class="anchor" id="gaf2bd8a92a7abfe4adc8eb7b6b917739a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -614,11 +628,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the quarter of a chip from a frameset in an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">fnum</td><td>the frame to load from (start from 0) </td></tr>
@@ -628,7 +641,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00110">110</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -638,7 +651,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga686f0c5897e92abd1b6aff98636f56c7"></a><!-- doxytag: member="hawki_load.c::hawki_load_quadrant_from_file" ref="ga686f0c5897e92abd1b6aff98636f56c7" args="(const char *fname, int chip, int quad, cpl_type ptype)" -->
+<a class="anchor" id="ga686f0c5897e92abd1b6aff98636f56c7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -672,11 +685,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the quarter of a chip from a file in an image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fname</td><td>the input file name </td></tr>
     <tr><td class="paramname">chip</td><td>the chip to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -685,7 +697,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00149">149</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -695,7 +707,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gad5cbc1d866e88c8776ed605e5afa9438"></a><!-- doxytag: member="hawki_load.c::hawki_load_quadrants" ref="gad5cbc1d866e88c8776ed605e5afa9438" args="(const cpl_frameset *fset, int chip, int quad, cpl_type ptype)" -->
+<a class="anchor" id="gad5cbc1d866e88c8776ed605e5afa9438"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -729,11 +741,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load the quarter of a chip from a frameset in an image list. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">chip</td><td>the chip to load (1 to HAWKI_NB_DETECTORS) </td></tr>
@@ -742,7 +753,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00365">365</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -750,7 +761,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaf91b09d357b426f387123767e4a4fec1"></a><!-- doxytag: member="hawki_load.c::hawki_load_refined_offsets" ref="gaf91b09d357b426f387123767e4a4fec1" args="(const cpl_frame *offsets_frame)" -->
+<a class="anchor" id="gaf91b09d357b426f387123767e4a4fec1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -762,17 +773,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load a table containing refined offsets. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">offsets_frame</td><td>the frame containing the offests. </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the offsets bivector. It must be deallocated afterwards. NULL if in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the offsets bivector. It must be deallocated afterwards. NULL if in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00633">633</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -780,7 +790,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga8ad708e19bdb35ac89abc2d9ba3932f0"></a><!-- doxytag: member="hawki_load.c::hawki_load_tables" ref="ga8ad708e19bdb35ac89abc2d9ba3932f0" args="(const cpl_frame *frame)" -->
+<a class="anchor" id="ga8ad708e19bdb35ac89abc2d9ba3932f0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -792,18 +802,17 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Load a table with four extensions, one for each chip. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frame</td><td>the input set of frames </td></tr>
     <tr><td class="paramname">ptype</td><td>the pixel type </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image list (image chip 1 to chip HAWKI_NB_DETECTORS) or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00589">589</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
@@ -813,7 +822,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga0ee685ab967af593a9fd9f5f90cc7dd0"></a><!-- doxytag: member="hawki_load.c::hawki_rebuild_detectors" ref="ga0ee685ab967af593a9fd9f5f90cc7dd0" args="(const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)" -->
+<a class="anchor" id="ga0ee685ab967af593a9fd9f5f90cc7dd0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -847,11 +856,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Rebuild the 4 chips. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ima1</td><td>the first chip </td></tr>
     <tr><td class="paramname">ima2</td><td>the second chip </td></tr>
@@ -860,13 +868,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00718">718</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga2e96e882a8e61743837030dcc2db02df"></a><!-- doxytag: member="hawki_load.c::hawki_rebuild_quadrants" ref="ga2e96e882a8e61743837030dcc2db02df" args="(const cpl_image *ima1, const cpl_image *ima2, const cpl_image *ima3, const cpl_image *ima4)" -->
+<a class="anchor" id="ga2e96e882a8e61743837030dcc2db02df"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -900,11 +908,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Rebuild the 4 quadrants. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ima1</td><td>the first quadrant </td></tr>
     <tr><td class="paramname">ima2</td><td>the second quadrant </td></tr>
@@ -913,15 +920,18 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the image or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the image or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__load_8c_source.html#l00769">769</a> of file <a class="el" href="hawki__load_8c_source.html">hawki_load.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__mask.html b/html/group__hawki__mask.html
index beda427..e4fcb2d 100644
--- a/html/group__hawki__mask.html
+++ b/html/group__hawki__mask.html
@@ -2,48 +2,56 @@
 <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>HAWKI Pipeline Reference Manual: Mask manipulation</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Mask manipulation</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a> (cpl_mask *in, const cpl_matrix *ker)</td></tr>
+<tr class="memitem:ga6154878d3444c3d4204a2a6132719e69"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a> (cpl_mask *in, const cpl_matrix *ker)</td></tr>
+<tr class="separator:ga6154878d3444c3d4204a2a6132719e69"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga6154878d3444c3d4204a2a6132719e69"></a><!-- doxytag: member="hawki_mask.c::hawki_mask_convolve" ref="ga6154878d3444c3d4204a2a6132719e69" args="(cpl_mask *in, const cpl_matrix *ker)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga6154878d3444c3d4204a2a6132719e69"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -65,17 +73,19 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 <p>FIXME: documentation </p>
 
 <p>Definition at line <a class="el" href="hawki__mask_8c_source.html#l00056">56</a> of file <a class="el" href="hawki__mask_8c_source.html">hawki_mask.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__obj__det.html b/html/group__hawki__obj__det.html
index 4bc2868..6ba1ba0 100644
--- a/html/group__hawki__obj__det.html
+++ b/html/group__hawki__obj__det.html
@@ -2,51 +2,60 @@
 <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>HAWKI Pipeline Reference Manual: Functionality related to catalogue matching</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Functionality related to catalogue matching</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593">hawki_match_condition_5_pix</a> (cpl_table *catalogue1, cpl_table *catalogue2, int iobj1, int iobj2)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare two objects positions and determine whetherthey are within a 5 pix tolerance.  <a href="#ga7255ba5ecf2bd6539c02c1f7d765e593"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb">hawki_obj_prop_stats</a> (cpl_table **objs_prop, cpl_propertylist **objs_prop_stats)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute statistics on the object properties.  <a href="#ga0968e63931fcc72c55c4bc0e34f71dbb"></a><br/></td></tr>
+<tr class="memitem:ga7255ba5ecf2bd6539c02c1f7d765e593"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593">hawki_match_condition_5_pix</a> (cpl_table *catalogue1, cpl_table *catalogue2, int iobj1, int iobj2)</td></tr>
+<tr class="memdesc:ga7255ba5ecf2bd6539c02c1f7d765e593"><td class="mdescLeft"> </td><td class="mdescRight">Compare two objects positions and determine whetherthey are within a 5 pix tolerance.  <a href="#ga7255ba5ecf2bd6539c02c1f7d765e593">More...</a><br/></td></tr>
+<tr class="separator:ga7255ba5ecf2bd6539c02c1f7d765e593"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0968e63931fcc72c55c4bc0e34f71dbb"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb">hawki_obj_prop_stats</a> (cpl_table **objs_prop, cpl_propertylist **objs_prop_stats)</td></tr>
+<tr class="memdesc:ga0968e63931fcc72c55c4bc0e34f71dbb"><td class="mdescLeft"> </td><td class="mdescRight">Compute statistics on the object properties.  <a href="#ga0968e63931fcc72c55c4bc0e34f71dbb">More...</a><br/></td></tr>
+<tr class="separator:ga0968e63931fcc72c55c4bc0e34f71dbb"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga7255ba5ecf2bd6539c02c1f7d765e593"></a><!-- doxytag: member="hawki_match_cats.c::hawki_match_condition_5_pix" ref="ga7255ba5ecf2bd6539c02c1f7d765e593" args="(cpl_table *catalogue1, cpl_table *catalogue2, int iobj1, int iobj2)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga7255ba5ecf2bd6539c02c1f7d765e593"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -80,11 +89,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compare two objects positions and determine whetherthey are within a 5 pix tolerance. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">catalogue1</td><td>The table with catalogue1 </td></tr>
     <tr><td class="paramname">catalogue2</td><td>The table with catalogue2 </td></tr>
@@ -93,7 +101,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>1 if they match, 0 if they do not.</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 if they match, 0 if they do not.</dd></dl>
 <p>Both tables have to have the columns POS_X and POS_Y, which give the position in the detector in pixels. The distance between both objects is the euclidean distance in pixels. The object indexes start from 0.</p>
 <p>WARNING: Since this function will be called many times, there is no error checking. The caller has to ensure that the catalogues are well constructed and that the indexes are not out of bounds. </p>
 
@@ -101,7 +109,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga0968e63931fcc72c55c4bc0e34f71dbb"></a><!-- doxytag: member="hawki_obj_det.c::hawki_obj_prop_stats" ref="ga0968e63931fcc72c55c4bc0e34f71dbb" args="(cpl_table **objs_prop, cpl_propertylist **objs_prop_stats)" -->
+<a class="anchor" id="ga0968e63931fcc72c55c4bc0e34f71dbb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -123,27 +131,29 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute statistics on the object properties. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">objs_prop</td><td>the table with the properties of the objects (IN) </td></tr>
     <tr><td class="paramname">objs_prop_stats</td><td>the property lists containing statistics on the previous table (OUT) </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case</dd></dl>
 <p>The statistics computed are the mean, median, minimum, maximum and stdev. Currently, the statistics ar ecomputed upon the angle of the object and the ellipticity. </p>
 
 <p>Definition at line <a class="el" href="hawki__obj__det_8c_source.html#l00068">68</a> of file <a class="el" href="hawki__obj__det_8c_source.html">hawki_obj_det.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__pfits.html b/html/group__hawki__pfits.html
index 0f779c3..fb277f4 100644
--- a/html/group__hawki__pfits.html
+++ b/html/group__hawki__pfits.html
@@ -2,153 +2,219 @@
 <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>HAWKI Pipeline Reference Manual: FITS header protected access</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">FITS header protected access</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3">hawki_pfits_get_airmass_end</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out airmass end  <a href="#gafccabad8d0fcc65a0ed27d1dff7ae8e3"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df">hawki_pfits_get_airmass_start</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out airmass start  <a href="#ga4e7f03745ede13d9d2db3eddccd857df"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121">hawki_pfits_get_ao_fwhm</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the fwhm from the AO system  <a href="#gac9b88815381f3f61c10dc88730d77121"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056">hawki_pfits_get_arcfile</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the arcfile  <a href="#gae4f45ff97625d37b9354392b0c5e1056"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58">hawki_pfits_get_azimut</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the telescope azimut  <a href="#gaf18030b75b198e924f296cdd13356b58"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78">hawki_pfits_get_cdelta1</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the increment of coordinate in one pixel (axe 1)  <a href="#ga39d06faa1dcc2d3601e07e79064f9e78"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c">hawki_pfits_get_cdelta2</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the increment of coordinate in one pixel (axe 2)  <a href="#gaeea4d2dba260fc663a4aa5d5a616086c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c">hawki_pfits_get_comb_cumoffsetx</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative X offset of the combined image  <a href="#ga24483514187ce9bcf0860cc654b8508c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a">hawki_pfits_get_comb_cumoffsety</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative Y offset of the combined image  <a href="#gadc1b3f141f5474486b5b32502634b29a"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1">hawki_pfits_get_comb_posx</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the relative X offset of the combined image wrt first image  <a href="#ga88f1a9b44888686b6489fba06921f5a1"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e">hawki_pfits_get_comb_posy</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the relative Y offset of the combined image wrt first image  <a href="#ga5408b902329bdad15fd408d73fa6376e"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80">hawki_pfits_get_crpix1</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the reference pixel in axe 1  <a href="#gaaeee5723004e441f48fb8cc804370f80"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10">hawki_pfits_get_crpix2</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the reference pixel in axe 1  <a href="#gaab4e70f9071230674a49cb8df1975f10"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea">hawki_pfits_get_crval1</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the value in WCS coordinates of the reference pixel (axe 1)  <a href="#ga98f777c6f085878ba095b1ccd40ef6ea"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692">hawki_pfits_get_crval2</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the value in WCS coordinates of the reference pixel (axe 2)  <a href="#ga7fbf6de80172c991e4a9d7f427741692"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53">hawki_pfits_get_cumoffseta</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in alpha  <a href="#ga62ff6ef5b06d163b64e8eff779e5fb53"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d">hawki_pfits_get_cumoffsetd</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in delta  <a href="#ga0f4a0efe2116535b882eddeeb272042d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e">hawki_pfits_get_cumoffsetx</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in X  <a href="#ga8074b7ef4524abfeb10bef68c4cfdf5e"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca">hawki_pfits_get_cumoffsety</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in Y  <a href="#ga21f640e98b8f695ac6229e9f15d46aca"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0">hawki_pfits_get_date_obs</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the date of observation  <a href="#ga87aca0d821694845e43e06dca5ace1a0"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4">hawki_pfits_get_dec</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the DEC  <a href="#gaca47ff94f05c2bb322ea83ce4cf9b4d4"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f">hawki_pfits_get_dit</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the DIT value  <a href="#ga1971ab60e27df384b5fd533461e7356f"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246">hawki_pfits_get_elevation</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the telescope altitude  <a href="#ga965d40d225307d5a40d697a0a532f246"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea">hawki_pfits_get_extname</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the extname  <a href="#ga5161743d5b650a637d543959b5bd54ea"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501">hawki_pfits_get_filter</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out which wave band is active  <a href="#ga3ad06f5c4dea6ec8adcc437e7f9f5501"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4">hawki_pfits_get_focus</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the focus position of M2  <a href="#ga1cd57f592c68d5e084ee049bdbe979a4"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a">hawki_pfits_get_humidity_level</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the humidity level  <a href="#ga643c35f35f7f49a3e1c6bafd022e364a"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102">hawki_pfits_get_naxis1</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of pixels in axis 1.  <a href="#ga509576593bbfc282745eae7d29a89102"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356">hawki_pfits_get_naxis2</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the number of pixels in axis 2.  <a href="#gaabcefe7bbad8cb43ad652970057d0356"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788">hawki_pfits_get_ndit</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the NDIT value  <a href="#ga7c2b338fdf41bdeb1149b60af82c0788"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190">hawki_pfits_get_ndsamples</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the NDSAMPLES value  <a href="#ga0d1ccf97334b28566b2bc8fe17786190"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2">hawki_pfits_get_nexp</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the NEXP value  <a href="#gae157c2c48d5b4e41ffafef1348c939d2"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21">hawki_pfits_get_obs_seeing_end</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory seeing at end  <a href="#gaa400a879086340c841865fc6c2a1cc21"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259">hawki_pfits_get_obs_seeing_start</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory seeing at start  <a href="#gae005518fe79a76ee9b1cea2c3403a259"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b">hawki_pfits_get_obs_temp</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the ambient temperatur  <a href="#gae4c54267b67c5efdcf93afb99ecaeb3b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b">hawki_pfits_get_parangle_end</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the paralactic angle at start  <a href="#ga3465a5cbb9e21e8cbd7680affc75355b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274">hawki_pfits_get_parangle_start</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the paralactic angle at start  <a href="#ga2dc1b31621ecbeec49d3e390ad601274"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b">hawki_pfits_get_pixscale</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the pixel scale  <a href="#ga79c432e5ab5585c45472cfa86b2d146b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951">hawki_pfits_get_posangle</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the position angle  <a href="#ga88a2db02738f3881bad0e2bde2768951"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813">hawki_pfits_get_pressure_end</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory atmospheric pressure at end  <a href="#ga11eecff7f4c8031ff6ea929e15c20813"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4">hawki_pfits_get_pressure_start</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory atmospheric pressure at start  <a href="#ga87d6ba1cd310181f2eab02fc4688bad4"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d">hawki_pfits_get_procatg</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the PRO.CATG  <a href="#gad9c95c0d3bc75d347bf9acbcb8fe549d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d">hawki_pfits_get_ra</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the RA  <a href="#ga6f490d48a329331dc3b1bc48c1e9ed1d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b">hawki_pfits_get_relhum</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the relative humidity  <a href="#gafc9299ed697db3ecfd1bb4c7e548cf3b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2">hawki_pfits_get_rotator_end</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the absolute rotator position at end  <a href="#gac8b9879cdc3c2e82f3b169eef3355ef2"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2">hawki_pfits_get_rotator_start</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the absolute rotator position at start  <a href="#gaa91a5e47c4661209f97f4399cbceb9d2"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc">hawki_pfits_get_targ_alpha</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the target RA  <a href="#ga36892dc77006059ba553e9a98c9b55fc"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c">hawki_pfits_get_targ_delta</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the target DEC  <a href="#ga0330c53376304376257417ea4edbee5c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168">hawki_pfits_get_targ_epoch</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the target epoch  <a href="#ga07110c618d0772882174838d8ce9a168"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad">hawki_pfits_get_targ_equinox</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the target equinox  <a href="#ga662be8ce410cbfa244f51ec8e5f0baad"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b">hawki_pfits_get_tau0</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the average coherence time  <a href="#gaab1203aaa32935d1e81db6bb0aeec96b"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125">hawki_pfits_get_wind_dir</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the wind direction  <a href="#ga7bd674c51f4cd62ce34c208888cea125"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708">hawki_pfits_get_wind_speed</a> (const cpl_propertylist *plist)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">find out the wind speed  <a href="#ga45e0b30ba22df26f4d061dee26735708"></a><br/></td></tr>
+<tr class="memitem:gafccabad8d0fcc65a0ed27d1dff7ae8e3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3">hawki_pfits_get_airmass_end</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gafccabad8d0fcc65a0ed27d1dff7ae8e3"><td class="mdescLeft"> </td><td class="mdescRight">find out airmass end  <a href="#gafccabad8d0fcc65a0ed27d1dff7ae8e3">More...</a><br/></td></tr>
+<tr class="separator:gafccabad8d0fcc65a0ed27d1dff7ae8e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4e7f03745ede13d9d2db3eddccd857df"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df">hawki_pfits_get_airmass_start</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga4e7f03745ede13d9d2db3eddccd857df"><td class="mdescLeft"> </td><td class="mdescRight">find out airmass start  <a href="#ga4e7f03745ede13d9d2db3eddccd857df">More...</a><br/></td></tr>
+<tr class="separator:ga4e7f03745ede13d9d2db3eddccd857df"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac9b88815381f3f61c10dc88730d77121"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121">hawki_pfits_get_ao_fwhm</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gac9b88815381f3f61c10dc88730d77121"><td class="mdescLeft"> </td><td class="mdescRight">find out the fwhm from the AO system  <a href="#gac9b88815381f3f61c10dc88730d77121">More...</a><br/></td></tr>
+<tr class="separator:gac9b88815381f3f61c10dc88730d77121"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae4f45ff97625d37b9354392b0c5e1056"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056">hawki_pfits_get_arcfile</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gae4f45ff97625d37b9354392b0c5e1056"><td class="mdescLeft"> </td><td class="mdescRight">find out the arcfile  <a href="#gae4f45ff97625d37b9354392b0c5e1056">More...</a><br/></td></tr>
+<tr class="separator:gae4f45ff97625d37b9354392b0c5e1056"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf18030b75b198e924f296cdd13356b58"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58">hawki_pfits_get_azimut</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaf18030b75b198e924f296cdd13356b58"><td class="mdescLeft"> </td><td class="mdescRight">find out the telescope azimut  <a href="#gaf18030b75b198e924f296cdd13356b58">More...</a><br/></td></tr>
+<tr class="separator:gaf18030b75b198e924f296cdd13356b58"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga39d06faa1dcc2d3601e07e79064f9e78"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78">hawki_pfits_get_cdelta1</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga39d06faa1dcc2d3601e07e79064f9e78"><td class="mdescLeft"> </td><td class="mdescRight">find out the increment of coordinate in one pixel (axe 1)  <a href="#ga39d06faa1dcc2d3601e07e79064f9e78">More...</a><br/></td></tr>
+<tr class="separator:ga39d06faa1dcc2d3601e07e79064f9e78"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaeea4d2dba260fc663a4aa5d5a616086c"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c">hawki_pfits_get_cdelta2</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaeea4d2dba260fc663a4aa5d5a616086c"><td class="mdescLeft"> </td><td class="mdescRight">find out the increment of coordinate in one pixel (axe 2)  <a href="#gaeea4d2dba260fc663a4aa5d5a616086c">More...</a><br/></td></tr>
+<tr class="separator:gaeea4d2dba260fc663a4aa5d5a616086c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga24483514187ce9bcf0860cc654b8508c"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c">hawki_pfits_get_comb_cumoffsetx</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga24483514187ce9bcf0860cc654b8508c"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative X offset of the combined image  <a href="#ga24483514187ce9bcf0860cc654b8508c">More...</a><br/></td></tr>
+<tr class="separator:ga24483514187ce9bcf0860cc654b8508c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadc1b3f141f5474486b5b32502634b29a"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a">hawki_pfits_get_comb_cumoffsety</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gadc1b3f141f5474486b5b32502634b29a"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative Y offset of the combined image  <a href="#gadc1b3f141f5474486b5b32502634b29a">More...</a><br/></td></tr>
+<tr class="separator:gadc1b3f141f5474486b5b32502634b29a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88f1a9b44888686b6489fba06921f5a1"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1">hawki_pfits_get_comb_posx</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga88f1a9b44888686b6489fba06921f5a1"><td class="mdescLeft"> </td><td class="mdescRight">find out the relative X offset of the combined image wrt first image  <a href="#ga88f1a9b44888686b6489fba06921f5a1">More...</a><br/></td></tr>
+<tr class="separator:ga88f1a9b44888686b6489fba06921f5a1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5408b902329bdad15fd408d73fa6376e"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e">hawki_pfits_get_comb_posy</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga5408b902329bdad15fd408d73fa6376e"><td class="mdescLeft"> </td><td class="mdescRight">find out the relative Y offset of the combined image wrt first image  <a href="#ga5408b902329bdad15fd408d73fa6376e">More...</a><br/></td></tr>
+<tr class="separator:ga5408b902329bdad15fd408d73fa6376e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaaeee5723004e441f48fb8cc804370f80"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80">hawki_pfits_get_crpix1</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaaeee5723004e441f48fb8cc804370f80"><td class="mdescLeft"> </td><td class="mdescRight">find out the reference pixel in axe 1  <a href="#gaaeee5723004e441f48fb8cc804370f80">More...</a><br/></td></tr>
+<tr class="separator:gaaeee5723004e441f48fb8cc804370f80"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaab4e70f9071230674a49cb8df1975f10"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10">hawki_pfits_get_crpix2</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaab4e70f9071230674a49cb8df1975f10"><td class="mdescLeft"> </td><td class="mdescRight">find out the reference pixel in axe 1  <a href="#gaab4e70f9071230674a49cb8df1975f10">More...</a><br/></td></tr>
+<tr class="separator:gaab4e70f9071230674a49cb8df1975f10"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga98f777c6f085878ba095b1ccd40ef6ea"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea">hawki_pfits_get_crval1</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga98f777c6f085878ba095b1ccd40ef6ea"><td class="mdescLeft"> </td><td class="mdescRight">find out the value in WCS coordinates of the reference pixel (axe 1)  <a href="#ga98f777c6f085878ba095b1ccd40ef6ea">More...</a><br/></td></tr>
+<tr class="separator:ga98f777c6f085878ba095b1ccd40ef6ea"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7fbf6de80172c991e4a9d7f427741692"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692">hawki_pfits_get_crval2</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga7fbf6de80172c991e4a9d7f427741692"><td class="mdescLeft"> </td><td class="mdescRight">find out the value in WCS coordinates of the reference pixel (axe 2)  <a href="#ga7fbf6de80172c991e4a9d7f427741692">More...</a><br/></td></tr>
+<tr class="separator:ga7fbf6de80172c991e4a9d7f427741692"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga62ff6ef5b06d163b64e8eff779e5fb53"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53">hawki_pfits_get_cumoffseta</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga62ff6ef5b06d163b64e8eff779e5fb53"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in alpha  <a href="#ga62ff6ef5b06d163b64e8eff779e5fb53">More...</a><br/></td></tr>
+<tr class="separator:ga62ff6ef5b06d163b64e8eff779e5fb53"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0f4a0efe2116535b882eddeeb272042d"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d">hawki_pfits_get_cumoffsetd</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga0f4a0efe2116535b882eddeeb272042d"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in delta  <a href="#ga0f4a0efe2116535b882eddeeb272042d">More...</a><br/></td></tr>
+<tr class="separator:ga0f4a0efe2116535b882eddeeb272042d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8074b7ef4524abfeb10bef68c4cfdf5e"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e">hawki_pfits_get_cumoffsetx</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga8074b7ef4524abfeb10bef68c4cfdf5e"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in X  <a href="#ga8074b7ef4524abfeb10bef68c4cfdf5e">More...</a><br/></td></tr>
+<tr class="separator:ga8074b7ef4524abfeb10bef68c4cfdf5e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga21f640e98b8f695ac6229e9f15d46aca"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca">hawki_pfits_get_cumoffsety</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga21f640e98b8f695ac6229e9f15d46aca"><td class="mdescLeft"> </td><td class="mdescRight">find out the cumulative offset in Y  <a href="#ga21f640e98b8f695ac6229e9f15d46aca">More...</a><br/></td></tr>
+<tr class="separator:ga21f640e98b8f695ac6229e9f15d46aca"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga87aca0d821694845e43e06dca5ace1a0"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0">hawki_pfits_get_date_obs</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga87aca0d821694845e43e06dca5ace1a0"><td class="mdescLeft"> </td><td class="mdescRight">find out the date of observation  <a href="#ga87aca0d821694845e43e06dca5ace1a0">More...</a><br/></td></tr>
+<tr class="separator:ga87aca0d821694845e43e06dca5ace1a0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaca47ff94f05c2bb322ea83ce4cf9b4d4"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4">hawki_pfits_get_dec</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaca47ff94f05c2bb322ea83ce4cf9b4d4"><td class="mdescLeft"> </td><td class="mdescRight">find out the DEC  <a href="#gaca47ff94f05c2bb322ea83ce4cf9b4d4">More...</a><br/></td></tr>
+<tr class="separator:gaca47ff94f05c2bb322ea83ce4cf9b4d4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1971ab60e27df384b5fd533461e7356f"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f">hawki_pfits_get_dit</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga1971ab60e27df384b5fd533461e7356f"><td class="mdescLeft"> </td><td class="mdescRight">find out the DIT value  <a href="#ga1971ab60e27df384b5fd533461e7356f">More...</a><br/></td></tr>
+<tr class="separator:ga1971ab60e27df384b5fd533461e7356f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga965d40d225307d5a40d697a0a532f246"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246">hawki_pfits_get_elevation</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga965d40d225307d5a40d697a0a532f246"><td class="mdescLeft"> </td><td class="mdescRight">find out the telescope altitude  <a href="#ga965d40d225307d5a40d697a0a532f246">More...</a><br/></td></tr>
+<tr class="separator:ga965d40d225307d5a40d697a0a532f246"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5161743d5b650a637d543959b5bd54ea"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea">hawki_pfits_get_extname</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga5161743d5b650a637d543959b5bd54ea"><td class="mdescLeft"> </td><td class="mdescRight">find out the extname  <a href="#ga5161743d5b650a637d543959b5bd54ea">More...</a><br/></td></tr>
+<tr class="separator:ga5161743d5b650a637d543959b5bd54ea"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3ad06f5c4dea6ec8adcc437e7f9f5501"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501">hawki_pfits_get_filter</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga3ad06f5c4dea6ec8adcc437e7f9f5501"><td class="mdescLeft"> </td><td class="mdescRight">find out which wave band is active  <a href="#ga3ad06f5c4dea6ec8adcc437e7f9f5501">More...</a><br/></td></tr>
+<tr class="separator:ga3ad06f5c4dea6ec8adcc437e7f9f5501"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1cd57f592c68d5e084ee049bdbe979a4"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4">hawki_pfits_get_focus</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga1cd57f592c68d5e084ee049bdbe979a4"><td class="mdescLeft"> </td><td class="mdescRight">find out the focus position of M2  <a href="#ga1cd57f592c68d5e084ee049bdbe979a4">More...</a><br/></td></tr>
+<tr class="separator:ga1cd57f592c68d5e084ee049bdbe979a4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga643c35f35f7f49a3e1c6bafd022e364a"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a">hawki_pfits_get_humidity_level</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga643c35f35f7f49a3e1c6bafd022e364a"><td class="mdescLeft"> </td><td class="mdescRight">find out the humidity level  <a href="#ga643c35f35f7f49a3e1c6bafd022e364a">More...</a><br/></td></tr>
+<tr class="separator:ga643c35f35f7f49a3e1c6bafd022e364a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga509576593bbfc282745eae7d29a89102"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102">hawki_pfits_get_naxis1</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga509576593bbfc282745eae7d29a89102"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of pixels in axis 1.  <a href="#ga509576593bbfc282745eae7d29a89102">More...</a><br/></td></tr>
+<tr class="separator:ga509576593bbfc282745eae7d29a89102"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaabcefe7bbad8cb43ad652970057d0356"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356">hawki_pfits_get_naxis2</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaabcefe7bbad8cb43ad652970057d0356"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of pixels in axis 2.  <a href="#gaabcefe7bbad8cb43ad652970057d0356">More...</a><br/></td></tr>
+<tr class="separator:gaabcefe7bbad8cb43ad652970057d0356"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7c2b338fdf41bdeb1149b60af82c0788"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788">hawki_pfits_get_ndit</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga7c2b338fdf41bdeb1149b60af82c0788"><td class="mdescLeft"> </td><td class="mdescRight">find out the NDIT value  <a href="#ga7c2b338fdf41bdeb1149b60af82c0788">More...</a><br/></td></tr>
+<tr class="separator:ga7c2b338fdf41bdeb1149b60af82c0788"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0d1ccf97334b28566b2bc8fe17786190"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190">hawki_pfits_get_ndsamples</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga0d1ccf97334b28566b2bc8fe17786190"><td class="mdescLeft"> </td><td class="mdescRight">find out the NDSAMPLES value  <a href="#ga0d1ccf97334b28566b2bc8fe17786190">More...</a><br/></td></tr>
+<tr class="separator:ga0d1ccf97334b28566b2bc8fe17786190"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae157c2c48d5b4e41ffafef1348c939d2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2">hawki_pfits_get_nexp</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gae157c2c48d5b4e41ffafef1348c939d2"><td class="mdescLeft"> </td><td class="mdescRight">find out the NEXP value  <a href="#gae157c2c48d5b4e41ffafef1348c939d2">More...</a><br/></td></tr>
+<tr class="separator:gae157c2c48d5b4e41ffafef1348c939d2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa400a879086340c841865fc6c2a1cc21"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21">hawki_pfits_get_obs_seeing_end</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaa400a879086340c841865fc6c2a1cc21"><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory seeing at end  <a href="#gaa400a879086340c841865fc6c2a1cc21">More...</a><br/></td></tr>
+<tr class="separator:gaa400a879086340c841865fc6c2a1cc21"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae005518fe79a76ee9b1cea2c3403a259"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259">hawki_pfits_get_obs_seeing_start</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gae005518fe79a76ee9b1cea2c3403a259"><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory seeing at start  <a href="#gae005518fe79a76ee9b1cea2c3403a259">More...</a><br/></td></tr>
+<tr class="separator:gae005518fe79a76ee9b1cea2c3403a259"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae4c54267b67c5efdcf93afb99ecaeb3b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b">hawki_pfits_get_obs_temp</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gae4c54267b67c5efdcf93afb99ecaeb3b"><td class="mdescLeft"> </td><td class="mdescRight">find out the ambient temperatur  <a href="#gae4c54267b67c5efdcf93afb99ecaeb3b">More...</a><br/></td></tr>
+<tr class="separator:gae4c54267b67c5efdcf93afb99ecaeb3b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3465a5cbb9e21e8cbd7680affc75355b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b">hawki_pfits_get_parangle_end</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga3465a5cbb9e21e8cbd7680affc75355b"><td class="mdescLeft"> </td><td class="mdescRight">find out the paralactic angle at start  <a href="#ga3465a5cbb9e21e8cbd7680affc75355b">More...</a><br/></td></tr>
+<tr class="separator:ga3465a5cbb9e21e8cbd7680affc75355b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2dc1b31621ecbeec49d3e390ad601274"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274">hawki_pfits_get_parangle_start</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga2dc1b31621ecbeec49d3e390ad601274"><td class="mdescLeft"> </td><td class="mdescRight">find out the paralactic angle at start  <a href="#ga2dc1b31621ecbeec49d3e390ad601274">More...</a><br/></td></tr>
+<tr class="separator:ga2dc1b31621ecbeec49d3e390ad601274"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga79c432e5ab5585c45472cfa86b2d146b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b">hawki_pfits_get_pixscale</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga79c432e5ab5585c45472cfa86b2d146b"><td class="mdescLeft"> </td><td class="mdescRight">find out the pixel scale  <a href="#ga79c432e5ab5585c45472cfa86b2d146b">More...</a><br/></td></tr>
+<tr class="separator:ga79c432e5ab5585c45472cfa86b2d146b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88a2db02738f3881bad0e2bde2768951"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951">hawki_pfits_get_posangle</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga88a2db02738f3881bad0e2bde2768951"><td class="mdescLeft"> </td><td class="mdescRight">find out the position angle  <a href="#ga88a2db02738f3881bad0e2bde2768951">More...</a><br/></td></tr>
+<tr class="separator:ga88a2db02738f3881bad0e2bde2768951"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga11eecff7f4c8031ff6ea929e15c20813"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813">hawki_pfits_get_pressure_end</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga11eecff7f4c8031ff6ea929e15c20813"><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory atmospheric pressure at end  <a href="#ga11eecff7f4c8031ff6ea929e15c20813">More...</a><br/></td></tr>
+<tr class="separator:ga11eecff7f4c8031ff6ea929e15c20813"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga87d6ba1cd310181f2eab02fc4688bad4"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4">hawki_pfits_get_pressure_start</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga87d6ba1cd310181f2eab02fc4688bad4"><td class="mdescLeft"> </td><td class="mdescRight">find out the observatory atmospheric pressure at start  <a href="#ga87d6ba1cd310181f2eab02fc4688bad4">More...</a><br/></td></tr>
+<tr class="separator:ga87d6ba1cd310181f2eab02fc4688bad4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad9c95c0d3bc75d347bf9acbcb8fe549d"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d">hawki_pfits_get_procatg</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gad9c95c0d3bc75d347bf9acbcb8fe549d"><td class="mdescLeft"> </td><td class="mdescRight">find out the PRO.CATG  <a href="#gad9c95c0d3bc75d347bf9acbcb8fe549d">More...</a><br/></td></tr>
+<tr class="separator:gad9c95c0d3bc75d347bf9acbcb8fe549d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6f490d48a329331dc3b1bc48c1e9ed1d"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d">hawki_pfits_get_ra</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga6f490d48a329331dc3b1bc48c1e9ed1d"><td class="mdescLeft"> </td><td class="mdescRight">find out the RA  <a href="#ga6f490d48a329331dc3b1bc48c1e9ed1d">More...</a><br/></td></tr>
+<tr class="separator:ga6f490d48a329331dc3b1bc48c1e9ed1d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafc9299ed697db3ecfd1bb4c7e548cf3b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b">hawki_pfits_get_relhum</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gafc9299ed697db3ecfd1bb4c7e548cf3b"><td class="mdescLeft"> </td><td class="mdescRight">find out the relative humidity  <a href="#gafc9299ed697db3ecfd1bb4c7e548cf3b">More...</a><br/></td></tr>
+<tr class="separator:gafc9299ed697db3ecfd1bb4c7e548cf3b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac8b9879cdc3c2e82f3b169eef3355ef2"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2">hawki_pfits_get_rotator_end</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gac8b9879cdc3c2e82f3b169eef3355ef2"><td class="mdescLeft"> </td><td class="mdescRight">find out the absolute rotator position at end  <a href="#gac8b9879cdc3c2e82f3b169eef3355ef2">More...</a><br/></td></tr>
+<tr class="separator:gac8b9879cdc3c2e82f3b169eef3355ef2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa91a5e47c4661209f97f4399cbceb9d2"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2">hawki_pfits_get_rotator_start</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaa91a5e47c4661209f97f4399cbceb9d2"><td class="mdescLeft"> </td><td class="mdescRight">find out the absolute rotator position at start  <a href="#gaa91a5e47c4661209f97f4399cbceb9d2">More...</a><br/></td></tr>
+<tr class="separator:gaa91a5e47c4661209f97f4399cbceb9d2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga36892dc77006059ba553e9a98c9b55fc"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc">hawki_pfits_get_targ_alpha</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga36892dc77006059ba553e9a98c9b55fc"><td class="mdescLeft"> </td><td class="mdescRight">find out the target RA  <a href="#ga36892dc77006059ba553e9a98c9b55fc">More...</a><br/></td></tr>
+<tr class="separator:ga36892dc77006059ba553e9a98c9b55fc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0645065208992d9bf67d189796db4e67"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0645065208992d9bf67d189796db4e67">hawki_pfits_get_targ_alpha_hhmmss</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga0645065208992d9bf67d189796db4e67"><td class="mdescLeft"> </td><td class="mdescRight">find out the target RA in HHMMSS format  <a href="#ga0645065208992d9bf67d189796db4e67">More...</a><br/></td></tr>
+<tr class="separator:ga0645065208992d9bf67d189796db4e67"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0330c53376304376257417ea4edbee5c"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c">hawki_pfits_get_targ_delta</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga0330c53376304376257417ea4edbee5c"><td class="mdescLeft"> </td><td class="mdescRight">find out the target DEC  <a href="#ga0330c53376304376257417ea4edbee5c">More...</a><br/></td></tr>
+<tr class="separator:ga0330c53376304376257417ea4edbee5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae4655f62c9a6997a95fd2794e82640b3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gae4655f62c9a6997a95fd2794e82640b3">hawki_pfits_get_targ_delta_ddmmss</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gae4655f62c9a6997a95fd2794e82640b3"><td class="mdescLeft"> </td><td class="mdescRight">find out the target DEC in DDMMSS format  <a href="#gae4655f62c9a6997a95fd2794e82640b3">More...</a><br/></td></tr>
+<tr class="separator:gae4655f62c9a6997a95fd2794e82640b3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga07110c618d0772882174838d8ce9a168"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168">hawki_pfits_get_targ_epoch</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga07110c618d0772882174838d8ce9a168"><td class="mdescLeft"> </td><td class="mdescRight">find out the target epoch  <a href="#ga07110c618d0772882174838d8ce9a168">More...</a><br/></td></tr>
+<tr class="separator:ga07110c618d0772882174838d8ce9a168"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga662be8ce410cbfa244f51ec8e5f0baad"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad">hawki_pfits_get_targ_equinox</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga662be8ce410cbfa244f51ec8e5f0baad"><td class="mdescLeft"> </td><td class="mdescRight">find out the target equinox  <a href="#ga662be8ce410cbfa244f51ec8e5f0baad">More...</a><br/></td></tr>
+<tr class="separator:ga662be8ce410cbfa244f51ec8e5f0baad"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaab1203aaa32935d1e81db6bb0aeec96b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b">hawki_pfits_get_tau0</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:gaab1203aaa32935d1e81db6bb0aeec96b"><td class="mdescLeft"> </td><td class="mdescRight">find out the average coherence time  <a href="#gaab1203aaa32935d1e81db6bb0aeec96b">More...</a><br/></td></tr>
+<tr class="separator:gaab1203aaa32935d1e81db6bb0aeec96b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7bd674c51f4cd62ce34c208888cea125"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125">hawki_pfits_get_wind_dir</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga7bd674c51f4cd62ce34c208888cea125"><td class="mdescLeft"> </td><td class="mdescRight">find out the wind direction  <a href="#ga7bd674c51f4cd62ce34c208888cea125">More...</a><br/></td></tr>
+<tr class="separator:ga7bd674c51f4cd62ce34c208888cea125"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga45e0b30ba22df26f4d061dee26735708"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708">hawki_pfits_get_wind_speed</a> (const cpl_propertylist *plist)</td></tr>
+<tr class="memdesc:ga45e0b30ba22df26f4d061dee26735708"><td class="mdescLeft"> </td><td class="mdescRight">find out the wind speed  <a href="#ga45e0b30ba22df26f4d061dee26735708">More...</a><br/></td></tr>
+<tr class="separator:ga45e0b30ba22df26f4d061dee26735708"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="gafccabad8d0fcc65a0ed27d1dff7ae8e3"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_airmass_end" ref="gafccabad8d0fcc65a0ed27d1dff7ae8e3" args="(const cpl_propertylist *plist)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gafccabad8d0fcc65a0ed27d1dff7ae8e3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -160,17 +226,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out airmass end </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00073">73</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
@@ -178,7 +243,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga4e7f03745ede13d9d2db3eddccd857df"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_airmass_start" ref="ga4e7f03745ede13d9d2db3eddccd857df" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga4e7f03745ede13d9d2db3eddccd857df"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -190,17 +255,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out airmass start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00061">61</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
@@ -208,7 +272,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gac9b88815381f3f61c10dc88730d77121"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_ao_fwhm" ref="gac9b88815381f3f61c10dc88730d77121" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gac9b88815381f3f61c10dc88730d77121"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -220,25 +284,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the fwhm from the AO system </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00573">573</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00605">605</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gae4f45ff97625d37b9354392b0c5e1056"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_arcfile" ref="gae4f45ff97625d37b9354392b0c5e1056" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gae4f45ff97625d37b9354392b0c5e1056"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -250,23 +313,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the arcfile </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to statically allocated character string </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00215">215</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00247">247</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaf18030b75b198e924f296cdd13356b58"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_azimut" ref="gaf18030b75b198e924f296cdd13356b58" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaf18030b75b198e924f296cdd13356b58"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -278,25 +340,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the telescope azimut </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00501">501</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00533">533</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga39d06faa1dcc2d3601e07e79064f9e78"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cdelta1" ref="ga39d06faa1dcc2d3601e07e79064f9e78" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga39d06faa1dcc2d3601e07e79064f9e78"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -308,23 +369,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the increment of coordinate in one pixel (axe 1) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00371">371</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00403">403</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaeea4d2dba260fc663a4aa5d5a616086c"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cdelta2" ref="gaeea4d2dba260fc663a4aa5d5a616086c" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaeea4d2dba260fc663a4aa5d5a616086c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -336,23 +396,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the increment of coordinate in one pixel (axe 2) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00383">383</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00415">415</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga24483514187ce9bcf0860cc654b8508c"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_comb_cumoffsetx" ref="ga24483514187ce9bcf0860cc654b8508c" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga24483514187ce9bcf0860cc654b8508c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -364,23 +423,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative X offset of the combined image </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00682">682</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00714">714</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gadc1b3f141f5474486b5b32502634b29a"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_comb_cumoffsety" ref="gadc1b3f141f5474486b5b32502634b29a" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gadc1b3f141f5474486b5b32502634b29a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -392,23 +450,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative Y offset of the combined image </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00694">694</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00726">726</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga88f1a9b44888686b6489fba06921f5a1"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_comb_posx" ref="ga88f1a9b44888686b6489fba06921f5a1" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga88f1a9b44888686b6489fba06921f5a1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -420,23 +477,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the relative X offset of the combined image wrt first image </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00706">706</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00738">738</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga5408b902329bdad15fd408d73fa6376e"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_comb_posy" ref="ga5408b902329bdad15fd408d73fa6376e" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga5408b902329bdad15fd408d73fa6376e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -448,23 +504,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the relative Y offset of the combined image wrt first image </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00718">718</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00750">750</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaaeee5723004e441f48fb8cc804370f80"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_crpix1" ref="gaaeee5723004e441f48fb8cc804370f80" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaaeee5723004e441f48fb8cc804370f80"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -476,23 +531,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the reference pixel in axe 1 </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00347">347</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00379">379</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaab4e70f9071230674a49cb8df1975f10"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_crpix2" ref="gaab4e70f9071230674a49cb8df1975f10" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaab4e70f9071230674a49cb8df1975f10"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -504,23 +558,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the reference pixel in axe 1 </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00359">359</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00391">391</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga98f777c6f085878ba095b1ccd40ef6ea"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_crval1" ref="ga98f777c6f085878ba095b1ccd40ef6ea" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga98f777c6f085878ba095b1ccd40ef6ea"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -532,23 +585,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the value in WCS coordinates of the reference pixel (axe 1) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00323">323</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00355">355</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga7fbf6de80172c991e4a9d7f427741692"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_crval2" ref="ga7fbf6de80172c991e4a9d7f427741692" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga7fbf6de80172c991e4a9d7f427741692"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -560,23 +612,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the value in WCS coordinates of the reference pixel (axe 2) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00335">335</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00367">367</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga62ff6ef5b06d163b64e8eff779e5fb53"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cumoffseta" ref="ga62ff6ef5b06d163b64e8eff779e5fb53" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga62ff6ef5b06d163b64e8eff779e5fb53"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -588,25 +639,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative offset in alpha </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00395">395</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00427">427</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga0f4a0efe2116535b882eddeeb272042d"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cumoffsetd" ref="ga0f4a0efe2116535b882eddeeb272042d" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga0f4a0efe2116535b882eddeeb272042d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -618,25 +668,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative offset in delta </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00407">407</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00439">439</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga8074b7ef4524abfeb10bef68c4cfdf5e"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cumoffsetx" ref="ga8074b7ef4524abfeb10bef68c4cfdf5e" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga8074b7ef4524abfeb10bef68c4cfdf5e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -648,25 +697,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative offset in X </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00419">419</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00451">451</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>, and <a class="el" href="hawki__utils_8c_source.html#l00695">hawki_get_header_tel_offsets()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga21f640e98b8f695ac6229e9f15d46aca"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_cumoffsety" ref="ga21f640e98b8f695ac6229e9f15d46aca" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga21f640e98b8f695ac6229e9f15d46aca"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -678,25 +726,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the cumulative offset in Y </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00431">431</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00463">463</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>, and <a class="el" href="hawki__utils_8c_source.html#l00695">hawki_get_header_tel_offsets()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga87aca0d821694845e43e06dca5ace1a0"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_date_obs" ref="ga87aca0d821694845e43e06dca5ace1a0" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga87aca0d821694845e43e06dca5ace1a0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -708,23 +755,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the date of observation </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to statically allocated character string </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00227">227</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00259">259</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaca47ff94f05c2bb322ea83ce4cf9b4d4"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_dec" ref="gaca47ff94f05c2bb322ea83ce4cf9b4d4" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaca47ff94f05c2bb322ea83ce4cf9b4d4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -736,23 +782,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the DEC </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00191">191</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00223">223</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga1971ab60e27df384b5fd533461e7356f"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_dit" ref="ga1971ab60e27df384b5fd533461e7356f" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga1971ab60e27df384b5fd533461e7356f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -764,23 +809,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the DIT value </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00251">251</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00283">283</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga965d40d225307d5a40d697a0a532f246"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_elevation" ref="ga965d40d225307d5a40d697a0a532f246" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga965d40d225307d5a40d697a0a532f246"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -792,25 +836,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the telescope altitude </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00489">489</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00521">521</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga5161743d5b650a637d543959b5bd54ea"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_extname" ref="ga5161743d5b650a637d543959b5bd54ea" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga5161743d5b650a637d543959b5bd54ea"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -822,25 +865,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the extname </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to statically allocated character string </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00203">203</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00235">235</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__load_8c_source.html#l00817">hawki_get_detector_from_ext()</a>, and <a class="el" href="hawki__load_8c_source.html#l00846">hawki_get_ext_from_detector()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga3ad06f5c4dea6ec8adcc437e7f9f5501"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_filter" ref="ga3ad06f5c4dea6ec8adcc437e7f9f5501" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga3ad06f5c4dea6ec8adcc437e7f9f5501"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -852,23 +894,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out which wave band is active </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to statically allocated character string </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00455">455</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00487">487</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga1cd57f592c68d5e084ee049bdbe979a4"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_focus" ref="ga1cd57f592c68d5e084ee049bdbe979a4" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga1cd57f592c68d5e084ee049bdbe979a4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -880,23 +921,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the focus position of M2 </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00477">477</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00509">509</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga643c35f35f7f49a3e1c6bafd022e364a"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_humidity_level" ref="ga643c35f35f7f49a3e1c6bafd022e364a" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga643c35f35f7f49a3e1c6bafd022e364a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -908,23 +948,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the humidity level </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00085">85</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga509576593bbfc282745eae7d29a89102"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_naxis1" ref="ga509576593bbfc282745eae7d29a89102" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga509576593bbfc282745eae7d29a89102"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -936,25 +975,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the number of pixels in axis 1. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00299">299</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00331">331</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__utils_8c_source.html#l00837">hawki_detectors_locate_star()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaabcefe7bbad8cb43ad652970057d0356"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_naxis2" ref="gaabcefe7bbad8cb43ad652970057d0356" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaabcefe7bbad8cb43ad652970057d0356"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -966,25 +1004,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the number of pixels in axis 2. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00311">311</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00343">343</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__utils_8c_source.html#l00837">hawki_detectors_locate_star()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga7c2b338fdf41bdeb1149b60af82c0788"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_ndit" ref="ga7c2b338fdf41bdeb1149b60af82c0788" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga7c2b338fdf41bdeb1149b60af82c0788"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -996,23 +1033,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the NDIT value </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00263">263</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00295">295</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga0d1ccf97334b28566b2bc8fe17786190"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_ndsamples" ref="ga0d1ccf97334b28566b2bc8fe17786190" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga0d1ccf97334b28566b2bc8fe17786190"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1024,23 +1060,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the NDSAMPLES value </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00275">275</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00307">307</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gae157c2c48d5b4e41ffafef1348c939d2"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_nexp" ref="gae157c2c48d5b4e41ffafef1348c939d2" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gae157c2c48d5b4e41ffafef1348c939d2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1052,23 +1087,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the NEXP value </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00239">239</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00271">271</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaa400a879086340c841865fc6c2a1cc21"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_obs_seeing_end" ref="gaa400a879086340c841865fc6c2a1cc21" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaa400a879086340c841865fc6c2a1cc21"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1080,25 +1114,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the observatory seeing at end </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00621">621</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00653">653</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gae005518fe79a76ee9b1cea2c3403a259"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_obs_seeing_start" ref="gae005518fe79a76ee9b1cea2c3403a259" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gae005518fe79a76ee9b1cea2c3403a259"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1110,25 +1143,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the observatory seeing at start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00609">609</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00641">641</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gae4c54267b67c5efdcf93afb99ecaeb3b"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_obs_temp" ref="gae4c54267b67c5efdcf93afb99ecaeb3b" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gae4c54267b67c5efdcf93afb99ecaeb3b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1140,25 +1172,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the ambient temperatur </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00537">537</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00569">569</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga3465a5cbb9e21e8cbd7680affc75355b"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_parangle_end" ref="ga3465a5cbb9e21e8cbd7680affc75355b" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga3465a5cbb9e21e8cbd7680affc75355b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1170,25 +1201,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the paralactic angle at start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00669">669</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00701">701</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga2dc1b31621ecbeec49d3e390ad601274"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_parangle_start" ref="ga2dc1b31621ecbeec49d3e390ad601274" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga2dc1b31621ecbeec49d3e390ad601274"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1200,25 +1230,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the paralactic angle at start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00657">657</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00689">689</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga79c432e5ab5585c45472cfa86b2d146b"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_pixscale" ref="ga79c432e5ab5585c45472cfa86b2d146b" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga79c432e5ab5585c45472cfa86b2d146b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1230,23 +1259,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the pixel scale </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00287">287</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00319">319</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga88a2db02738f3881bad0e2bde2768951"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_posangle" ref="ga88a2db02738f3881bad0e2bde2768951" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga88a2db02738f3881bad0e2bde2768951"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1258,23 +1286,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the position angle </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00443">443</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00475">475</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga11eecff7f4c8031ff6ea929e15c20813"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_pressure_end" ref="ga11eecff7f4c8031ff6ea929e15c20813" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga11eecff7f4c8031ff6ea929e15c20813"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1286,25 +1313,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the observatory atmospheric pressure at end </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00645">645</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00677">677</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga87d6ba1cd310181f2eab02fc4688bad4"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_pressure_start" ref="ga87d6ba1cd310181f2eab02fc4688bad4" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga87d6ba1cd310181f2eab02fc4688bad4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1316,25 +1342,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the observatory atmospheric pressure at start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00633">633</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00665">665</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gad9c95c0d3bc75d347bf9acbcb8fe549d"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_procatg" ref="gad9c95c0d3bc75d347bf9acbcb8fe549d" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gad9c95c0d3bc75d347bf9acbcb8fe549d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1346,23 +1371,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the PRO.CATG </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to statically allocated character string </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00097">97</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga6f490d48a329331dc3b1bc48c1e9ed1d"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_ra" ref="ga6f490d48a329331dc3b1bc48c1e9ed1d" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga6f490d48a329331dc3b1bc48c1e9ed1d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1374,23 +1398,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the RA </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00179">179</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00211">211</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gafc9299ed697db3ecfd1bb4c7e548cf3b"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_relhum" ref="gafc9299ed697db3ecfd1bb4c7e548cf3b" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gafc9299ed697db3ecfd1bb4c7e548cf3b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1402,25 +1425,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the relative humidity </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00513">513</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00545">545</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gac8b9879cdc3c2e82f3b169eef3355ef2"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_rotator_end" ref="gac8b9879cdc3c2e82f3b169eef3355ef2" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gac8b9879cdc3c2e82f3b169eef3355ef2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1432,25 +1454,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the absolute rotator position at end </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00597">597</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00629">629</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaa91a5e47c4661209f97f4399cbceb9d2"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_rotator_start" ref="gaa91a5e47c4661209f97f4399cbceb9d2" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaa91a5e47c4661209f97f4399cbceb9d2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1462,25 +1483,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the absolute rotator position at start </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00585">585</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00617">617</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga36892dc77006059ba553e9a98c9b55fc"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_targ_alpha" ref="ga36892dc77006059ba553e9a98c9b55fc" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga36892dc77006059ba553e9a98c9b55fc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1492,81 +1512,134 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the target RA </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value in degrees</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in degrees</dd></dl>
 <p>This function decodifies the returned value, since it is in HHMMSS.SS </p>
 
 <p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00111">111</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga0330c53376304376257417ea4edbee5c"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_targ_delta" ref="ga0330c53376304376257417ea4edbee5c" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga0645065208992d9bf67d189796db4e67"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double hawki_pfits_get_targ_delta </td>
+          <td class="memname">double hawki_pfits_get_targ_alpha_hhmmss </td>
           <td>(</td>
           <td class="paramtype">const cpl_propertylist * </td>
           <td class="paramname"><em>plist</em></td><td>)</td>
           <td></td>
         </tr>
       </table>
+</div><div class="memdoc">
+
+<p>find out the target RA in HHMMSS format </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in degrees</dd></dl>
+<p>This function reads the keywords as it is, in HHMMSS.SS format </p>
+
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00133">133</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+
 </div>
-<div class="memdoc">
+</div>
+<a class="anchor" id="ga0330c53376304376257417ea4edbee5c"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">double hawki_pfits_get_targ_delta </td>
+          <td>(</td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>plist</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div><div class="memdoc">
 
 <p>find out the target DEC </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value in degrees</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in degrees</dd></dl>
 <p>This function decodifies the returned value, since it is in DDMMSS.SS </p>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00133">133</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00149">149</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga07110c618d0772882174838d8ce9a168"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_targ_epoch" ref="ga07110c618d0772882174838d8ce9a168" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gae4655f62c9a6997a95fd2794e82640b3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double hawki_pfits_get_targ_epoch </td>
+          <td class="memname">double hawki_pfits_get_targ_delta_ddmmss </td>
           <td>(</td>
           <td class="paramtype">const cpl_propertylist * </td>
           <td class="paramname"><em>plist</em></td><td>)</td>
           <td></td>
         </tr>
       </table>
+</div><div class="memdoc">
+
+<p>find out the target DEC in DDMMSS format </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in degrees</dd></dl>
+<p>This function reads the keywords as it is, in DDMMSS.SS format </p>
+
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00171">171</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+
+</div>
 </div>
-<div class="memdoc">
+<a class="anchor" id="ga07110c618d0772882174838d8ce9a168"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">double hawki_pfits_get_targ_epoch </td>
+          <td>(</td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>plist</em></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div><div class="memdoc">
 
 <p>find out the target epoch </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value in years </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in years </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00167">167</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00199">199</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga662be8ce410cbfa244f51ec8e5f0baad"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_targ_equinox" ref="ga662be8ce410cbfa244f51ec8e5f0baad" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga662be8ce410cbfa244f51ec8e5f0baad"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1578,23 +1651,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the target equinox </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value in years </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value in years </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00154">154</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00186">186</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gaab1203aaa32935d1e81db6bb0aeec96b"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_tau0" ref="gaab1203aaa32935d1e81db6bb0aeec96b" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="gaab1203aaa32935d1e81db6bb0aeec96b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1606,25 +1678,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the average coherence time </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00525">525</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00557">557</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga7bd674c51f4cd62ce34c208888cea125"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_wind_dir" ref="ga7bd674c51f4cd62ce34c208888cea125" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga7bd674c51f4cd62ce34c208888cea125"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1636,25 +1707,24 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the wind direction </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00549">549</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00581">581</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga45e0b30ba22df26f4d061dee26735708"></a><!-- doxytag: member="hawki_pfits.c::hawki_pfits_get_wind_speed" ref="ga45e0b30ba22df26f4d061dee26735708" args="(const cpl_propertylist *plist)" -->
+<a class="anchor" id="ga45e0b30ba22df26f4d061dee26735708"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1666,27 +1736,29 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>find out the wind speed </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">plist</td><td>property list to read from </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the requested value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the requested value </dd></dl>
 
-<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00561">561</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
+<p>Definition at line <a class="el" href="hawki__pfits_8c_source.html#l00593">593</a> of file <a class="el" href="hawki__pfits_8c_source.html">hawki_pfits.c</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__properties__tel_8c_source.html#l00188">hawki_extract_prop_tel_qc()</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__properties__tel.html b/html/group__hawki__properties__tel.html
index 90189fb..9e3112c 100644
--- a/html/group__hawki__properties__tel.html
+++ b/html/group__hawki__properties__tel.html
@@ -2,51 +2,60 @@
 <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>HAWKI Pipeline Reference Manual: Manipulates QC keywords from the telescope</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Manipulates QC keywords from the telescope</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612">hawki_extract_prop_tel_qc</a> (const cpl_propertylist *all_property_list, cpl_table *telescope_prop, int irow)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts all the QC keywords and append them to the table.  <a href="#gaedbe52365a410453e02d6b36d9d1b612"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9">hawki_prop_tel_initialize</a> (cpl_table *telescope_prop)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the table with all the telescope data columns.  <a href="#ga2895d7c995564a2bbbdcab5c195cfac9"></a><br/></td></tr>
+<tr class="memitem:gaedbe52365a410453e02d6b36d9d1b612"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612">hawki_extract_prop_tel_qc</a> (const cpl_propertylist *all_property_list, cpl_table *telescope_prop, int irow)</td></tr>
+<tr class="memdesc:gaedbe52365a410453e02d6b36d9d1b612"><td class="mdescLeft"> </td><td class="mdescRight">Extracts all the QC keywords and append them to the table.  <a href="#gaedbe52365a410453e02d6b36d9d1b612">More...</a><br/></td></tr>
+<tr class="separator:gaedbe52365a410453e02d6b36d9d1b612"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2895d7c995564a2bbbdcab5c195cfac9"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9">hawki_prop_tel_initialize</a> (cpl_table *telescope_prop)</td></tr>
+<tr class="memdesc:ga2895d7c995564a2bbbdcab5c195cfac9"><td class="mdescLeft"> </td><td class="mdescRight">Initialize the table with all the telescope data columns.  <a href="#ga2895d7c995564a2bbbdcab5c195cfac9">More...</a><br/></td></tr>
+<tr class="separator:ga2895d7c995564a2bbbdcab5c195cfac9"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="gaedbe52365a410453e02d6b36d9d1b612"></a><!-- doxytag: member="hawki_properties_tel.c::hawki_extract_prop_tel_qc" ref="gaedbe52365a410453e02d6b36d9d1b612" args="(const cpl_propertylist *all_property_list, cpl_table *telescope_prop, int irow)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaedbe52365a410453e02d6b36d9d1b612"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -74,28 +83,27 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Extracts all the QC keywords and append them to the table. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">all_property_list</td><td>The list of all the properties from the header </td></tr>
     <tr><td class="paramname">telescope_prop</td><td>Table with the telescope QC data. </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>The function gets the following keywords from the propertylist: TEL.ALT, TEL.AZ, TEL.AMBI.RHUM, TEl.AMBI.TAU0, TEL.AMBI.TEMP, TEL.AMBI.WINDDIR, TEL.AMBI.WINDSP, TEL.IA.FWHM, SEQ.CUMOFFSETA, SEQ.CUMOFFSETD, SEQ.CUMOFFSETX, SEQ.CUMOFFSETY It also computes the following extra keywords: ADA.ABSROT.DELTA = ADA.ABSROT.END - ADA.ABSROT.START TEL.AIRM = (TEL.AIRM.START + TEL.AIRM.END) / 2.0 TEL AMBI FWHM = (TEL.AMBI.FHWM.START + TEL.AMBI.FWHM.END) / 2.0 TEL.AMBI.PRES = (TEL.AMBI.PRES.START +  [...]
 <p>All these keywords (including the *.START and *.END) are appended in the telescope_prop table, using the column names stated in <a class="el" href="hawki__dfs_8h_source.html">hawki_dfs.h</a> </p>
 
 <p>Definition at line <a class="el" href="hawki__properties__tel_8c_source.html#l00188">188</a> of file <a class="el" href="hawki__properties__tel_8c_source.html">hawki_properties_tel.c</a>.</p>
 
-<p>References <a class="el" href="hawki__pfits_8c_source.html#l00073">hawki_pfits_get_airmass_end()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00061">hawki_pfits_get_airmass_start()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00573">hawki_pfits_get_ao_fwhm()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00501">hawki_pfits_get_azimut()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00395">hawki_pfits_get_cumoffseta()</a>, <a class="el" href="hawki__pfit [...]
+<p>References <a class="el" href="hawki__pfits_8c_source.html#l00073">hawki_pfits_get_airmass_end()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00061">hawki_pfits_get_airmass_start()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00605">hawki_pfits_get_ao_fwhm()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00533">hawki_pfits_get_azimut()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00427">hawki_pfits_get_cumoffseta()</a>, <a class="el" href="hawki__pfit [...]
 
 </div>
 </div>
-<a class="anchor" id="ga2895d7c995564a2bbbdcab5c195cfac9"></a><!-- doxytag: member="hawki_properties_tel.c::hawki_prop_tel_initialize" ref="ga2895d7c995564a2bbbdcab5c195cfac9" args="(cpl_table *telescope_prop)" -->
+<a class="anchor" id="ga2895d7c995564a2bbbdcab5c195cfac9"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -107,26 +115,28 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Initialize the table with all the telescope data columns. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">telescope_prop</td><td>Table with the telescope QC data. </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
 <p>This function creates the following columns in the given table: TEL.ALT, TEL.AZ, TEL.AMBI.RHUM, TEl.AMBI.TAU0, TEL.AMBI.TEMP, TEL.AMBI.WINDDIR, TEL.AMBI.WINDSP, TEL.IA.FWHM, SEQ.CUMOFFSETA, SEQ.CUMOFFSETD, SEQ.CUMOFFSETX, SEQ.CUMOFFSETY ADA.ABSROT.DELTA, ADA.ABSROT.END, ADA.ABSROT.START TEL.AIRM, TEL.AIRM.START, TEL.AIRM.END TEL AMBI FWHM, TEL.AMBI.FHWM.START, TEL.AMBI.FWHM.END TEL.AMBI.PRES, TEL.AMBI.PRES.START, TEL.AMBI.PRES.END TEL.PARANG, TEL.PARANG.START, TEL.PARANG.END TEL.PARAN [...]
 
 <p>Definition at line <a class="el" href="hawki__properties__tel_8c_source.html#l00072">72</a> of file <a class="el" href="hawki__properties__tel_8c_source.html">hawki_properties_tel.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__save.html b/html/group__hawki__save.html
index 49bf40b..d50aeab 100644
--- a/html/group__hawki__save.html
+++ b/html/group__hawki__save.html
@@ -2,61 +2,75 @@
 <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>HAWKI Pipeline Reference Manual: Saving related functions</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Saving related functions</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089">hawki_distortion_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const hawki_distortion **distortion, const char *recipe, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename_x, const char *filename_y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.  <a href="#ga7dd654e4062ef0cf42274ebf274f0089"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536">hawki_get_extref_file</a> (const cpl_frameset *frameset)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Locate a filename where the extension <--> chip id relation can be derived.  <a href="#gab9a3907dcbad413de986ee2e286a6536"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc">hawki_image_ext_save</a> (const cpl_frameset *allframes, const cpl_image *image, int iext, const cpl_propertylist *ext_prop_list, const char *filename)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save an image into a given extension.  <a href="#gab2873c1ec09ba834aaa284f003bc6acc"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d">hawki_imagelist_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_imagelist *images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI image.  <a href="#ga98c1ab4685617ddf7ea51d6e1337695d"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4">hawki_images_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_image **images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI image.  <a href="#ga096962e65c0aab2bce1e9b2419789bd4"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54">hawki_main_header_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const char *filename)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a main header and prepare it to store additional data units later on.  <a href="#gaebd68d7422dd13901e999db3c951bd54"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9">hawki_tables_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_table **tables, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI table.  <a href="#ga6c4661fb9fa1fe2e8335f2ebb4deeab9"></a><br/></td></tr>
+<tr class="memitem:ga7dd654e4062ef0cf42274ebf274f0089"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089">hawki_distortion_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const hawki_distortion **distortion, const char *recipe, const cpl_propertylist *applist, const cpl_propertylist **applists, const ch [...]
+<tr class="memdesc:ga7dd654e4062ef0cf42274ebf274f0089"><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.  <a href="#ga7dd654e4062ef0cf42274ebf274f0089">More...</a><br/></td></tr>
+<tr class="separator:ga7dd654e4062ef0cf42274ebf274f0089"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab9a3907dcbad413de986ee2e286a6536"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536">hawki_get_extref_file</a> (const cpl_frameset *frameset)</td></tr>
+<tr class="memdesc:gab9a3907dcbad413de986ee2e286a6536"><td class="mdescLeft"> </td><td class="mdescRight">Locate a filename where the extension <–> chip id relation can be derived.  <a href="#gab9a3907dcbad413de986ee2e286a6536">More...</a><br/></td></tr>
+<tr class="separator:gab9a3907dcbad413de986ee2e286a6536"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab2873c1ec09ba834aaa284f003bc6acc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc">hawki_image_ext_save</a> (const cpl_frameset *allframes, const cpl_image *image, int iext, const cpl_propertylist *ext_prop_list, const char *filename)</td></tr>
+<tr class="memdesc:gab2873c1ec09ba834aaa284f003bc6acc"><td class="mdescLeft"> </td><td class="mdescRight">Save an image into a given extension.  <a href="#gab2873c1ec09ba834aaa284f003bc6acc">More...</a><br/></td></tr>
+<tr class="separator:gab2873c1ec09ba834aaa284f003bc6acc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga98c1ab4685617ddf7ea51d6e1337695d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d">hawki_imagelist_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_imagelist *images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_p [...]
+<tr class="memdesc:ga98c1ab4685617ddf7ea51d6e1337695d"><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI image.  <a href="#ga98c1ab4685617ddf7ea51d6e1337695d">More...</a><br/></td></tr>
+<tr class="separator:ga98c1ab4685617ddf7ea51d6e1337695d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga096962e65c0aab2bce1e9b2419789bd4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4">hawki_images_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_image **images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propert [...]
+<tr class="memdesc:ga096962e65c0aab2bce1e9b2419789bd4"><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI image.  <a href="#ga096962e65c0aab2bce1e9b2419789bd4">More...</a><br/></td></tr>
+<tr class="separator:ga096962e65c0aab2bce1e9b2419789bd4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaebd68d7422dd13901e999db3c951bd54"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54">hawki_main_header_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const char *filename)</td></tr>
+<tr class="memdesc:gaebd68d7422dd13901e999db3c951bd54"><td class="mdescLeft"> </td><td class="mdescRight">Save a main header and prepare it to store additional data units later on.  <a href="#gaebd68d7422dd13901e999db3c951bd54">More...</a><br/></td></tr>
+<tr class="separator:gaebd68d7422dd13901e999db3c951bd54"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6c4661fb9fa1fe2e8335f2ebb4deeab9"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9">hawki_tables_save</a> (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_table **tables, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propert [...]
+<tr class="memdesc:ga6c4661fb9fa1fe2e8335f2ebb4deeab9"><td class="mdescLeft"> </td><td class="mdescRight">Save a HAWKI_NB_DETECTORS extensions HAWKI table.  <a href="#ga6c4661fb9fa1fe2e8335f2ebb4deeab9">More...</a><br/></td></tr>
+<tr class="separator:ga6c4661fb9fa1fe2e8335f2ebb4deeab9"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga7dd654e4062ef0cf42274ebf274f0089"></a><!-- doxytag: member="hawki_save.c::hawki_distortion_save" ref="ga7dd654e4062ef0cf42274ebf274f0089" args="(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const hawki_distortion **distortion, const char *recipe, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename_x, const char *filename_y)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga7dd654e4062ef0cf42274ebf274f0089"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -120,11 +134,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">allframes</td><td>The list of input frames for the recipe </td></tr>
     <tr><td class="paramname">parlist</td><td>The list of input parameters </td></tr>
@@ -141,7 +154,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case</dd></dl>
 <p>This function allows to store images of different sizes in the extensions </p>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00514">514</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
@@ -150,7 +163,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gab9a3907dcbad413de986ee2e286a6536"></a><!-- doxytag: member="hawki_save.c::hawki_get_extref_file" ref="gab9a3907dcbad413de986ee2e286a6536" args="(const cpl_frameset *frameset)" -->
+<a class="anchor" id="gab9a3907dcbad413de986ee2e286a6536"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -162,17 +175,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>Locate a filename where the extension <--> chip id relation can be derived. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<p>Locate a filename where the extension <–> chip id relation can be derived. </p>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frameset</td><td>A frameset where a suitable frame can be extracted. </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The filename if ok. NULL otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The filename if ok. NULL otherwise</dd></dl>
 <p>This function will get the first frame with four extensions that is part of the RAW group. </p>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00656">656</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
@@ -181,7 +193,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gab2873c1ec09ba834aaa284f003bc6acc"></a><!-- doxytag: member="hawki_save.c::hawki_image_ext_save" ref="gab2873c1ec09ba834aaa284f003bc6acc" args="(const cpl_frameset *allframes, const cpl_image *image, int iext, const cpl_propertylist *ext_prop_list, const char *filename)" -->
+<a class="anchor" id="gab2873c1ec09ba834aaa284f003bc6acc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -221,11 +233,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save an image into a given extension. </p>
-<dl class="return"><dt><b>Returns:</b></dt><dd>1 if ok. -1 otherwise</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 if ok. -1 otherwise</dd></dl>
 <p>Extension iext means the main extension. For HAWK-I, iext should run from 1 to HAWKI_NB_DETECTORS </p>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00227">227</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
@@ -234,7 +245,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga98c1ab4685617ddf7ea51d6e1337695d"></a><!-- doxytag: member="hawki_save.c::hawki_imagelist_save" ref="ga98c1ab4685617ddf7ea51d6e1337695d" args="(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_imagelist *images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)" -->
+<a class="anchor" id="ga98c1ab4685617ddf7ea51d6e1337695d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -304,11 +315,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save a HAWKI_NB_DETECTORS extensions HAWKI image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">allframes</td><td>The list of input frames for the recipe </td></tr>
     <tr><td class="paramname">parlist</td><td>The list of input parameters </td></tr>
@@ -324,7 +334,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00072">72</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
 
@@ -332,7 +342,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga096962e65c0aab2bce1e9b2419789bd4"></a><!-- doxytag: member="hawki_save.c::hawki_images_save" ref="ga096962e65c0aab2bce1e9b2419789bd4" args="(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_image **images, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)" -->
+<a class="anchor" id="ga096962e65c0aab2bce1e9b2419789bd4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -402,11 +412,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save a HAWKI_NB_DETECTORS extensions HAWKI image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">allframes</td><td>The list of input frames for the recipe </td></tr>
     <tr><td class="paramname">parlist</td><td>The list of input parameters </td></tr>
@@ -422,7 +431,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case</dd></dl>
 <p>This function allows to store images of different sizes in the extensions </p>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00302">302</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
@@ -431,7 +440,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaebd68d7422dd13901e999db3c951bd54"></a><!-- doxytag: member="hawki_save.c::hawki_main_header_save" ref="gaebd68d7422dd13901e999db3c951bd54" args="(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const char *filename)" -->
+<a class="anchor" id="gaebd68d7422dd13901e999db3c951bd54"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -489,11 +498,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save a main header and prepare it to store additional data units later on. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">allframes</td><td>The list of input frames for the recipe </td></tr>
     <tr><td class="paramname">parlist</td><td>The list of input parameters </td></tr>
@@ -508,13 +516,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00178">178</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga6c4661fb9fa1fe2e8335f2ebb4deeab9"></a><!-- doxytag: member="hawki_save.c::hawki_tables_save" ref="ga6c4661fb9fa1fe2e8335f2ebb4deeab9" args="(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_table **tables, const char *recipe, const char *procat, const char *protype, const cpl_propertylist *applist, const cpl_propertylist **applists, const char *filename)" -->
+<a class="anchor" id="ga6c4661fb9fa1fe2e8335f2ebb4deeab9"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -584,11 +592,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Save a HAWKI_NB_DETECTORS extensions HAWKI table. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">allframes</td><td>The list of input frames for the recipe </td></tr>
     <tr><td class="paramname">parlist</td><td>The list of input parameters </td></tr>
@@ -604,7 +611,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__save_8c_source.html#l00406">406</a> of file <a class="el" href="hawki__save_8c_source.html">hawki_save.c</a>.</p>
 
@@ -612,9 +619,12 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__utils.html b/html/group__hawki__utils.html
index 38cb0b6..053d404 100644
--- a/html/group__hawki__utils.html
+++ b/html/group__hawki__utils.html
@@ -2,97 +2,129 @@
 <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>HAWKI Pipeline Reference Manual: Miscellaneous Utilities</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Miscellaneous Utilities</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96">hawki_apply_harmonization</a> (cpl_imagelist *in, double h1, double h2, double h3, double h4)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the harmonization.  <a href="#gaa24cf39f777ab8389419b3d18a8bec96"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb">hawki_compute_darkbpm</a> (const cpl_image *in, double sigma)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the bpm from the dark (hot pixels)  <a href="#ga292d87e3996e9bb4331980a41d8b45bb"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877">hawki_compute_flatbpm</a> (const cpl_image *in, double sigma, double lowval, double highval)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the bpm from the flat (aka cold pixels mask)  <a href="#ga5d0deca1786f42488784c23e361d0877"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf">hawki_compute_harmonization</a> (const cpl_imagelist *in, double *h1, double *h2, double *h3, double *h4, double *h)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the harmonization.  <a href="#ga367515ebe3345fcd79c2849879633ebf"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd">hawki_compute_lsbg</a> (const cpl_image *in)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the large scale background.  <a href="#ga49279015ecc6c4dcc6a00de6ed6109bd"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884">hawki_detectors_labelise</a> (const cpl_frameset *in)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the frames in which the star is for a given chip.  <a href="#ga024bd2557115d5d7d3265dbcbb3b1884"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0">hawki_detectors_locate_star</a> (const cpl_frameset *in, double star_ra, double star_dec, int *labels)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the frames in which the star is for a given chip.  <a href="#gabee84f3ed597df9a6ae97f07fc2204a0"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9">hawki_extract_first_filename</a> (const cpl_frameset *in, const char *tag)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract the filename ffor the first frame of the given tag.  <a href="#ga0ee9f37ad441f9fcc16865b34f9459a9"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c">hawki_frameset_append</a> (cpl_frameset *self, const cpl_frameset *other)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert all frames of other in self. To be removed after the same functionality exists in CPL.  <a href="#ga8750ba220d588314effce204619b015c"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">hawki_band </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade">hawki_get_band</a> (const char *f)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the band.  <a href="#ga6d85879fd8b8895544f7787e8a6ddade"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd">hawki_get_header_tel_offsets</a> (const cpl_frameset *fset)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the nominal header offsets from a set of frames.  <a href="#ga4c2e0ffe688ffdfd93f0d61c60ac91fd"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a">hawki_get_license</a> (void)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the pipeline copyright and license.  <a href="#gafde011eb3e31e78d4d01cc9c26e2d33a"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46">hawki_get_mean_airmass</a> (cpl_frameset *set)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the mean airmass for a set of frames.  <a href="#ga7b165e9e91b6c6519595109b36d4fb46"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3">hawki_get_version</a> (void)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the version of the pipeline.  <a href="#ga4e8a1eeb0faaa8793bdb37b7450c33e3"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0">hawki_image_inverse_threshold</a> (cpl_image *image_in, double lo_valid, double hi_valid, double assign_in_range, double assign_out_range)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an image with a given value for pixels within a range and another value for pixels outside that range.  <a href="#ga8ad7002b08a8f9dff942f46b3f3456f0"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db">hawki_images_stitch</a> (cpl_image **ima, double *x, double *y)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply the stitching.  <a href="#ga7f6d3694df0e3a441b20267a1e5894db"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566">hawki_print_banner</a> (void)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Issue a banner with the pipeline version.  <a href="#gadfbb9f93a998ca86bbe90dbf808e5566"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4">hawki_std_band_name</a> (hawki_band band)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a band name.  <a href="#ga49b3f45aa7c812c0a90faf073998dbc4"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7">hawki_utils_check_equal_double_keys</a> (cpl_frameset *frames, double(*func)(const cpl_propertylist *))</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check that all the frames share the same value of a given keyword.  <a href="#ga4c041169d43f161a8c9d7f23d7fc57a7"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663">hawki_utils_check_equal_int_keys</a> (cpl_frameset *frames, int(*func)(const cpl_propertylist *))</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check that all the frames share the same value of a given keyword.  <a href="#ga8c1508e389b7fd0da8fbda451ffd1663"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6">hawki_utils_dec2str</a> (char *str, int length_str, double dec)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>)  <a href="#ga38bbbd4f8537d1cab5cfba056bd8edf6"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3">hawki_utils_ra2str</a> (char *str, int length_str, double ra)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>)  <a href="#gaa6f925bb6e5320dcd0f06ad5238813b3"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04">hawki_vector_get_max_select</a> (const cpl_vector *self, const cpl_vector *valid)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the maximum value of a vector according to an array of flags.  <a href="#gaba8fca8aa585fed96efc75545bfc6b04"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846">hawki_vector_get_min_select</a> (const cpl_vector *self, const cpl_vector *valid)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the minimum value of a vector according to an array of flags.  <a href="#ga29ae7b4052fd284d8b01f33e127c2846"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886">hawki_vector_get_mode</a> (cpl_vector *vec)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute the histogram mode.  <a href="#gac64c154f22c4d25e242833fbe75da886"></a><br/></td></tr>
+<tr class="memitem:gaa24cf39f777ab8389419b3d18a8bec96"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96">hawki_apply_harmonization</a> (cpl_imagelist *in, double h1, double h2, double h3, double h4)</td></tr>
+<tr class="memdesc:gaa24cf39f777ab8389419b3d18a8bec96"><td class="mdescLeft"> </td><td class="mdescRight">Apply the harmonization.  <a href="#gaa24cf39f777ab8389419b3d18a8bec96">More...</a><br/></td></tr>
+<tr class="separator:gaa24cf39f777ab8389419b3d18a8bec96"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga292d87e3996e9bb4331980a41d8b45bb"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb">hawki_compute_darkbpm</a> (const cpl_image *in, double sigma)</td></tr>
+<tr class="memdesc:ga292d87e3996e9bb4331980a41d8b45bb"><td class="mdescLeft"> </td><td class="mdescRight">Compute the bpm from the dark (hot pixels)  <a href="#ga292d87e3996e9bb4331980a41d8b45bb">More...</a><br/></td></tr>
+<tr class="separator:ga292d87e3996e9bb4331980a41d8b45bb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5d0deca1786f42488784c23e361d0877"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877">hawki_compute_flatbpm</a> (const cpl_image *in, double sigma, double lowval, double highval)</td></tr>
+<tr class="memdesc:ga5d0deca1786f42488784c23e361d0877"><td class="mdescLeft"> </td><td class="mdescRight">Compute the bpm from the flat (aka cold pixels mask)  <a href="#ga5d0deca1786f42488784c23e361d0877">More...</a><br/></td></tr>
+<tr class="separator:ga5d0deca1786f42488784c23e361d0877"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga367515ebe3345fcd79c2849879633ebf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf">hawki_compute_harmonization</a> (const cpl_imagelist *in, double *h1, double *h2, double *h3, double *h4, double *h)</td></tr>
+<tr class="memdesc:ga367515ebe3345fcd79c2849879633ebf"><td class="mdescLeft"> </td><td class="mdescRight">Compute the harmonization.  <a href="#ga367515ebe3345fcd79c2849879633ebf">More...</a><br/></td></tr>
+<tr class="separator:ga367515ebe3345fcd79c2849879633ebf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga49279015ecc6c4dcc6a00de6ed6109bd"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd">hawki_compute_lsbg</a> (const cpl_image *in)</td></tr>
+<tr class="memdesc:ga49279015ecc6c4dcc6a00de6ed6109bd"><td class="mdescLeft"> </td><td class="mdescRight">Compute the large scale background.  <a href="#ga49279015ecc6c4dcc6a00de6ed6109bd">More...</a><br/></td></tr>
+<tr class="separator:ga49279015ecc6c4dcc6a00de6ed6109bd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga024bd2557115d5d7d3265dbcbb3b1884"><td class="memItemLeft" align="right" valign="top">int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884">hawki_detectors_labelise</a> (const cpl_frameset *in)</td></tr>
+<tr class="memdesc:ga024bd2557115d5d7d3265dbcbb3b1884"><td class="mdescLeft"> </td><td class="mdescRight">Get the frames in which the star is for a given chip.  <a href="#ga024bd2557115d5d7d3265dbcbb3b1884">More...</a><br/></td></tr>
+<tr class="separator:ga024bd2557115d5d7d3265dbcbb3b1884"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabee84f3ed597df9a6ae97f07fc2204a0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0">hawki_detectors_locate_star</a> (const cpl_frameset *in, double star_ra, double star_dec, int *labels)</td></tr>
+<tr class="memdesc:gabee84f3ed597df9a6ae97f07fc2204a0"><td class="mdescLeft"> </td><td class="mdescRight">Get the frames in which the star is for a given chip.  <a href="#gabee84f3ed597df9a6ae97f07fc2204a0">More...</a><br/></td></tr>
+<tr class="separator:gabee84f3ed597df9a6ae97f07fc2204a0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0ee9f37ad441f9fcc16865b34f9459a9"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9">hawki_extract_first_filename</a> (const cpl_frameset *in, const char *tag)</td></tr>
+<tr class="memdesc:ga0ee9f37ad441f9fcc16865b34f9459a9"><td class="mdescLeft"> </td><td class="mdescRight">Extract the filename ffor the first frame of the given tag.  <a href="#ga0ee9f37ad441f9fcc16865b34f9459a9">More...</a><br/></td></tr>
+<tr class="separator:ga0ee9f37ad441f9fcc16865b34f9459a9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8750ba220d588314effce204619b015c"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c">hawki_frameset_append</a> (cpl_frameset *self, const cpl_frameset *other)</td></tr>
+<tr class="memdesc:ga8750ba220d588314effce204619b015c"><td class="mdescLeft"> </td><td class="mdescRight">Insert all frames of other in self. To be removed after the same functionality exists in CPL.  <a href="#ga8750ba220d588314effce204619b015c">More...</a><br/></td></tr>
+<tr class="separator:ga8750ba220d588314effce204619b015c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6d85879fd8b8895544f7787e8a6ddade"><td class="memItemLeft" align="right" valign="top">hawki_band </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade">hawki_get_band</a> (const char *f)</td></tr>
+<tr class="memdesc:ga6d85879fd8b8895544f7787e8a6ddade"><td class="mdescLeft"> </td><td class="mdescRight">Get the band.  <a href="#ga6d85879fd8b8895544f7787e8a6ddade">More...</a><br/></td></tr>
+<tr class="separator:ga6d85879fd8b8895544f7787e8a6ddade"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4c2e0ffe688ffdfd93f0d61c60ac91fd"><td class="memItemLeft" align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd">hawki_get_header_tel_offsets</a> (const cpl_frameset *fset)</td></tr>
+<tr class="memdesc:ga4c2e0ffe688ffdfd93f0d61c60ac91fd"><td class="mdescLeft"> </td><td class="mdescRight">Get the nominal header offsets from a set of frames.  <a href="#ga4c2e0ffe688ffdfd93f0d61c60ac91fd">More...</a><br/></td></tr>
+<tr class="separator:ga4c2e0ffe688ffdfd93f0d61c60ac91fd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafde011eb3e31e78d4d01cc9c26e2d33a"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a">hawki_get_license</a> (void)</td></tr>
+<tr class="memdesc:gafde011eb3e31e78d4d01cc9c26e2d33a"><td class="mdescLeft"> </td><td class="mdescRight">Get the pipeline copyright and license.  <a href="#gafde011eb3e31e78d4d01cc9c26e2d33a">More...</a><br/></td></tr>
+<tr class="separator:gafde011eb3e31e78d4d01cc9c26e2d33a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7b165e9e91b6c6519595109b36d4fb46"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46">hawki_get_mean_airmass</a> (cpl_frameset *set)</td></tr>
+<tr class="memdesc:ga7b165e9e91b6c6519595109b36d4fb46"><td class="mdescLeft"> </td><td class="mdescRight">Get the mean airmass for a set of frames.  <a href="#ga7b165e9e91b6c6519595109b36d4fb46">More...</a><br/></td></tr>
+<tr class="separator:ga7b165e9e91b6c6519595109b36d4fb46"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4e8a1eeb0faaa8793bdb37b7450c33e3"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3">hawki_get_version</a> (void)</td></tr>
+<tr class="memdesc:ga4e8a1eeb0faaa8793bdb37b7450c33e3"><td class="mdescLeft"> </td><td class="mdescRight">Returns the version of the pipeline.  <a href="#ga4e8a1eeb0faaa8793bdb37b7450c33e3">More...</a><br/></td></tr>
+<tr class="separator:ga4e8a1eeb0faaa8793bdb37b7450c33e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8ad7002b08a8f9dff942f46b3f3456f0"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0">hawki_image_inverse_threshold</a> (cpl_image *image_in, double lo_valid, double hi_valid, double assign_in_range, double assign_out_range)</td></tr>
+<tr class="memdesc:ga8ad7002b08a8f9dff942f46b3f3456f0"><td class="mdescLeft"> </td><td class="mdescRight">Create an image with a given value for pixels within a range and another value for pixels outside that range.  <a href="#ga8ad7002b08a8f9dff942f46b3f3456f0">More...</a><br/></td></tr>
+<tr class="separator:ga8ad7002b08a8f9dff942f46b3f3456f0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7f6d3694df0e3a441b20267a1e5894db"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db">hawki_images_stitch</a> (cpl_image **ima, double *x, double *y)</td></tr>
+<tr class="memdesc:ga7f6d3694df0e3a441b20267a1e5894db"><td class="mdescLeft"> </td><td class="mdescRight">Apply the stitching.  <a href="#ga7f6d3694df0e3a441b20267a1e5894db">More...</a><br/></td></tr>
+<tr class="separator:ga7f6d3694df0e3a441b20267a1e5894db"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadfbb9f93a998ca86bbe90dbf808e5566"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566">hawki_print_banner</a> (void)</td></tr>
+<tr class="memdesc:gadfbb9f93a998ca86bbe90dbf808e5566"><td class="mdescLeft"> </td><td class="mdescRight">Issue a banner with the pipeline version.  <a href="#gadfbb9f93a998ca86bbe90dbf808e5566">More...</a><br/></td></tr>
+<tr class="separator:gadfbb9f93a998ca86bbe90dbf808e5566"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga49b3f45aa7c812c0a90faf073998dbc4"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4">hawki_std_band_name</a> (hawki_band band)</td></tr>
+<tr class="memdesc:ga49b3f45aa7c812c0a90faf073998dbc4"><td class="mdescLeft"> </td><td class="mdescRight">Return a band name.  <a href="#ga49b3f45aa7c812c0a90faf073998dbc4">More...</a><br/></td></tr>
+<tr class="separator:ga49b3f45aa7c812c0a90faf073998dbc4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4c041169d43f161a8c9d7f23d7fc57a7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7">hawki_utils_check_equal_double_keys</a> (cpl_frameset *frames, double(*func)(const cpl_propertylist *))</td></tr>
+<tr class="memdesc:ga4c041169d43f161a8c9d7f23d7fc57a7"><td class="mdescLeft"> </td><td class="mdescRight">Check that all the frames share the same value of a given keyword.  <a href="#ga4c041169d43f161a8c9d7f23d7fc57a7">More...</a><br/></td></tr>
+<tr class="separator:ga4c041169d43f161a8c9d7f23d7fc57a7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8c1508e389b7fd0da8fbda451ffd1663"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663">hawki_utils_check_equal_int_keys</a> (cpl_frameset *frames, int(*func)(const cpl_propertylist *))</td></tr>
+<tr class="memdesc:ga8c1508e389b7fd0da8fbda451ffd1663"><td class="mdescLeft"> </td><td class="mdescRight">Check that all the frames share the same value of a given keyword.  <a href="#ga8c1508e389b7fd0da8fbda451ffd1663">More...</a><br/></td></tr>
+<tr class="separator:ga8c1508e389b7fd0da8fbda451ffd1663"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga38bbbd4f8537d1cab5cfba056bd8edf6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6">hawki_utils_dec2str</a> (char *str, int length_str, double dec)</td></tr>
+<tr class="memdesc:ga38bbbd4f8537d1cab5cfba056bd8edf6"><td class="mdescLeft"> </td><td class="mdescRight">This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>)  <a href="#ga38bbbd4f8537d1cab5cfba056bd8edf6">More...</a><br/></td></tr>
+<tr class="separator:ga38bbbd4f8537d1cab5cfba056bd8edf6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa6f925bb6e5320dcd0f06ad5238813b3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3">hawki_utils_ra2str</a> (char *str, int length_str, double ra)</td></tr>
+<tr class="memdesc:gaa6f925bb6e5320dcd0f06ad5238813b3"><td class="mdescLeft"> </td><td class="mdescRight">This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>)  <a href="#gaa6f925bb6e5320dcd0f06ad5238813b3">More...</a><br/></td></tr>
+<tr class="separator:gaa6f925bb6e5320dcd0f06ad5238813b3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaba8fca8aa585fed96efc75545bfc6b04"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04">hawki_vector_get_max_select</a> (const cpl_vector *self, const cpl_vector *valid)</td></tr>
+<tr class="memdesc:gaba8fca8aa585fed96efc75545bfc6b04"><td class="mdescLeft"> </td><td class="mdescRight">Gets the maximum value of a vector according to an array of flags.  <a href="#gaba8fca8aa585fed96efc75545bfc6b04">More...</a><br/></td></tr>
+<tr class="separator:gaba8fca8aa585fed96efc75545bfc6b04"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga29ae7b4052fd284d8b01f33e127c2846"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846">hawki_vector_get_min_select</a> (const cpl_vector *self, const cpl_vector *valid)</td></tr>
+<tr class="memdesc:ga29ae7b4052fd284d8b01f33e127c2846"><td class="mdescLeft"> </td><td class="mdescRight">Gets the minimum value of a vector according to an array of flags.  <a href="#ga29ae7b4052fd284d8b01f33e127c2846">More...</a><br/></td></tr>
+<tr class="separator:ga29ae7b4052fd284d8b01f33e127c2846"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac64c154f22c4d25e242833fbe75da886"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886">hawki_vector_get_mode</a> (cpl_vector *vec)</td></tr>
+<tr class="memdesc:gac64c154f22c4d25e242833fbe75da886"><td class="mdescLeft"> </td><td class="mdescRight">Compute the histogram mode.  <a href="#gac64c154f22c4d25e242833fbe75da886">More...</a><br/></td></tr>
+<tr class="separator:gac64c154f22c4d25e242833fbe75da886"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="gaa24cf39f777ab8389419b3d18a8bec96"></a><!-- doxytag: member="hawki_utils.c::hawki_apply_harmonization" ref="gaa24cf39f777ab8389419b3d18a8bec96" args="(cpl_imagelist *in, double h1, double h2, double h3, double h4)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaa24cf39f777ab8389419b3d18a8bec96"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -132,11 +164,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the harmonization. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input images </td></tr>
     <tr><td class="paramname">h1</td><td>the factor to apply to chip 1 </td></tr>
@@ -146,13 +177,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 otherwise </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 otherwise </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00384">384</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga292d87e3996e9bb4331980a41d8b45bb"></a><!-- doxytag: member="hawki_utils.c::hawki_compute_darkbpm" ref="ga292d87e3996e9bb4331980a41d8b45bb" args="(const cpl_image *in, double sigma)" -->
+<a class="anchor" id="ga292d87e3996e9bb4331980a41d8b45bb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -174,24 +205,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the bpm from the dark (hot pixels) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input image </td></tr>
     <tr><td class="paramname">sigma</td><td>the sigma for the threshold </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The bad pixels map </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The bad pixels map </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00119">119</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga5d0deca1786f42488784c23e361d0877"></a><!-- doxytag: member="hawki_utils.c::hawki_compute_flatbpm" ref="ga5d0deca1786f42488784c23e361d0877" args="(const cpl_image *in, double sigma, double lowval, double highval)" -->
+<a class="anchor" id="ga5d0deca1786f42488784c23e361d0877"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -225,11 +255,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the bpm from the flat (aka cold pixels mask) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input image </td></tr>
     <tr><td class="paramname">sigma</td><td>the sigma for the threshold </td></tr>
@@ -238,7 +267,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The bad pixels map</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The bad pixels map</dd></dl>
 <p>This function creates a mask of pixels below and above a certain limit (lowval, highval) and pixels a certain number of sigmas (sigma) above the background (which is obtained smoothing with a 3x3 kernel the input image). </p>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00164">164</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
@@ -247,7 +276,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga367515ebe3345fcd79c2849879633ebf"></a><!-- doxytag: member="hawki_utils.c::hawki_compute_harmonization" ref="ga367515ebe3345fcd79c2849879633ebf" args="(const cpl_imagelist *in, double *h1, double *h2, double *h3, double *h4, double *h)" -->
+<a class="anchor" id="ga367515ebe3345fcd79c2849879633ebf"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -293,11 +322,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the harmonization. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input images </td></tr>
     <tr><td class="paramname">h1</td><td>the factor to apply to chip 1 </td></tr>
@@ -308,15 +336,18 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>0 if ok, -1 otherwise</dd></dl>
-<p>chip3 | | chip4 ------ ------ ------ ------ chip1 | |chip2</p>
+<dl class="section return"><dt>Returns</dt><dd>0 if ok, -1 otherwise</dd></dl>
+<p>chip3 | | chip4 </p>
+<hr/>
+ <hr/>
+<p> chip1 | |chip2</p>
 <p>the edges averages avgi of all chips i are computed -> h=avg(avgi) hi = h/avgi </p>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00422">422</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga49279015ecc6c4dcc6a00de6ed6109bd"></a><!-- doxytag: member="hawki_utils.c::hawki_compute_lsbg" ref="ga49279015ecc6c4dcc6a00de6ed6109bd" args="(const cpl_image *in)" -->
+<a class="anchor" id="ga49279015ecc6c4dcc6a00de6ed6109bd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -328,23 +359,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the large scale background. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">the</td><td>input image </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The background or NULL in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The background or NULL in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00531">531</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga024bd2557115d5d7d3265dbcbb3b1884"></a><!-- doxytag: member="hawki_utils.c::hawki_detectors_labelise" ref="ga024bd2557115d5d7d3265dbcbb3b1884" args="(const cpl_frameset *in)" -->
+<a class="anchor" id="ga024bd2557115d5d7d3265dbcbb3b1884"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -356,20 +386,21 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the frames in which the star is for a given chip. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input frameset </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The newly allocated frameset</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The newly allocated frameset</dd></dl>
 <p>The signs of the header offsets in x and y are used:</p>
 <ul>
-<li>and - -> chip 1 + and - -> chip 2 + and + -> chip 3</li>
+<li>and - -> chip 1</li>
+<li>and - -> chip 2</li>
+<li>and + -> chip 3</li>
 <li>and + -> chip 4 </li>
 </ul>
 
@@ -379,7 +410,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gabee84f3ed597df9a6ae97f07fc2204a0"></a><!-- doxytag: member="hawki_utils.c::hawki_detectors_locate_star" ref="gabee84f3ed597df9a6ae97f07fc2204a0" args="(const cpl_frameset *in, double star_ra, double star_dec, int *labels)" -->
+<a class="anchor" id="gabee84f3ed597df9a6ae97f07fc2204a0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -413,25 +444,24 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the frames in which the star is for a given chip. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>the input frameset </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The newly allocated frameset </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The newly allocated frameset </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00837">837</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
-<p>References <a class="el" href="hawki__load_8c_source.html#l00846">hawki_get_ext_from_detector()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00299">hawki_pfits_get_naxis1()</a>, and <a class="el" href="hawki__pfits_8c_source.html#l00311">hawki_pfits_get_naxis2()</a>.</p>
+<p>References <a class="el" href="hawki__load_8c_source.html#l00846">hawki_get_ext_from_detector()</a>, <a class="el" href="hawki__pfits_8c_source.html#l00331">hawki_pfits_get_naxis1()</a>, and <a class="el" href="hawki__pfits_8c_source.html#l00343">hawki_pfits_get_naxis2()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga0ee9f37ad441f9fcc16865b34f9459a9"></a><!-- doxytag: member="hawki_utils.c::hawki_extract_first_filename" ref="ga0ee9f37ad441f9fcc16865b34f9459a9" args="(const cpl_frameset *in, const char *tag)" -->
+<a class="anchor" id="ga0ee9f37ad441f9fcc16865b34f9459a9"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -453,24 +483,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Extract the filename ffor the first frame of the given tag. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">in</td><td>A non-empty frameset </td></tr>
     <tr><td class="paramname">tag</td><td>The tag of the requested file </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to the file </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Pointer to the file </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00639">639</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga8750ba220d588314effce204619b015c"></a><!-- doxytag: member="hawki_utils.c::hawki_frameset_append" ref="ga8750ba220d588314effce204619b015c" args="(cpl_frameset *self, const cpl_frameset *other)" -->
+<a class="anchor" id="ga8750ba220d588314effce204619b015c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -492,11 +521,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Insert all frames of other in self. To be removed after the same functionality exists in CPL. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">self</td><td>A frame set. </td></tr>
     <tr><td class="paramname">other</td><td>The frames to insert. </td></tr>
@@ -508,7 +536,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga6d85879fd8b8895544f7787e8a6ddade"></a><!-- doxytag: member="hawki_utils.c::hawki_get_band" ref="ga6d85879fd8b8895544f7787e8a6ddade" args="(const char *f)" -->
+<a class="anchor" id="ga6d85879fd8b8895544f7787e8a6ddade"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -520,23 +548,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the band. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">f</td><td>the filter name from the header </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the band </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the band </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00657">657</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga4c2e0ffe688ffdfd93f0d61c60ac91fd"></a><!-- doxytag: member="hawki_utils.c::hawki_get_header_tel_offsets" ref="ga4c2e0ffe688ffdfd93f0d61c60ac91fd" args="(const cpl_frameset *fset)" -->
+<a class="anchor" id="ga4c2e0ffe688ffdfd93f0d61c60ac91fd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -548,28 +575,27 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the nominal header offsets from a set of frames. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">fset</td><td>the set of frames </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The offsets in a bivector or NULL in error case</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The offsets in a bivector or NULL in error case</dd></dl>
 <p>The offsets returned are the telescope offsets, a mirror transformation must be performed to use them in as the image offsets, which is the cpl convention. </p>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00695">695</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
-<p>References <a class="el" href="hawki__pfits_8c_source.html#l00419">hawki_pfits_get_cumoffsetx()</a>, and <a class="el" href="hawki__pfits_8c_source.html#l00431">hawki_pfits_get_cumoffsety()</a>.</p>
+<p>References <a class="el" href="hawki__pfits_8c_source.html#l00451">hawki_pfits_get_cumoffsetx()</a>, and <a class="el" href="hawki__pfits_8c_source.html#l00463">hawki_pfits_get_cumoffsety()</a>.</p>
 
 <p>Referenced by <a class="el" href="hawki__utils_8c_source.html#l00782">hawki_detectors_labelise()</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gafde011eb3e31e78d4d01cc9c26e2d33a"></a><!-- doxytag: member="hawki_utils.c::hawki_get_license" ref="gafde011eb3e31e78d4d01cc9c26e2d33a" args="(void)" -->
+<a class="anchor" id="gafde011eb3e31e78d4d01cc9c26e2d33a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -581,18 +607,17 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the pipeline copyright and license. </p>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The copyright and license string</dd></dl>
+<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="hawki__utils_8c_source.html#l00065">65</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga7b165e9e91b6c6519595109b36d4fb46"></a><!-- doxytag: member="hawki_utils.c::hawki_get_mean_airmass" ref="ga7b165e9e91b6c6519595109b36d4fb46" args="(cpl_frameset *set)" -->
+<a class="anchor" id="ga7b165e9e91b6c6519595109b36d4fb46"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -604,17 +629,16 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Get the mean airmass for a set of frames. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">set</td><td>the input frame set </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The mean airmass of all the input frames. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The mean airmass of all the input frames. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00740">740</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
@@ -622,7 +646,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga4e8a1eeb0faaa8793bdb37b7450c33e3"></a><!-- doxytag: member="hawki_utils.c::hawki_get_version" ref="ga4e8a1eeb0faaa8793bdb37b7450c33e3" args="(void)" -->
+<a class="anchor" id="ga4e8a1eeb0faaa8793bdb37b7450c33e3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -634,8 +658,7 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Returns the version of the pipeline. </p>
 
@@ -645,7 +668,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga8ad7002b08a8f9dff942f46b3f3456f0"></a><!-- doxytag: member="hawki_utils.c::hawki_image_inverse_threshold" ref="ga8ad7002b08a8f9dff942f46b3f3456f0" args="(cpl_image *image_in, double lo_valid, double hi_valid, double assign_in_range, double assign_out_range)" -->
+<a class="anchor" id="ga8ad7002b08a8f9dff942f46b3f3456f0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -685,11 +708,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Create an image with a given value for pixels within a range and another value for pixels outside that range. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image_in</td><td>Image to threshold. </td></tr>
     <tr><td class="paramname">lo_valid</td><td>Lower bound of the valid range </td></tr>
@@ -699,7 +721,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the #_cpl_error_code_ or CPL_ERROR_NONE</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the #_cpl_error_code_ or CPL_ERROR_NONE</dd></dl>
 <p>Images can be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. lo_cut must be smaller than or equal to hi_cut.</p>
 <p>Possible #_cpl_error_code_ set in this function:</p>
 <ul>
@@ -714,7 +736,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga7f6d3694df0e3a441b20267a1e5894db"></a><!-- doxytag: member="hawki_utils.c::hawki_images_stitch" ref="ga7f6d3694df0e3a441b20267a1e5894db" args="(cpl_image **ima, double *x, double *y)" -->
+<a class="anchor" id="ga7f6d3694df0e3a441b20267a1e5894db"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -742,11 +764,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Apply the stitching. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">ima</td><td>The HAWKI_NB_DETECTORS input images </td></tr>
     <tr><td class="paramname">x</td><td>The HAWKI_NB_DETECTORS x positions </td></tr>
@@ -754,13 +775,13 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The stitched image or NULL in error case. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The stitched image or NULL in error case. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00305">305</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gadfbb9f93a998ca86bbe90dbf808e5566"></a><!-- doxytag: member="hawki_utils.c::hawki_print_banner" ref="gadfbb9f93a998ca86bbe90dbf808e5566" args="(void)" -->
+<a class="anchor" id="gadfbb9f93a998ca86bbe90dbf808e5566"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -772,8 +793,7 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Issue a banner with the pipeline version. </p>
 
@@ -783,7 +803,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga49b3f45aa7c812c0a90faf073998dbc4"></a><!-- doxytag: member="hawki_utils.c::hawki_std_band_name" ref="ga49b3f45aa7c812c0a90faf073998dbc4" args="(hawki_band band)" -->
+<a class="anchor" id="ga49b3f45aa7c812c0a90faf073998dbc4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -795,23 +815,22 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Return a band name. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">band</td><td>a BB </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>1 pointer to a static band name. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 pointer to a static band name. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00674">674</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga4c041169d43f161a8c9d7f23d7fc57a7"></a><!-- doxytag: member="hawki_utils.c::hawki_utils_check_equal_double_keys" ref="ga4c041169d43f161a8c9d7f23d7fc57a7" args="(cpl_frameset *frames, double(*func)(const cpl_propertylist *))" -->
+<a class="anchor" id="ga4c041169d43f161a8c9d7f23d7fc57a7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -833,24 +852,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Check that all the frames share the same value of a given keyword. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frames</td><td>the framset </td></tr>
     <tr><td class="paramname">func</td><td>the function which returns the value of the kwd, given the propertylist </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>1 if all the frames have the same values. 0 elsewhere. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 if all the frames have the same values. 0 elsewhere. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l01052">1052</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga8c1508e389b7fd0da8fbda451ffd1663"></a><!-- doxytag: member="hawki_utils.c::hawki_utils_check_equal_int_keys" ref="ga8c1508e389b7fd0da8fbda451ffd1663" args="(cpl_frameset *frames, int(*func)(const cpl_propertylist *))" -->
+<a class="anchor" id="ga8c1508e389b7fd0da8fbda451ffd1663"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -872,24 +890,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Check that all the frames share the same value of a given keyword. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">frames</td><td>the framset </td></tr>
     <tr><td class="paramname">func</td><td>the function which returns the value of the kwd, given the propertylist </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>1 if all the frames have the same values. 0 elsewhere. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 if all the frames have the same values. 0 elsewhere. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l01089">1089</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga38bbbd4f8537d1cab5cfba056bd8edf6"></a><!-- doxytag: member="hawki_utils.c::hawki_utils_dec2str" ref="ga38bbbd4f8537d1cab5cfba056bd8edf6" args="(char *str, int length_str, double dec)" -->
+<a class="anchor" id="ga38bbbd4f8537d1cab5cfba056bd8edf6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -917,11 +934,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">str</td><td>The string to write to </td></tr>
     <tr><td class="paramname">length_str</td><td>The maximum lenght to write </td></tr>
@@ -934,7 +950,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaa6f925bb6e5320dcd0f06ad5238813b3"></a><!-- doxytag: member="hawki_utils.c::hawki_utils_ra2str" ref="gaa6f925bb6e5320dcd0f06ad5238813b3" args="(char *str, int length_str, double ra)" -->
+<a class="anchor" id="gaa6f925bb6e5320dcd0f06ad5238813b3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -962,11 +978,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (<a href="http://tdc-www.harvard.edu/wcstools/">http://tdc-www.harvard.edu/wcstools/</a>) </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">str</td><td>The string to write to </td></tr>
     <tr><td class="paramname">length_str</td><td>The maximum lenght to write </td></tr>
@@ -979,7 +994,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="gaba8fca8aa585fed96efc75545bfc6b04"></a><!-- doxytag: member="hawki_utils.c::hawki_vector_get_max_select" ref="gaba8fca8aa585fed96efc75545bfc6b04" args="(const cpl_vector *self, const cpl_vector *valid)" -->
+<a class="anchor" id="gaba8fca8aa585fed96efc75545bfc6b04"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1001,24 +1016,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Gets the maximum value of a vector according to an array of flags. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">self</td><td>The input vector with the values </td></tr>
     <tr><td class="paramname">valid</td><td>Vector of flags (>=-0.5: valid, <-0.5: invalid) </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The minimum value. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The minimum value. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00918">918</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="ga29ae7b4052fd284d8b01f33e127c2846"></a><!-- doxytag: member="hawki_utils.c::hawki_vector_get_min_select" ref="ga29ae7b4052fd284d8b01f33e127c2846" args="(const cpl_vector *self, const cpl_vector *valid)" -->
+<a class="anchor" id="ga29ae7b4052fd284d8b01f33e127c2846"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1040,24 +1054,23 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Gets the minimum value of a vector according to an array of flags. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">self</td><td>The input vector with the values </td></tr>
     <tr><td class="paramname">valid</td><td>Vector of flags (>=-0.5: valid, <-0.5: invalid) </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The minimum value. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The minimum value. </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00952">952</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-<a class="anchor" id="gac64c154f22c4d25e242833fbe75da886"></a><!-- doxytag: member="hawki_utils.c::hawki_vector_get_mode" ref="gac64c154f22c4d25e242833fbe75da886" args="(cpl_vector *vec)" -->
+<a class="anchor" id="gac64c154f22c4d25e242833fbe75da886"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -1069,25 +1082,27 @@ Functions</h2></td></tr>
           <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Compute the histogram mode. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">vec</td><td>the vector </td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>the mode or -1 in error case </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the mode or -1 in error case </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__utils_8c_source.html#l00983">983</a> of file <a class="el" href="hawki__utils_8c_source.html">hawki_utils.c</a>.</p>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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__hawki__variance.html b/html/group__hawki__variance.html
index 60041cd..a53ec4c 100644
--- a/html/group__hawki__variance.html
+++ b/html/group__hawki__variance.html
@@ -2,51 +2,60 @@
 <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>HAWKI Pipeline Reference Manual: Variance estimation for raw images.</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="summary">
 <a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">Variance estimation for raw images.</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
 <table class="memberdecls">
-<tr><td colspan="2"><h2><a name="func-members"></a>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
 Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc">hawki_image_create_variance</a> (const cpl_image *image, double gain, double ron, int ndit, int ndsamples)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create the associated variance of a raw image.  <a href="#ga0de4bc882b19eb5d32599f6ec2c3eecc"></a><br/></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818">hawki_imglist_create_variances_and_delete</a> (cpl_imagelist *imagelist_raw, double gain, double ron, int ndit, int ndsamples)</td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create the associated variance of raw imagelist.  <a href="#ga3077d7b2029de0416fabed98bc092818"></a><br/></td></tr>
+<tr class="memitem:ga0de4bc882b19eb5d32599f6ec2c3eecc"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc">hawki_image_create_variance</a> (const cpl_image *image, double gain, double ron, int ndit, int ndsamples)</td></tr>
+<tr class="memdesc:ga0de4bc882b19eb5d32599f6ec2c3eecc"><td class="mdescLeft"> </td><td class="mdescRight">Create the associated variance of a raw image.  <a href="#ga0de4bc882b19eb5d32599f6ec2c3eecc">More...</a><br/></td></tr>
+<tr class="separator:ga0de4bc882b19eb5d32599f6ec2c3eecc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3077d7b2029de0416fabed98bc092818"><td class="memItemLeft" align="right" valign="top">cpl_imagelist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818">hawki_imglist_create_variances_and_delete</a> (cpl_imagelist *imagelist_raw, double gain, double ron, int ndit, int ndsamples)</td></tr>
+<tr class="memdesc:ga3077d7b2029de0416fabed98bc092818"><td class="mdescLeft"> </td><td class="mdescRight">Create the associated variance of raw imagelist.  <a href="#ga3077d7b2029de0416fabed98bc092818">More...</a><br/></td></tr>
+<tr class="separator:ga3077d7b2029de0416fabed98bc092818"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr/><h2>Function Documentation</h2>
-<a class="anchor" id="ga0de4bc882b19eb5d32599f6ec2c3eecc"></a><!-- doxytag: member="hawki_variance.c::hawki_image_create_variance" ref="ga0de4bc882b19eb5d32599f6ec2c3eecc" args="(const cpl_image *image, double gain, double ron, int ndit, int ndsamples)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga0de4bc882b19eb5d32599f6ec2c3eecc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -86,11 +95,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Create the associated variance of a raw image. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">image</td><td>the raw image </td></tr>
     <tr><td class="paramname">gain</td><td>the gain of the detector (e-/ADU) </td></tr>
@@ -100,7 +108,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The variance image if suceed. NULL elsewhere.</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The variance image if suceed. NULL elsewhere.</dd></dl>
 <p>The variance is computed with the following equation: </p>
 <p class="formulaDsp">
 <img class="formulaDsp" alt="\[ \sigma^{2}(i,j) = \frac{6 S(i,j)}{5 g n_{nds} n_{dit}} (\frac{n_{nds}^{2} + 1}{n_{nds} + 1}) + \frac{12 RON^{2}(i,j)}{g^{2} n_{nds} n_{dit}} (\frac{n_{nds}-1}{n_{nds}+1})\]" src="form_1.png"/>
@@ -113,7 +121,7 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-<a class="anchor" id="ga3077d7b2029de0416fabed98bc092818"></a><!-- doxytag: member="hawki_variance.c::hawki_imglist_create_variances_and_delete" ref="ga3077d7b2029de0416fabed98bc092818" args="(cpl_imagelist *imagelist_raw, double gain, double ron, int ndit, int ndsamples)" -->
+<a class="anchor" id="ga3077d7b2029de0416fabed98bc092818"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
@@ -153,11 +161,10 @@ Functions</h2></td></tr>
           <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
 <p>Create the associated variance of raw imagelist. </p>
-<dl><dt><b>Parameters:</b></dt><dd>
+<dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">imagelist_raw</td><td>the raw imagelist </td></tr>
     <tr><td class="paramname">gain</td><td>the gain of the detector (e-/ADU) </td></tr>
@@ -167,7 +174,7 @@ Functions</h2></td></tr>
   </table>
   </dd>
 </dl>
-<dl class="return"><dt><b>Returns:</b></dt><dd>The variance imagelist if suceed. NULL elsewhere.</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The variance imagelist if suceed. NULL elsewhere.</dd></dl>
 <p>The original imagelist_raw is empty after the process. This is so in order not to duplicate the amount of memory needed. However it will still have to be deleted with cpl_imagelist_delete. Also the returned pointer have to be deleted with cpl_imagelist_delete, of course.</p>
 <p>The variance is computed with the following equation: </p>
 <p class="formulaDsp">
@@ -181,9 +188,12 @@ Functions</h2></td></tr>
 
 </div>
 </div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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/hawki__alloc_8c_source.html b/html/hawki__alloc_8c_source.html
index 2de775a..29847df 100644
--- a/html/hawki__alloc_8c_source.html
+++ b/html/hawki__alloc_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_alloc.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,89 +40,90 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_alloc.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_alloc.c,v 1.1 2008/11/26 09:53:31 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/11/26 09:53:31 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 "hawki_utils.h"</span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include "hawki_alloc.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="l00054"></a><a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd">00054</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(cpl_table ** table)
-<a name="l00055"></a>00055 {
-<a name="l00056"></a>00056     <span class="keywordtype">int</span> idet;
-<a name="l00057"></a>00057     
-<a name="l00058"></a>00058     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00059"></a>00059         cpl_table_delete(table[idet]);
-<a name="l00060"></a>00060     cpl_free(table);
-<a name="l00061"></a>00061     <span class="keywordflow">if</span>(cpl_errorstate_get() != CPL_ERROR_NONE)
-<a name="l00062"></a>00062         <span class="keywordflow">return</span> -1;
-<a name="l00063"></a>00063     <span class="keywordflow">return</span> 0;
-<a name="l00064"></a>00064 }
-<a name="l00065"></a>00065 
-<a name="l00072"></a><a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080">00072</a> cpl_table ** <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(<span class="keywordtype">int</span> nrow)
-<a name="l00073"></a>00073 {
-<a name="l00074"></a>00074     <span class="keywordtype">int</span> idet;
-<a name="l00075"></a>00075     cpl_table ** tables;
-<a name="l00076"></a>00076     
-<a name="l00077"></a>00077     tables = cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * HAWKI_NB_DETECTORS);
-<a name="l00078"></a>00078     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00079"></a>00079         tables[idet] = cpl_table_new(nrow);
-<a name="l00080"></a>00080     
-<a name="l00081"></a>00081     <span class="keywordflow">if</span>(cpl_errorstate_get() != CPL_ERROR_NONE)
-<a name="l00082"></a>00082         <span class="keywordflow">return</span> NULL;
-<a name="l00083"></a>00083     <span class="keywordflow">return</span> tables;    
-<a name="l00084"></a>00084 }
-<a name="l00085"></a>00085 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_alloc.c,v 1.1 2008/11/26 09:53: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008/11/26 09:53:31 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include "hawki_alloc.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="l00054"></a><span class="lineno"><a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd">   54</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(cpl_table ** table)</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">int</span> idet;</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="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>         cpl_table_delete(table[idet]);</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     cpl_free(table);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keywordflow">if</span>(cpl_errorstate_get() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordflow">return</span> 0;</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="l00072"></a><span class="lineno"><a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080">   72</a></span> cpl_table ** <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(<span class="keywordtype">int</span> nrow)</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="keywordtype">int</span> idet;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     cpl_table ** tables;</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>     tables = cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * HAWKI_NB_DETECTORS);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         tables[idet] = cpl_table_new(nrow);</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="keywordflow">if</span>(cpl_errorstate_get() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keywordflow">return</span> tables;    </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/hawki__alloc_8h_source.html b/html/hawki__alloc_8h_source.html
index 53e8728..4513b2c 100644
--- a/html/hawki__alloc_8h_source.html
+++ b/html/hawki__alloc_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_alloc.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,61 +40,62 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_alloc.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_alloc.h,v 1.1 2008/11/26 09:53: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/11/26 09:53:21 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_ALLOC_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_ALLOC_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 
-<a name="l00032"></a>00032 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Functions prototypes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="keywordtype">int</span> <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(cpl_table **);
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 cpl_table ** <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(<span class="keywordtype">int</span> nrow);
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_alloc.h,v 1.1 2008/11/26 09:53: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008/11/26 09:53:21 $</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: hawki-1_8_12 $</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 HAWKI_ALLOC_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_ALLOC_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> </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> <span class="comment">                                Functions prototypes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(cpl_table **);</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_table ** <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(<span class="keywordtype">int</span> nrow);</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">#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/hawki__bkg_8h_source.html b/html/hawki__bkg_8h_source.html
index bdc4d71..6e89b48 100644
--- a/html/hawki__bkg_8h_source.html
+++ b/html/hawki__bkg_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_bkg.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,121 +40,122 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_bkg.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_bkg.h,v 1.11 2012/12/10 12:31: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/10 12:31:33 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_BKG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_BKG_H</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="keyword">typedef</span> <span class="keyword">struct </span>_hawki_bkg_frames_buffer_ hawki_bkg_frames_buffer;
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keyword">struct </span>_hawki_bkg_frames_buffer_
-<a name="l00040"></a>00040 {
-<a name="l00041"></a>00041     cpl_image   ** images;
-<a name="l00042"></a>00042     <span class="keywordtype">double</span>      * medians;
-<a name="l00043"></a>00043     cpl_frameset * frames;
-<a name="l00044"></a>00044     cpl_size       nframes;
-<a name="l00045"></a>00045 };
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 CPL_BEGIN_DECLS
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 hawki_bkg_frames_buffer * hawki_bkg_frames_buffer_init
-<a name="l00050"></a>00050 (<span class="keyword">const</span> cpl_frameset * fset);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keywordtype">void</span> hawki_bkg_frames_buffer_delete(hawki_bkg_frames_buffer * frames_buffer);
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="keywordtype">int</span> hawki_bkg_fill_assoc(cpl_frameset * objframes, cpl_propertylist * proplist);
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="keywordtype">int</span> hawki_bkg_from_objects_median
-<a name="l00057"></a>00057 (<span class="keyword">const</span> cpl_frameset  *  objframes, cpl_imagelist * bkg);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keywordtype">int</span> hawki_bkg_from_sky_median
-<a name="l00060"></a>00060 (<span class="keyword">const</span> cpl_frameset     *  skyframes, 
-<a name="l00061"></a>00061  cpl_imagelist    *  bkg);
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 <span class="keywordtype">int</span> hawki_bkg_from_running_mean
-<a name="l00064"></a>00064 (cpl_imagelist       * objimages,
-<a name="l00065"></a>00065  <span class="keyword">const</span> cpl_vector    * medians,
-<a name="l00066"></a>00066  <span class="keywordtype">int</span>                   i_target,
-<a name="l00067"></a>00067  <span class="keywordtype">int</span>                   half_width,
-<a name="l00068"></a>00068  <span class="keywordtype">int</span>                   rejlow,
-<a name="l00069"></a>00069  <span class="keywordtype">int</span>                   rejhigh,
-<a name="l00070"></a>00070  cpl_image           * bkg);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keywordtype">int</span> hawki_bkg_from_running_mean_frame_extension
-<a name="l00073"></a>00073 (hawki_bkg_frames_buffer * frames_buffer,
-<a name="l00074"></a>00074  cpl_vector              * offsets_x,
-<a name="l00075"></a>00075  cpl_vector              * offsets_y,
-<a name="l00076"></a>00076  cpl_image               * globalmask,
-<a name="l00077"></a>00077  <span class="keywordtype">double</span>                    mask_off_x,
-<a name="l00078"></a>00078  <span class="keywordtype">double</span>                    mask_off_y,
-<a name="l00079"></a>00079  cpl_image               * distortion_x,
-<a name="l00080"></a>00080  cpl_image               * distortion_y,
-<a name="l00081"></a>00081  <span class="keywordtype">int</span>                       iextension,
-<a name="l00082"></a>00082  <span class="keywordtype">int</span>                       i_target,
-<a name="l00083"></a>00083  <span class="keywordtype">int</span>                       half_width,
-<a name="l00084"></a>00084  <span class="keywordtype">int</span>                       rejlow,
-<a name="l00085"></a>00085  <span class="keywordtype">int</span>                       rejhigh,
-<a name="l00086"></a>00086  cpl_image               * bkg);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keywordtype">int</span> hawki_bkg_set_obj_mask
-<a name="l00089"></a>00089 (cpl_image  * target_image,
-<a name="l00090"></a>00090  cpl_image  * globalmask,
-<a name="l00091"></a>00091  cpl_image  * distor_x,
-<a name="l00092"></a>00092  cpl_image  * distor_y,
-<a name="l00093"></a>00093  <span class="keywordtype">double</span>       target_off_x,
-<a name="l00094"></a>00094  <span class="keywordtype">double</span>       target_off_y,
-<a name="l00095"></a>00095  <span class="keywordtype">double</span>       mask_off_x,
-<a name="l00096"></a>00096  <span class="keywordtype">double</span>       mask_off_y);
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 CPL_END_DECLS
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_bkg.h,v 1.11 2012/12/10 12:31: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/10 12:31:33 $</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: hawki-1_8_12 $</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 HAWKI_BKG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_BKG_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="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="keyword">typedef</span> <span class="keyword">struct </span>_hawki_bkg_frames_buffer_ hawki_bkg_frames_buffer;</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">struct </span>_hawki_bkg_frames_buffer_</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_image   ** images;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     <span class="keywordtype">double</span>      * medians;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     cpl_frameset * frames;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     cpl_size       nframes;</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> CPL_BEGIN_DECLS</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> hawki_bkg_frames_buffer * hawki_bkg_frames_buffer_init</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> (<span class="keyword">const</span> cpl_frameset * fset);</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">void</span> hawki_bkg_frames_buffer_delete(hawki_bkg_frames_buffer * frames_buffer);</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> hawki_bkg_fill_assoc(cpl_frameset * objframes, cpl_propertylist * proplist);</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">int</span> hawki_bkg_from_objects_median</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> (<span class="keyword">const</span> cpl_frameset  *  objframes, cpl_imagelist * bkg);</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">int</span> hawki_bkg_from_sky_median</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> (<span class="keyword">const</span> cpl_frameset     *  skyframes, </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  cpl_imagelist    *  bkg);</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="keywordtype">int</span> hawki_bkg_from_running_mean</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> (cpl_imagelist       * objimages,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  <span class="keyword">const</span> cpl_vector    * medians,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  <span class="keywordtype">int</span>                   i_target,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  <span class="keywordtype">int</span>                   half_width,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="keywordtype">int</span>                   rejlow,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keywordtype">int</span>                   rejhigh,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_image           * bkg);</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> hawki_bkg_from_running_mean_frame_extension</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> (hawki_bkg_frames_buffer * frames_buffer,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_vector              * offsets_x,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_vector              * offsets_y,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_image               * globalmask,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="keywordtype">double</span>                    mask_off_x,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  <span class="keywordtype">double</span>                    mask_off_y,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  cpl_image               * distortion_x,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  cpl_image               * distortion_y,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  <span class="keywordtype">int</span>                       iextension,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  <span class="keywordtype">int</span>                       i_target,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keywordtype">int</span>                       half_width,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  <span class="keywordtype">int</span>                       rejlow,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  <span class="keywordtype">int</span>                       rejhigh,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>  cpl_image               * bkg);</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">int</span> hawki_bkg_set_obj_mask</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> (cpl_image  * target_image,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  cpl_image  * globalmask,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  cpl_image  * distor_x,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  cpl_image  * distor_y,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  <span class="keywordtype">double</span>       target_off_x,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>  <span class="keywordtype">double</span>       target_off_y,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>  <span class="keywordtype">double</span>       mask_off_x,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  <span class="keywordtype">double</span>       mask_off_y);</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_END_DECLS</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="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/hawki__cal__dark_8c_source.html b/html/hawki__cal__dark_8c_source.html
index 5282a8e..f77964e 100644
--- a/html/hawki__cal__dark_8c_source.html
+++ b/html/hawki__cal__dark_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_dark.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,859 +40,860 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_dark.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_dark.c,v 1.21 2011/02/16 16:33: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/02/16 16:33:21 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.21 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_variance.h"</span>
-<a name="l00048"></a>00048 
-<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> <span class="keywordtype">int</span> hawki_cal_dark_create(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_exec(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_destroy(cpl_plugin *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 <span class="keywordtype">void</span> hawki_cal_dark_initialise_qc(<span class="keywordtype">void</span>);
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_retrieve_input_param
-<a name="l00060"></a>00060 (cpl_parameterlist * parlist);
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">double</span> hawki_cal_dark_ron(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, <span class="keywordtype">int</span>) ;
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_save
-<a name="l00063"></a>00063 (<span class="keyword">const</span> cpl_imagelist *   dark,
-<a name="l00064"></a>00064  <span class="keyword">const</span> cpl_imagelist *   master_dark_err,
-<a name="l00065"></a>00065  <span class="keyword">const</span> cpl_imagelist *   bpmdark,
-<a name="l00066"></a>00066  cpl_table           **  raw_dark_stats,
-<a name="l00067"></a>00067  <span class="keyword">const</span> cpl_vector    **  rons,
-<a name="l00068"></a>00068  <span class="keyword">const</span> cpl_frameset  *   used_frames,
-<a name="l00069"></a>00069  cpl_parameterlist   *   parlist,
-<a name="l00070"></a>00070  cpl_frameset        *   <span class="keyword">set</span>);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00073"></a>00073 <span class="comment">                            Static variables</span>
-<a name="l00074"></a>00074 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00077"></a>00077     <span class="comment">/* Inputs */</span>
-<a name="l00078"></a>00078     <span class="keywordtype">int</span>         hsize ;
-<a name="l00079"></a>00079     <span class="keywordtype">int</span>         nsamples ;
-<a name="l00080"></a>00080     <span class="keywordtype">double</span>      sigma ;
-<a name="l00081"></a>00081     <span class="keywordtype">int</span>         llx ;
-<a name="l00082"></a>00082     <span class="keywordtype">int</span>         lly ;
-<a name="l00083"></a>00083     <span class="keywordtype">int</span>         urx ;
-<a name="l00084"></a>00084     <span class="keywordtype">int</span>         ury ;
-<a name="l00085"></a>00085     <span class="keywordtype">double</span>      gain;
-<a name="l00086"></a>00086     <span class="keywordtype">double</span>      ron;
-<a name="l00087"></a>00087     <span class="keywordtype">int</span>         error_tracking;
-<a name="l00088"></a>00088 } hawki_cal_dark_config ;
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00091"></a>00091     <span class="comment">/* Outputs */</span>
-<a name="l00092"></a>00092     <span class="keywordtype">int</span>         nb_badpix[HAWKI_NB_DETECTORS] ;
-<a name="l00093"></a>00093     <span class="keywordtype">double</span>      master_dark_mean[HAWKI_NB_DETECTORS] ;
-<a name="l00094"></a>00094     <span class="keywordtype">double</span>      master_dark_med[HAWKI_NB_DETECTORS] ;
-<a name="l00095"></a>00095     <span class="keywordtype">double</span>      master_dark_stdev[HAWKI_NB_DETECTORS] ;
-<a name="l00096"></a>00096     <span class="keywordtype">double</span>      master_dark_error_mean[HAWKI_NB_DETECTORS] ;
-<a name="l00097"></a>00097     <span class="keywordtype">double</span>      master_dark_error_med[HAWKI_NB_DETECTORS] ;
-<a name="l00098"></a>00098     <span class="keywordtype">double</span>      master_dark_error_stdev[HAWKI_NB_DETECTORS] ;
-<a name="l00099"></a>00099     <span class="keywordtype">double</span>      vc_mean[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;
-<a name="l00100"></a>00100     <span class="keywordtype">double</span>      vc_med[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;
-<a name="l00101"></a>00101     <span class="keywordtype">double</span>      vc_stdev[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;
-<a name="l00102"></a>00102     <span class="keywordtype">double</span>      dit;
-<a name="l00103"></a>00103     <span class="keywordtype">int</span>         ndit;
-<a name="l00104"></a>00104     <span class="keywordtype">int</span>         ndsamples;
-<a name="l00105"></a>00105 } hawki_cal_dark_outputs;
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_dark_description[] =
-<a name="l00108"></a>00108 <span class="stringliteral">"hawki_cal_dark -- Dark recipe\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_DARK_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00111"></a>00111 <span class="stringliteral">"raw-file.fits "</span>HAWKI_TEC_FLAT_RAW<span class="stringliteral">".\n"</span>
-<a name="l00112"></a>00112 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00113"></a>00113 <span class="stringliteral">"hawki_cal_dark.fits ("</span>HAWKI_CALPRO_DARK<span class="stringliteral">"): The master dark\n"</span>
-<a name="l00114"></a>00114 <span class="stringliteral">"hawki_cal_dark_bpmdark.fits("</span>HAWKI_CALPRO_BPM_HOT<span class="stringliteral">"): The bad pixel mask associated to the dark\n"</span>
-<a name="l00115"></a>00115 <span class="stringliteral">"hawki_cal_dark_stats.fits("</span>HAWKI_CALPRO_DARK_STATS<span class="stringliteral">"): Statistics of the raw darks\n"</span>
-<a name="l00116"></a>00116 <span class="stringliteral">"Optionally it also creates:\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"hawki_cal_dark_err.fits("</span>HAWKI_CALPRO_DARK_ERR<span class="stringliteral">"): The error in the master dark\n"</span>
-<a name="l00118"></a>00118 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00119"></a>00119 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00120"></a>00120 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00123"></a>00123 <span class="comment">                                Functions code</span>
-<a name="l00124"></a>00124 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00144"></a>00144                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00145"></a>00145                     <span class="stringliteral">"hawki_cal_dark"</span>,
-<a name="l00146"></a>00146                     <span class="stringliteral">"Dark recipe"</span>,
-<a name="l00147"></a>00147                     hawki_cal_dark_description,
-<a name="l00148"></a>00148                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00149"></a>00149                     PACKAGE_BUGREPORT,
-<a name="l00150"></a>00150                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00151"></a>00151                     hawki_cal_dark_create,
-<a name="l00152"></a>00152                     hawki_cal_dark_exec,
-<a name="l00153"></a>00153                     hawki_cal_dark_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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00168"></a>00168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00169"></a>00169 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_create(cpl_plugin * plugin)
-<a name="l00170"></a>00170 {
-<a name="l00171"></a>00171     cpl_recipe      *   recipe ;
-<a name="l00172"></a>00172     cpl_parameter   *   p ;
-<a name="l00173"></a>00173         
-<a name="l00174"></a>00174     <span class="comment">/* Check that the plugin is part of a valid recipe */</span>
-<a name="l00175"></a>00175     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00176"></a>00176         recipe = (cpl_recipe *)plugin ;
-<a name="l00177"></a>00177     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00180"></a>00180     recipe->parameters = cpl_parameterlist_new() ; 
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00183"></a>00183     <span class="comment">/* --sigma */</span>
-<a name="l00184"></a>00184     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.sigma"</span>,
-<a name="l00185"></a>00185             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for hot bad pixels detection"</span>,
-<a name="l00186"></a>00186             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 10.0) ;
-<a name="l00187"></a>00187     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma"</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     <span class="comment">/* --nsamples */</span>
-<a name="l00191"></a>00191     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.nsamples"</span>,
-<a name="l00192"></a>00192             CPL_TYPE_INT, <span class="stringliteral">"number of samples for RON computation"</span>,
-<a name="l00193"></a>00193             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 100) ;
-<a name="l00194"></a>00194     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"nsamples"</span>) ;
-<a name="l00195"></a>00195     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00196"></a>00196     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00197"></a>00197     <span class="comment">/* --hsize */</span>
-<a name="l00198"></a>00198     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.hsize"</span>,
-<a name="l00199"></a>00199             CPL_TYPE_INT, <span class="stringliteral">"half size of the window for RON computation"</span>,
-<a name="l00200"></a>00200             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 6) ;
-<a name="l00201"></a>00201     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"hsize"</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     <span class="comment">/* --zone */</span>
-<a name="l00205"></a>00205     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.zone"</span>,
-<a name="l00206"></a>00206                                 CPL_TYPE_STRING,
-<a name="l00207"></a>00207                                 <span class="stringliteral">"Stats zone"</span>,
-<a name="l00208"></a>00208                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,
-<a name="l00209"></a>00209                                 <span class="stringliteral">"512,512,1536,1536"</span>) ;
-<a name="l00210"></a>00210     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"zone"</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     <span class="comment">/* --gain */</span>
-<a name="l00214"></a>00214     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.gain"</span>,
-<a name="l00215"></a>00215                                 CPL_TYPE_DOUBLE,
-<a name="l00216"></a>00216                                 <span class="stringliteral">"Detector nominal gain (e-/ADU)"</span>,
-<a name="l00217"></a>00217                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,
-<a name="l00218"></a>00218                                 -1.);
-<a name="l00219"></a>00219     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"gain"</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     <span class="comment">/* --ron */</span>
-<a name="l00223"></a>00223     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.ron"</span>,
-<a name="l00224"></a>00224                                 CPL_TYPE_DOUBLE,
-<a name="l00225"></a>00225                                 <span class="stringliteral">"Detector nominal RON for a single readout (ADU)"</span>,
-<a name="l00226"></a>00226                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,
-<a name="l00227"></a>00227                                 -1.);
-<a name="l00228"></a>00228     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ron"</span>) ;
-<a name="l00229"></a>00229     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00230"></a>00230     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232     <span class="comment">/* Return */</span>
-<a name="l00233"></a>00233     <span class="keywordflow">return</span> 0;
-<a name="l00234"></a>00234 }
-<a name="l00235"></a>00235 
-<a name="l00236"></a>00236 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00242"></a>00242 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00243"></a>00243 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_exec(cpl_plugin * plugin)
-<a name="l00244"></a>00244 {
-<a name="l00245"></a>00245     cpl_recipe  *   recipe ;
-<a name="l00246"></a>00246     
-<a name="l00247"></a>00247     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00248"></a>00248     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00249"></a>00249         recipe = (cpl_recipe *)plugin ;
-<a name="l00250"></a>00250     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     <span class="comment">/* Issue a banner */</span>
-<a name="l00253"></a>00253     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="keywordflow">return</span> hawki_cal_dark(recipe->parameters, recipe->frames) ;
-<a name="l00256"></a>00256 }
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00264"></a>00264 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00265"></a>00265 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_destroy(cpl_plugin * plugin)
-<a name="l00266"></a>00266 {
-<a name="l00267"></a>00267     cpl_recipe  *   recipe ;
-<a name="l00268"></a>00268     
-<a name="l00269"></a>00269     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00270"></a>00270     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00271"></a>00271         recipe = (cpl_recipe *)plugin ;
-<a name="l00272"></a>00272     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274     cpl_parameterlist_delete(recipe->parameters) ; 
-<a name="l00275"></a>00275     <span class="keywordflow">return</span> 0 ;
-<a name="l00276"></a>00276 }
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00285"></a>00285 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00286"></a>00286 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark(
-<a name="l00287"></a>00287         cpl_parameterlist   *   parlist, 
-<a name="l00288"></a>00288         cpl_frameset        *   frameset)
-<a name="l00289"></a>00289 {
-<a name="l00290"></a>00290     cpl_frameset        *   rawframes ;
-<a name="l00291"></a>00291     cpl_frame           *   ref_frame ;
-<a name="l00292"></a>00292     cpl_propertylist    *   plist ;
-<a name="l00293"></a>00293     cpl_imagelist       *   darks_raw ;
-<a name="l00294"></a>00294     cpl_imagelist       *   master_dark;
-<a name="l00295"></a>00295     cpl_imagelist       *   master_dark_err;
-<a name="l00296"></a>00296     cpl_imagelist       *   bpmdark;
-<a name="l00297"></a>00297     cpl_image           *   bpm ;
-<a name="l00298"></a>00298     cpl_image           *   ima_curr ;
-<a name="l00299"></a>00299     cpl_image           *   ima_next ;
-<a name="l00300"></a>00300     cpl_image           *   ima_accu ;
-<a name="l00301"></a>00301     cpl_image           *   ima_accu_err = NULL;
-<a name="l00302"></a>00302     <span class="keywordtype">int</span>                     nframes ;
-<a name="l00303"></a>00303     cpl_vector          *   rons[HAWKI_NB_DETECTORS] ;
-<a name="l00304"></a>00304     cpl_table           **  raw_dark_stats;
-<a name="l00305"></a>00305     <span class="keywordtype">double</span>                  ron ;
-<a name="l00306"></a>00306     <span class="keywordtype">int</span>                     vc_urx, vc_ury, vc_llx, vc_lly ;
-<a name="l00307"></a>00307     <span class="keywordtype">int</span>                     j, k ;
-<a name="l00308"></a>00308     <span class="keywordtype">int</span>                     idet;
-<a name="l00309"></a>00309     cpl_errorstate          error_prevstate;      
-<a name="l00310"></a>00310     
-<a name="l00311"></a>00311     <span class="comment">/* Initialise */</span>
-<a name="l00312"></a>00312     rawframes = NULL ;
-<a name="l00313"></a>00313     ima_accu = NULL ;
-<a name="l00314"></a>00314     ima_next = NULL ;
-<a name="l00315"></a>00315     master_dark_err = NULL;
-<a name="l00316"></a>00316     hawki_cal_dark_initialise_qc();
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00319"></a>00319     <span class="keywordflow">if</span>(hawki_cal_dark_retrieve_input_param(parlist))
-<a name="l00320"></a>00320     {
-<a name="l00321"></a>00321         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00322"></a>00322         <span class="keywordflow">return</span> -1;
-<a name="l00323"></a>00323     }
-<a name="l00324"></a>00324  
-<a name="l00325"></a>00325     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00326"></a>00326     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00327"></a>00327         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00328"></a>00328         <span class="keywordflow">return</span> -1 ;
-<a name="l00329"></a>00329     }
-<a name="l00330"></a>00330         
-<a name="l00331"></a>00331     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00332"></a>00332     rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DARK_RAW) ;
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/* Test if raw frames have been found */</span>
-<a name="l00335"></a>00335     <span class="keywordflow">if</span> (rawframes == NULL) {
-<a name="l00336"></a>00336         cpl_msg_error(__func__, <span class="stringliteral">"No raw frame in input (%s)"</span>,HAWKI_CAL_DARK_RAW);
-<a name="l00337"></a>00337         <span class="keywordflow">return</span> -1 ;
-<a name="l00338"></a>00338     }
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="comment">/* At least 3 frames */</span>
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> (cpl_frameset_get_size(rawframes) < 3) {
-<a name="l00342"></a>00342         cpl_msg_error(__func__, <span class="stringliteral">"Not enough input frames"</span>);
-<a name="l00343"></a>00343         cpl_frameset_delete(rawframes) ;
-<a name="l00344"></a>00344         <span class="keywordflow">return</span> -1 ;
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346     
-<a name="l00347"></a>00347     <span class="comment">/* Get DIT / NDIT from the header */</span>
-<a name="l00348"></a>00348     error_prevstate = cpl_errorstate_get();
-<a name="l00349"></a>00349     ref_frame = cpl_frameset_get_frame(rawframes, 0) ;
-<a name="l00350"></a>00350     <span class="keywordflow">if</span> ((plist=cpl_propertylist_load(cpl_frame_get_filename(ref_frame),
-<a name="l00351"></a>00351                     0)) == NULL) {
-<a name="l00352"></a>00352         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);
-<a name="l00353"></a>00353         cpl_msg_indent_less() ;
-<a name="l00354"></a>00354         cpl_frameset_delete(rawframes) ;
-<a name="l00355"></a>00355         <span class="keywordflow">return</span> -1 ;
-<a name="l00356"></a>00356     }
-<a name="l00357"></a>00357     hawki_cal_dark_outputs.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;
-<a name="l00358"></a>00358     hawki_cal_dark_outputs.ndit = <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(plist) ;
-<a name="l00359"></a>00359     hawki_cal_dark_outputs.ndsamples = <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(plist);
-<a name="l00360"></a>00360     cpl_propertylist_delete(plist) ;
-<a name="l00361"></a>00361     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00362"></a>00362     {
-<a name="l00363"></a>00363         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the DIT/NDIT/NDSAMPLES from the header"</span>) ;
-<a name="l00364"></a>00364         cpl_msg_indent_less() ;
-<a name="l00365"></a>00365         cpl_frameset_delete(rawframes) ;
-<a name="l00366"></a>00366         <span class="keywordflow">return</span> -1 ;
-<a name="l00367"></a>00367     }
-<a name="l00368"></a>00368     cpl_msg_info(__func__, <span class="stringliteral">"DIT value: %g sec."</span>, hawki_cal_dark_outputs.dit);
-<a name="l00369"></a>00369     cpl_msg_info(__func__, <span class="stringliteral">"NDIT value: %d"</span>, hawki_cal_dark_outputs.ndit);
-<a name="l00370"></a>00370     cpl_msg_info(__func__, <span class="stringliteral">"NDSAMPLES value: %d"</span>, hawki_cal_dark_outputs.ndsamples);
-<a name="l00371"></a>00371     
-<a name="l00372"></a>00372     <span class="comment">/* Check that DIT/NDIT and NDSAMPLES are the same for all the frames */</span>
-<a name="l00373"></a>00373     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>) ||
-<a name="l00374"></a>00374        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>)||
-<a name="l00375"></a>00375        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>))
-<a name="l00376"></a>00376     {
-<a name="l00377"></a>00377         cpl_msg_error(__func__, <span class="stringliteral">"Not all input darks have the same "</span>
-<a name="l00378"></a>00378                 <span class="stringliteral">"DIT/NDIT/NDSAMPLES values"</span>);
-<a name="l00379"></a>00379         cpl_msg_indent_less() ;
-<a name="l00380"></a>00380         <span class="keywordflow">return</span> -1 ;        
-<a name="l00381"></a>00381     }
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="comment">/* Number of frames */</span>
-<a name="l00384"></a>00384     nframes = cpl_frameset_get_size(rawframes) ;
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     <span class="comment">/* Create the statistics table */</span>
-<a name="l00387"></a>00387     raw_dark_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00388"></a>00388     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00389"></a>00389     {
-<a name="l00390"></a>00390         raw_dark_stats[idet] = cpl_table_new(nframes);
-<a name="l00391"></a>00391     }
-<a name="l00392"></a>00392     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_dark_stats);
-<a name="l00393"></a>00393     
-<a name="l00394"></a>00394     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00395"></a>00395     master_dark = cpl_imagelist_new();
-<a name="l00396"></a>00396     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00397"></a>00397         master_dark_err = cpl_imagelist_new();
-<a name="l00398"></a>00398     bpmdark = cpl_imagelist_new();
-<a name="l00399"></a>00399     cpl_msg_info(__func__, <span class="stringliteral">"Dark computation"</span>);
-<a name="l00400"></a>00400     cpl_msg_indent_more() ;
-<a name="l00401"></a>00401     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l00402"></a>00402         cpl_msg_info(__func__, <span class="stringliteral">"Handle chip number %d"</span>, idet+1) ;
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404         <span class="comment">/* Create the rons vectors */</span>
-<a name="l00405"></a>00405         rons[idet] = cpl_vector_new(nframes) ;
-<a name="l00406"></a>00406         
-<a name="l00407"></a>00407         <span class="comment">/* Load the input data */</span>
-<a name="l00408"></a>00408         darks_raw = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(rawframes, idet+1, CPL_TYPE_FLOAT) ;
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410         <span class="comment">/* Loop on the frames */</span>
-<a name="l00411"></a>00411         <span class="keywordflow">for</span> (j=0 ; j<nframes ; j++) {
-<a name="l00412"></a>00412             <span class="comment">/* Load the current and next images */</span>
-<a name="l00413"></a>00413             <span class="keywordflow">if</span> (j==nframes-1) {
-<a name="l00414"></a>00414                 ima_curr = cpl_imagelist_get(darks_raw, j) ;
-<a name="l00415"></a>00415                 ima_next = cpl_imagelist_get(darks_raw, 0) ;
-<a name="l00416"></a>00416             } <span class="keywordflow">else</span> {
-<a name="l00417"></a>00417                 ima_curr = cpl_imagelist_get(darks_raw, j) ;
-<a name="l00418"></a>00418                 ima_next = cpl_imagelist_get(darks_raw, j+1) ;
-<a name="l00419"></a>00419             }
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421             <span class="comment">/* Compute the dark stats and store in table */</span>
-<a name="l00422"></a>00422             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00423"></a>00423                 (raw_dark_stats,
-<a name="l00424"></a>00424                  ima_curr,
-<a name="l00425"></a>00425                  hawki_cal_dark_config.llx,
-<a name="l00426"></a>00426                  hawki_cal_dark_config.lly,
-<a name="l00427"></a>00427                  hawki_cal_dark_config.urx,
-<a name="l00428"></a>00428                  hawki_cal_dark_config.ury,
-<a name="l00429"></a>00429                  idet,
-<a name="l00430"></a>00430                  j) != 0)
-<a name="l00431"></a>00431             {
-<a name="l00432"></a>00432                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute statistics"</span>) ;
-<a name="l00433"></a>00433                 cpl_msg_indent_less() ; 
-<a name="l00434"></a>00434                 cpl_frameset_delete(rawframes) ;
-<a name="l00435"></a>00435                 cpl_imagelist_delete(master_dark);
-<a name="l00436"></a>00436                 <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00437"></a>00437                     cpl_imagelist_delete(master_dark_err);                
-<a name="l00438"></a>00438                 cpl_imagelist_delete(darks_raw); 
-<a name="l00439"></a>00439                 cpl_imagelist_delete(bpmdark) ;
-<a name="l00440"></a>00440                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) 
-<a name="l00441"></a>00441                     cpl_vector_delete(rons[k]) ;
-<a name="l00442"></a>00442                 <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00443"></a>00443                     cpl_table_delete(raw_dark_stats[idet]);
-<a name="l00444"></a>00444                 cpl_free(raw_dark_stats);
-<a name="l00445"></a>00445                 <span class="keywordflow">return</span> -1 ;
-<a name="l00446"></a>00446             }
-<a name="l00447"></a>00447            
-<a name="l00448"></a>00448             <span class="comment">/* Compute the RON */</span>
-<a name="l00449"></a>00449             ron = hawki_cal_dark_ron(ima_curr, ima_next, hawki_cal_dark_outputs.ndit) ;
-<a name="l00450"></a>00450             cpl_vector_set(rons[idet], j, ron);
-<a name="l00451"></a>00451         }
-<a name="l00452"></a>00452         
-<a name="l00453"></a>00453         <span class="comment">/* Collapse */</span>
-<a name="l00454"></a>00454         <span class="keywordflow">if</span> (nframes > 2)
-<a name="l00455"></a>00455         {
-<a name="l00456"></a>00456             ima_accu = cpl_imagelist_collapse_minmax_create(darks_raw, 0, 1) ;
-<a name="l00457"></a>00457             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00458"></a>00458             {
-<a name="l00459"></a>00459                 cpl_imagelist * variances;
-<a name="l00460"></a>00460                 cpl_image     * accu_var;
-<a name="l00461"></a>00461                 cpl_msg_info(__func__, <span class="stringliteral">"Computing the uncertainty in dark"</span>);
-<a name="l00462"></a>00462                 variances = <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a>
-<a name="l00463"></a>00463                     (darks_raw, hawki_cal_dark_config.gain, 
-<a name="l00464"></a>00464                      hawki_cal_dark_config.ron, hawki_cal_dark_outputs.ndit,
-<a name="l00465"></a>00465                      hawki_cal_dark_outputs.ndsamples);
-<a name="l00466"></a>00466                 <span class="comment">/* The variances are collapsed, like the dark_raw. Given that</span>
-<a name="l00467"></a>00467 <span class="comment">                 * the variances are a monotically increasing function with</span>
-<a name="l00468"></a>00468 <span class="comment">                 * respect to the dark_raw, the minmax algorithm will select</span>
-<a name="l00469"></a>00469 <span class="comment">                 * the same values as for the dark_raw </span>
-<a name="l00470"></a>00470 <span class="comment">                 * The nframes - 1 is because only one frame is being rejected*/</span>  
-<a name="l00471"></a>00471                 accu_var = cpl_imagelist_collapse_minmax_create(variances,0,1);
-<a name="l00472"></a>00472                 cpl_image_divide_scalar(accu_var, nframes - 1);
-<a name="l00473"></a>00473                 ima_accu_err = cpl_image_duplicate(accu_var);
-<a name="l00474"></a>00474                 cpl_image_power(ima_accu_err, 0.5);
-<a name="l00475"></a>00475                 cpl_imagelist_delete(variances);
-<a name="l00476"></a>00476                 cpl_image_delete(accu_var);
-<a name="l00477"></a>00477             }
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479         } <span class="keywordflow">else</span> {
-<a name="l00480"></a>00480             ima_accu = cpl_imagelist_collapse_create(darks_raw) ;
-<a name="l00481"></a>00481             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00482"></a>00482             {
-<a name="l00483"></a>00483                 cpl_imagelist * variances;
-<a name="l00484"></a>00484                 cpl_image     * accu_var;
-<a name="l00485"></a>00485                 cpl_msg_info(__func__, <span class="stringliteral">"Computing the uncertainty in dark"</span>);
-<a name="l00486"></a>00486                 variances = <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a> 
-<a name="l00487"></a>00487                     (darks_raw, hawki_cal_dark_config.gain, 
-<a name="l00488"></a>00488                      hawki_cal_dark_config.ron, hawki_cal_dark_outputs.ndit,
-<a name="l00489"></a>00489                      hawki_cal_dark_outputs.ndsamples);
-<a name="l00490"></a>00490                 accu_var = cpl_imagelist_collapse_create(variances);                
-<a name="l00491"></a>00491                 cpl_image_divide_scalar(accu_var, nframes); 
-<a name="l00492"></a>00492                 ima_accu_err = cpl_image_duplicate(accu_var);
-<a name="l00493"></a>00493                 cpl_image_power(ima_accu_err, 0.5);
-<a name="l00494"></a>00494                 cpl_imagelist_delete(variances);
-<a name="l00495"></a>00495                 cpl_image_delete(accu_var);
-<a name="l00496"></a>00496             }
-<a name="l00497"></a>00497         }
-<a name="l00498"></a>00498         <span class="keywordflow">if</span> (ima_accu == NULL) {
-<a name="l00499"></a>00499             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the average"</span>) ;
-<a name="l00500"></a>00500             cpl_frameset_delete(rawframes) ;
-<a name="l00501"></a>00501             cpl_imagelist_delete(bpmdark) ;
-<a name="l00502"></a>00502             cpl_imagelist_delete(master_dark) ;
-<a name="l00503"></a>00503             <span class="keywordflow">if</span>(ima_accu_err != NULL)
-<a name="l00504"></a>00504                 cpl_image_delete(ima_accu_err);
-<a name="l00505"></a>00505             cpl_imagelist_delete(darks_raw); 
-<a name="l00506"></a>00506             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00507"></a>00507                 cpl_vector_delete(rons[idet]) ;
-<a name="l00508"></a>00508             <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00509"></a>00509                  cpl_table_delete(raw_dark_stats[idet]);
-<a name="l00510"></a>00510             cpl_free(raw_dark_stats);
-<a name="l00511"></a>00511             <span class="keywordflow">return</span> -1 ;
-<a name="l00512"></a>00512         }
-<a name="l00513"></a>00513         cpl_imagelist_delete(darks_raw) ;
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515         <span class="comment">/* Put the result in the list */</span>
-<a name="l00516"></a>00516         cpl_imagelist_set(master_dark, ima_accu, idet) ;
-<a name="l00517"></a>00517         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00518"></a>00518             cpl_imagelist_set(master_dark_err, ima_accu_err, idet) ;
-<a name="l00519"></a>00519 
-<a name="l00520"></a>00520         <span class="comment">/* Compute the dark_med and stdev */</span>
-<a name="l00521"></a>00521         hawki_cal_dark_outputs.master_dark_med[idet]=
-<a name="l00522"></a>00522             cpl_image_get_median(ima_accu) / hawki_cal_dark_outputs.dit;
-<a name="l00523"></a>00523         hawki_cal_dark_outputs.master_dark_mean[idet] =
-<a name="l00524"></a>00524             cpl_image_get_mean(ima_accu) / hawki_cal_dark_outputs.dit;
-<a name="l00525"></a>00525         hawki_cal_dark_outputs.master_dark_stdev[idet] =
-<a name="l00526"></a>00526             cpl_image_get_stdev(ima_accu) / hawki_cal_dark_outputs.dit;
-<a name="l00527"></a>00527         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00528"></a>00528         {
-<a name="l00529"></a>00529             hawki_cal_dark_outputs.master_dark_error_med[idet]=
-<a name="l00530"></a>00530                 cpl_image_get_median(ima_accu_err) / hawki_cal_dark_outputs.dit;
-<a name="l00531"></a>00531             hawki_cal_dark_outputs.master_dark_error_mean[idet] =
-<a name="l00532"></a>00532                 cpl_image_get_mean(ima_accu_err) / hawki_cal_dark_outputs.dit;
-<a name="l00533"></a>00533             hawki_cal_dark_outputs.master_dark_error_stdev[idet] =
-<a name="l00534"></a>00534                 cpl_image_get_stdev(ima_accu_err) / hawki_cal_dark_outputs.dit;
-<a name="l00535"></a>00535         }
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537         <span class="comment">/* Compute the Video Channels stats */</span>
-<a name="l00538"></a>00538         vc_lly = 973 ;
-<a name="l00539"></a>00539         vc_ury = 1036 ;
-<a name="l00540"></a>00540         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) {
-<a name="l00541"></a>00541             vc_llx = j*(2048/HAWKI_NB_VC) + 1 ;
-<a name="l00542"></a>00542             vc_urx = (j+1)*(2048/HAWKI_NB_VC) ;
-<a name="l00543"></a>00543 
-<a name="l00544"></a>00544             hawki_cal_dark_outputs.vc_mean[idet][j] =
-<a name="l00545"></a>00545                 cpl_image_get_mean_window(ima_accu, vc_llx, vc_lly,
-<a name="l00546"></a>00546                         vc_urx, vc_ury) ;
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548             hawki_cal_dark_outputs.vc_med[idet][j] =
-<a name="l00549"></a>00549                 cpl_image_get_median_window(ima_accu, vc_llx, vc_lly,
-<a name="l00550"></a>00550                         vc_urx, vc_ury) ;
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552             hawki_cal_dark_outputs.vc_stdev[idet][j] =
-<a name="l00553"></a>00553                 cpl_image_get_stdev_window(ima_accu, vc_llx, vc_lly,
-<a name="l00554"></a>00554                         vc_urx, vc_ury) ;
-<a name="l00555"></a>00555         }
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557         <span class="comment">/* Compute the HOT pixels map */</span>
-<a name="l00558"></a>00558         cpl_msg_info(__func__, <span class="stringliteral">"Compute the BPM from the dark"</span>) ;
-<a name="l00559"></a>00559         cpl_msg_indent_more() ;
-<a name="l00560"></a>00560         <span class="keywordflow">if</span> ((bpm=<a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a>(ima_accu, 
-<a name="l00561"></a>00561                         hawki_cal_dark_config.sigma)) == NULL) {
-<a name="l00562"></a>00562             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the hot pixels"</span>) ;
-<a name="l00563"></a>00563             cpl_msg_indent_less() ; 
-<a name="l00564"></a>00564             cpl_frameset_delete(rawframes) ;
-<a name="l00565"></a>00565             cpl_imagelist_delete(bpmdark) ;
-<a name="l00566"></a>00566             cpl_imagelist_delete(master_dark);
-<a name="l00567"></a>00567             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00568"></a>00568                 cpl_imagelist_delete(master_dark_err);
-<a name="l00569"></a>00569             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00570"></a>00570                 cpl_vector_delete(rons[idet]) ;
-<a name="l00571"></a>00571             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00572"></a>00572                 cpl_table_delete(raw_dark_stats[idet]);
-<a name="l00573"></a>00573             cpl_free(raw_dark_stats);
-<a name="l00574"></a>00574             <span class="keywordflow">return</span> -1 ;
-<a name="l00575"></a>00575         }
-<a name="l00576"></a>00576         cpl_imagelist_set(bpmdark, bpm, idet) ;
-<a name="l00577"></a>00577         hawki_cal_dark_outputs.nb_badpix[idet]=(int)cpl_image_get_flux(bpm);
-<a name="l00578"></a>00578         cpl_msg_indent_less() ;
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580     cpl_msg_indent_less() ;
-<a name="l00581"></a>00581     
-<a name="l00582"></a>00582     <span class="comment">/* Divide by DIT */</span>
-<a name="l00583"></a>00583     cpl_msg_info(__func__, <span class="stringliteral">"Division by DIT"</span>) ;
-<a name="l00584"></a>00584     cpl_imagelist_divide_scalar(master_dark, hawki_cal_dark_outputs.dit);
-<a name="l00585"></a>00585     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00586"></a>00586         cpl_imagelist_divide_scalar(master_dark_err, hawki_cal_dark_outputs.dit);
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     <span class="comment">/* Save the product */</span>
-<a name="l00589"></a>00589     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00590"></a>00590     cpl_msg_indent_more() ;
-<a name="l00591"></a>00591     <span class="keywordflow">if</span> (hawki_cal_dark_save(master_dark, master_dark_err,
-<a name="l00592"></a>00592                             bpmdark, raw_dark_stats, 
-<a name="l00593"></a>00593                             (<span class="keyword">const</span> cpl_vector **)rons,
-<a name="l00594"></a>00594                             rawframes,
-<a name="l00595"></a>00595                             parlist, frameset)) 
-<a name="l00596"></a>00596         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00597"></a>00597                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00598"></a>00598 
-<a name="l00599"></a>00599     <span class="comment">/* Free */</span>
-<a name="l00600"></a>00600     cpl_frameset_delete(rawframes) ;
-<a name="l00601"></a>00601     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00602"></a>00602         cpl_vector_delete(rons[idet]) ;
-<a name="l00603"></a>00603     cpl_imagelist_delete(master_dark) ;
-<a name="l00604"></a>00604     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00605"></a>00605         cpl_imagelist_delete(master_dark_err);
-<a name="l00606"></a>00606     cpl_imagelist_delete(bpmdark) ;
-<a name="l00607"></a>00607     cpl_msg_indent_less() ;
-<a name="l00608"></a>00608     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00609"></a>00609          cpl_table_delete(raw_dark_stats[idet]);
-<a name="l00610"></a>00610     cpl_free(raw_dark_stats);
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     <span class="comment">/* Return */</span>
-<a name="l00613"></a>00613     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00614"></a>00614     {
-<a name="l00615"></a>00615         cpl_msg_error(__func__,
-<a name="l00616"></a>00616                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00617"></a>00617         <span class="keywordflow">return</span> -1 ;
-<a name="l00618"></a>00618     }
-<a name="l00619"></a>00619     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00620"></a>00620 }
-<a name="l00621"></a>00621 
-<a name="l00622"></a>00622 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00630"></a>00630 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00631"></a>00631 <span class="keyword">static</span> <span class="keywordtype">double</span> hawki_cal_dark_ron(
-<a name="l00632"></a>00632         <span class="keyword">const</span> cpl_image     *   ima1, 
-<a name="l00633"></a>00633         <span class="keyword">const</span> cpl_image     *   ima2, 
-<a name="l00634"></a>00634         <span class="keywordtype">int</span>                     ndit) 
-<a name="l00635"></a>00635 {
-<a name="l00636"></a>00636     cpl_image       *   ima ;
-<a name="l00637"></a>00637     <span class="keywordtype">double</span>              norm ;
-<a name="l00638"></a>00638     <span class="keywordtype">double</span>              ron ;
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="comment">/* Test entries */</span>
-<a name="l00641"></a>00641     <span class="keywordflow">if</span> (ima1 == NULL)   <span class="keywordflow">return</span> -1.0 ;
-<a name="l00642"></a>00642     <span class="keywordflow">if</span> (ima2 == NULL)   <span class="keywordflow">return</span> -1.0 ;
-<a name="l00643"></a>00643     <span class="keywordflow">if</span> (ndit < 1)       <span class="keywordflow">return</span> -1.0 ;
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="comment">/* Compute norm */</span>
-<a name="l00646"></a>00646     norm = 0.5 * ndit ;
-<a name="l00647"></a>00647     norm = sqrt(norm) ;
-<a name="l00648"></a>00648 
-<a name="l00649"></a>00649     <span class="comment">/* Subtraction */</span>
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> ((ima = cpl_image_subtract_create(ima2, ima1)) == NULL) <span class="keywordflow">return</span> -1.0 ;
-<a name="l00651"></a>00651    
-<a name="l00652"></a>00652     <span class="comment">/* RON measurement */</span>
-<a name="l00653"></a>00653     cpl_flux_get_noise_window(ima, NULL, hawki_cal_dark_config.hsize,
-<a name="l00654"></a>00654             hawki_cal_dark_config.nsamples, &ron, NULL) ;
-<a name="l00655"></a>00655     cpl_image_delete(ima) ;
-<a name="l00656"></a>00656     <span class="keywordflow">return</span> norm*ron ;
-<a name="l00657"></a>00657 }
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00669"></a>00669 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00670"></a>00670 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_save
-<a name="l00671"></a>00671 (<span class="keyword">const</span> cpl_imagelist *   master_dark,
-<a name="l00672"></a>00672  <span class="keyword">const</span> cpl_imagelist *   master_dark_err,
-<a name="l00673"></a>00673  <span class="keyword">const</span> cpl_imagelist *   bpmdark,
-<a name="l00674"></a>00674  cpl_table           **  raw_dark_stats,
-<a name="l00675"></a>00675  <span class="keyword">const</span> cpl_vector    **  rons,
-<a name="l00676"></a>00676  <span class="keyword">const</span> cpl_frameset  *   used_frames,
-<a name="l00677"></a>00677  cpl_parameterlist   *   parlist,
-<a name="l00678"></a>00678  cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l00679"></a>00679 {
-<a name="l00680"></a>00680     cpl_propertylist    **  qclists ;
-<a name="l00681"></a>00681     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l00682"></a>00682     <span class="keywordtype">char</span>                    sval[32] ;
-<a name="l00683"></a>00683     cpl_propertylist    *   inputlist ;
-<a name="l00684"></a>00684     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00685"></a>00685     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_dark"</span> ;
-<a name="l00686"></a>00686     <span class="keywordtype">int</span>                     i, j ;
-<a name="l00687"></a>00687     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00688"></a>00688     
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     <span class="comment">/* Get the reference frame */</span>
-<a name="l00691"></a>00691     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW) ;
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693     <span class="comment">/* Create the QC lists */</span>
-<a name="l00694"></a>00694     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00695"></a>00695     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00696"></a>00696         qclists[i] = cpl_propertylist_new();
-<a name="l00697"></a>00697         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC DARK NBADPIX"</span>,
-<a name="l00698"></a>00698                 hawki_cal_dark_outputs.nb_badpix[i]);
-<a name="l00699"></a>00699         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK MEAN"</span>,
-<a name="l00700"></a>00700                 hawki_cal_dark_outputs.master_dark_mean[i]);
-<a name="l00701"></a>00701         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK MED"</span>,
-<a name="l00702"></a>00702                 hawki_cal_dark_outputs.master_dark_med[i]);
-<a name="l00703"></a>00703         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK STDEV"</span>,
-<a name="l00704"></a>00704                 hawki_cal_dark_outputs.master_dark_stdev[i]);
-<a name="l00705"></a>00705         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM MEAN"</span>,
-<a name="l00706"></a>00706                 hawki_cal_dark_outputs.master_dark_mean[i] * hawki_cal_dark_outputs.dit);
-<a name="l00707"></a>00707         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM MED"</span>,
-<a name="l00708"></a>00708                 hawki_cal_dark_outputs.master_dark_med[i] * hawki_cal_dark_outputs.dit);
-<a name="l00709"></a>00709         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM STDEV"</span>,
-<a name="l00710"></a>00710                 hawki_cal_dark_outputs.master_dark_stdev[i] * hawki_cal_dark_outputs.dit);
-<a name="l00711"></a>00711         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)
-<a name="l00712"></a>00712         {
-<a name="l00713"></a>00713             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR MEAN"</span>,
-<a name="l00714"></a>00714                  hawki_cal_dark_outputs.master_dark_error_mean[i]);
-<a name="l00715"></a>00715             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR MED"</span>,
-<a name="l00716"></a>00716                  hawki_cal_dark_outputs.master_dark_error_med[i]);
-<a name="l00717"></a>00717             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR STDEV"</span>,
-<a name="l00718"></a>00718                  hawki_cal_dark_outputs.master_dark_error_stdev[i]);
-<a name="l00719"></a>00719             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM MEAN"</span>,
-<a name="l00720"></a>00720                  hawki_cal_dark_outputs.master_dark_error_mean[i] * hawki_cal_dark_outputs.dit);
-<a name="l00721"></a>00721             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM MED"</span>,
-<a name="l00722"></a>00722                  hawki_cal_dark_outputs.master_dark_error_med[i] * hawki_cal_dark_outputs.dit);
-<a name="l00723"></a>00723             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM STDEV"</span>,
-<a name="l00724"></a>00724                  hawki_cal_dark_outputs.master_dark_error_stdev[i] * hawki_cal_dark_outputs.dit);
-<a name="l00725"></a>00725         }
-<a name="l00726"></a>00726         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) {
-<a name="l00727"></a>00727             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d MEAN"</span>, j+1) ;
-<a name="l00728"></a>00728             cpl_propertylist_append_double(qclists[i], sval,
-<a name="l00729"></a>00729                     hawki_cal_dark_outputs.vc_mean[i][j]) ;
-<a name="l00730"></a>00730             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d MED"</span>, j+1) ;
-<a name="l00731"></a>00731             cpl_propertylist_append_double(qclists[i], sval,
-<a name="l00732"></a>00732                     hawki_cal_dark_outputs.vc_med[i][j]) ;
-<a name="l00733"></a>00733             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d STDEV"</span>, j+1) ;
-<a name="l00734"></a>00734             cpl_propertylist_append_double(qclists[i], sval,
-<a name="l00735"></a>00735                     hawki_cal_dark_outputs.vc_stdev[i][j]) ;
-<a name="l00736"></a>00736         }
-<a name="l00737"></a>00737         <span class="keywordflow">for</span> (j=0 ; j<cpl_vector_get_size(rons[i]) ; j++) {
-<a name="l00738"></a>00738             sprintf(sval, <span class="stringliteral">"ESO QC RON%d"</span>, j+1) ;
-<a name="l00739"></a>00739             cpl_propertylist_append_double(qclists[i], sval,
-<a name="l00740"></a>00740                     cpl_vector_get(rons[i], j)) ;
-<a name="l00741"></a>00741         } 
-<a name="l00742"></a>00742         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON MEAN"</span>,
-<a name="l00743"></a>00743                 cpl_vector_get_mean(rons[i])) ;
-<a name="l00744"></a>00744         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON MED"</span>,
-<a name="l00745"></a>00745                 cpl_vector_get_median_const(rons[i])) ;
-<a name="l00746"></a>00746         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON STDEV"</span>,
-<a name="l00747"></a>00747                 cpl_vector_get_stdev(rons[i])) ;
-<a name="l00748"></a>00748         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l00749"></a>00749                 cpl_frameset_get_size(<span class="keyword">set</span>)) ;
-<a name="l00750"></a>00750        
-<a name="l00751"></a>00751         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00752"></a>00752         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);
-<a name="l00753"></a>00753         inputlist = cpl_propertylist_load_regexp(
-<a name="l00754"></a>00754                 cpl_frame_get_filename(ref_frame), ext_nb, 
-<a name="l00755"></a>00755                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l00756"></a>00756         cpl_propertylist_append(qclists[i], inputlist) ; 
-<a name="l00757"></a>00757         cpl_propertylist_delete(inputlist) ;
-<a name="l00758"></a>00758     }
-<a name="l00759"></a>00759     <span class="comment">/* Statistics of the raw images in the QC */</span>
-<a name="l00760"></a>00760     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_dark_stats, qclists);
-<a name="l00761"></a>00761 
-<a name="l00762"></a>00762     <span class="comment">/* Write the dark image */</span>
-<a name="l00763"></a>00763     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,
-<a name="l00764"></a>00764                          parlist,
-<a name="l00765"></a>00765                          used_frames, 
-<a name="l00766"></a>00766                          master_dark, 
-<a name="l00767"></a>00767                          recipe_name,
-<a name="l00768"></a>00768                          HAWKI_CALPRO_DARK, 
-<a name="l00769"></a>00769                          HAWKI_PROTYPE_DARK,
-<a name="l00770"></a>00770                          NULL,
-<a name="l00771"></a>00771                          (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l00772"></a>00772                          <span class="stringliteral">"hawki_cal_dark.fits"</span>) ;
-<a name="l00773"></a>00773 
-<a name="l00774"></a>00774     <span class="comment">/* Write the dark image error */</span>
-<a name="l00775"></a>00775     <span class="keywordflow">if</span>(master_dark_err != NULL)
-<a name="l00776"></a>00776     {
-<a name="l00777"></a>00777         <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,
-<a name="l00778"></a>00778                              parlist,
-<a name="l00779"></a>00779                              used_frames, 
-<a name="l00780"></a>00780                              master_dark_err, 
-<a name="l00781"></a>00781                              recipe_name,
-<a name="l00782"></a>00782                              HAWKI_CALPRO_DARK_ERR, 
-<a name="l00783"></a>00783                              HAWKI_PROTYPE_DARK_ERR,
-<a name="l00784"></a>00784                              NULL,
-<a name="l00785"></a>00785                              NULL,
-<a name="l00786"></a>00786                              <span class="stringliteral">"hawki_cal_dark_err.fits"</span>) ;
-<a name="l00787"></a>00787     }
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     <span class="comment">/* Write the bpmdark pixels image */</span>
-<a name="l00790"></a>00790     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,
-<a name="l00791"></a>00791                          parlist,
-<a name="l00792"></a>00792                          used_frames, 
-<a name="l00793"></a>00793                          bpmdark, 
-<a name="l00794"></a>00794                          recipe_name,
-<a name="l00795"></a>00795                          HAWKI_CALPRO_BPM_HOT, 
-<a name="l00796"></a>00796                          HAWKI_PROTYPE_BPM,
-<a name="l00797"></a>00797                          NULL,
-<a name="l00798"></a>00798                          NULL,
-<a name="l00799"></a>00799                          <span class="stringliteral">"hawki_cal_dark_bpmdark.fits"</span>) ;
-<a name="l00800"></a>00800 
-<a name="l00801"></a>00801     
-<a name="l00802"></a>00802     <span class="comment">/* Write the table with the statistics */</span>
-<a name="l00803"></a>00803     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l00804"></a>00804                       parlist,
-<a name="l00805"></a>00805                       used_frames,
-<a name="l00806"></a>00806                       (<span class="keyword">const</span> cpl_table **)raw_dark_stats,
-<a name="l00807"></a>00807                       recipe_name,
-<a name="l00808"></a>00808                       HAWKI_CALPRO_DARK_STATS,
-<a name="l00809"></a>00809                       HAWKI_PROTYPE_DARK_STATS,
-<a name="l00810"></a>00810                       NULL,
-<a name="l00811"></a>00811                       NULL,
-<a name="l00812"></a>00812                       <span class="stringliteral">"hawki_cal_dark_stats.fits"</span>) ;
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814     <span class="comment">/* Free and return */</span>
-<a name="l00815"></a>00815     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00816"></a>00816         cpl_propertylist_delete(qclists[i]) ;
-<a name="l00817"></a>00817     }
-<a name="l00818"></a>00818     cpl_free(qclists) ;
-<a name="l00819"></a>00819     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00820"></a>00820     {
-<a name="l00821"></a>00821         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00822"></a>00822         <span class="keywordflow">return</span> -1;
-<a name="l00823"></a>00823     }
-<a name="l00824"></a>00824     <span class="keywordflow">return</span>  0;
-<a name="l00825"></a>00825 }
-<a name="l00826"></a>00826 
-<a name="l00827"></a>00827 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_retrieve_input_param
-<a name="l00828"></a>00828 (cpl_parameterlist * parlist)
-<a name="l00829"></a>00829 {
-<a name="l00830"></a>00830     cpl_parameter       *   par ;
-<a name="l00831"></a>00831     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;
-<a name="l00832"></a>00832     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00833"></a>00833     
-<a name="l00834"></a>00834     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00835"></a>00835     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.sigma"</span>) ;
-<a name="l00836"></a>00836     hawki_cal_dark_config.sigma = cpl_parameter_get_double(par) ;
-<a name="l00837"></a>00837     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.hsize"</span>) ;
-<a name="l00838"></a>00838     hawki_cal_dark_config.hsize = cpl_parameter_get_int(par) ;
-<a name="l00839"></a>00839     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.nsamples"</span>) ;
-<a name="l00840"></a>00840     hawki_cal_dark_config.nsamples = cpl_parameter_get_int(par) ;
-<a name="l00841"></a>00841     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.zone"</span>) ;
-<a name="l00842"></a>00842     sval = cpl_parameter_get_string(par) ;
-<a name="l00843"></a>00843     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,
-<a name="l00844"></a>00844                     &hawki_cal_dark_config.llx,
-<a name="l00845"></a>00845                     &hawki_cal_dark_config.lly,
-<a name="l00846"></a>00846                     &hawki_cal_dark_config.urx,
-<a name="l00847"></a>00847                     &hawki_cal_dark_config.ury)!=4) {
-<a name="l00848"></a>00848         <span class="keywordflow">return</span> -1 ;
-<a name="l00849"></a>00849     }
-<a name="l00850"></a>00850     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.gain"</span>) ;
-<a name="l00851"></a>00851     hawki_cal_dark_config.gain = cpl_parameter_get_double(par);
-<a name="l00852"></a>00852     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.ron"</span>) ;
-<a name="l00853"></a>00853     hawki_cal_dark_config.ron = cpl_parameter_get_double(par);
-<a name="l00854"></a>00854     hawki_cal_dark_config.error_tracking = 0; 
-<a name="l00855"></a>00855     <span class="keywordflow">if</span>(hawki_cal_dark_config.gain > 0 && hawki_cal_dark_config.ron > 0)
-<a name="l00856"></a>00856         hawki_cal_dark_config.error_tracking = 1; 
-<a name="l00857"></a>00857     
-<a name="l00858"></a>00858     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00859"></a>00859         <span class="keywordflow">return</span> -1;
-<a name="l00860"></a>00860 
-<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 <span class="keywordtype">void</span> hawki_cal_dark_initialise_qc(<span class="keywordtype">void</span>)
-<a name="l00865"></a>00865 {
-<a name="l00866"></a>00866     <span class="keywordtype">int</span> idet;
-<a name="l00867"></a>00867     <span class="keywordtype">int</span> j;
-<a name="l00868"></a>00868     
-<a name="l00869"></a>00869     <span class="keywordflow">for</span>(idet=0; idet<HAWKI_NB_DETECTORS; idet++) 
-<a name="l00870"></a>00870     {
-<a name="l00871"></a>00871         hawki_cal_dark_outputs.nb_badpix[idet] = -1 ;
-<a name="l00872"></a>00872         hawki_cal_dark_outputs.master_dark_mean[idet] = -1.0 ;
-<a name="l00873"></a>00873         hawki_cal_dark_outputs.master_dark_med[idet] = -1.0 ;
-<a name="l00874"></a>00874         hawki_cal_dark_outputs.master_dark_stdev[idet] = -1.0 ;
-<a name="l00875"></a>00875         hawki_cal_dark_outputs.master_dark_error_mean[idet] = -1.0 ;
-<a name="l00876"></a>00876         hawki_cal_dark_outputs.master_dark_error_med[idet] = -1.0 ;
-<a name="l00877"></a>00877         hawki_cal_dark_outputs.master_dark_error_stdev[idet] = -1.0 ;
-<a name="l00878"></a>00878         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) 
-<a name="l00879"></a>00879         {
-<a name="l00880"></a>00880             hawki_cal_dark_outputs.vc_mean[idet][j] = -1.0 ;
-<a name="l00881"></a>00881             hawki_cal_dark_outputs.vc_med[idet][j] = -1.0 ;
-<a name="l00882"></a>00882             hawki_cal_dark_outputs.vc_stdev[idet][j] = -1.0 ;
-<a name="l00883"></a>00883         }
-<a name="l00884"></a>00884     }
-<a name="l00885"></a>00885 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_dark.c,v 1.21 2011/02/16 16:33: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/02/16 16:33:21 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_variance.h"</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="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> <span class="keywordtype">int</span> hawki_cal_dark_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark(cpl_parameterlist *, cpl_frameset *) ;</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="keywordtype">void</span> hawki_cal_dark_initialise_qc(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_retrieve_input_param</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> (cpl_parameterlist * parlist);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">double</span> hawki_cal_dark_ron(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, <span class="keywordtype">int</span>) ;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_save</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> (<span class="keyword">const</span> cpl_imagelist *   dark,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  <span class="keyword">const</span> cpl_imagelist *   master_dark_err,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  <span class="keyword">const</span> cpl_imagelist *   bpmdark,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  cpl_table           **  raw_dark_stats,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  <span class="keyword">const</span> cpl_vector    **  rons,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="keyword">const</span> cpl_frameset  *   used_frames,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_frameset        *   <span class="keyword">set</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="comment">                            Static variables</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="comment">/* Inputs */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordtype">int</span>         hsize ;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordtype">int</span>         nsamples ;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="keywordtype">double</span>      sigma ;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordtype">int</span>         llx ;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordtype">int</span>         lly ;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keywordtype">int</span>         urx ;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordtype">int</span>         ury ;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordtype">double</span>      ron;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keywordtype">int</span>         error_tracking;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> } hawki_cal_dark_config ;</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">static</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="comment">/* Outputs */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordtype">int</span>         nb_badpix[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="keywordtype">double</span>      master_dark_mean[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordtype">double</span>      master_dark_med[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordtype">double</span>      master_dark_stdev[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordtype">double</span>      master_dark_error_mean[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="keywordtype">double</span>      master_dark_error_med[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="keywordtype">double</span>      master_dark_error_stdev[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="keywordtype">double</span>      vc_mean[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordtype">double</span>      vc_med[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">double</span>      vc_stdev[HAWKI_NB_DETECTORS][HAWKI_NB_VC] ;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordtype">double</span>      dit;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="keywordtype">int</span>         ndit;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordtype">int</span>         ndsamples;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> } hawki_cal_dark_outputs;</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="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_dark_description[] =</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"hawki_cal_dark -- Dark recipe\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_DARK_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_TEC_FLAT_RAW<span class="stringliteral">".\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"hawki_cal_dark.fits ("</span>HAWKI_CALPRO_DARK<span class="stringliteral">"): The master dark\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"hawki_cal_dark_bpmdark.fits("</span>HAWKI_CALPRO_BPM_HOT<span class="stringliteral">"): The bad pixel mask associated to the dark\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="stringliteral">"hawki_cal_dark_stats.fits("</span>HAWKI_CALPRO_DARK_STATS<span class="stringliteral">"): Statistics of the raw darks\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"Optionally it also creates:\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"hawki_cal_dark_err.fits("</span>HAWKI_CALPRO_DARK_ERR<span class="stringliteral">"): The error in the master dark\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="stringliteral">"or 1 otherwise"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>                     HAWKI_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">"hawki_cal_dark"</span>,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"Dark recipe"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     hawki_cal_dark_description,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</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>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                     hawki_cal_dark_create,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     hawki_cal_dark_exec,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     hawki_cal_dark_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> <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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_create(cpl_plugin * plugin)</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_recipe      *   recipe ;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_parameter   *   p ;</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">/* Check that the plugin is part of a valid recipe */</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keywordflow">else</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>     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     recipe->parameters = cpl_parameterlist_new() ; </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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="comment">/* --sigma */</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.sigma"</span>,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for hot bad pixels detection"</span>,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 10.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">"sigma"</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>     <span class="comment">/* --nsamples */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.nsamples"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>             CPL_TYPE_INT, <span class="stringliteral">"number of samples for RON computation"</span>,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 100) ;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"nsamples"</span>) ;</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(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* --hsize */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.hsize"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>             CPL_TYPE_INT, <span class="stringliteral">"half size of the window for RON computation"</span>,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>             <span class="stringliteral">"hawki.hawki_cal_dark"</span>, 6) ;</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">"hsize"</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>     <span class="comment">/* --zone */</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.zone"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 <span class="stringliteral">"Stats zone"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 <span class="stringliteral">"512,512,1536,1536"</span>) ;</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">"zone"</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>     <span class="comment">/* --gain */</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.gain"</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">"Detector nominal gain (e-/ADU)"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 -1.);</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">"gain"</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>     <span class="comment">/* --ron */</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_dark.ron"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                 <span class="stringliteral">"Detector nominal RON for a single readout (ADU)"</span>,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                                 <span class="stringliteral">"hawki.hawki_cal_dark"</span>,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                                 -1.);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ron"</span>) ;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="keywordflow">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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">return</span> hawki_cal_dark(recipe->parameters, recipe->frames) ;</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="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">  265</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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 the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ; </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark(</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         cpl_frameset        *   frameset)</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>     cpl_frameset        *   rawframes ;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_frame           *   ref_frame ;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_imagelist       *   darks_raw ;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_imagelist       *   master_dark;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_imagelist       *   master_dark_err;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     cpl_imagelist       *   bpmdark;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     cpl_image           *   bpm ;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_image           *   ima_curr ;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_image           *   ima_next ;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_image           *   ima_accu ;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_image           *   ima_accu_err = NULL;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="keywordtype">int</span>                     nframes ;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_vector          *   rons[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_table           **  raw_dark_stats;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordtype">double</span>                  ron ;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keywordtype">int</span>                     vc_urx, vc_ury, vc_llx, vc_lly ;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordtype">int</span>                     j, k ;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_errorstate          error_prevstate;      </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">/* Initialise */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     rawframes = NULL ;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     ima_accu = NULL ;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     ima_next = NULL ;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     master_dark_err = NULL;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     hawki_cal_dark_initialise_qc();</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">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordflow">if</span>(hawki_cal_dark_retrieve_input_param(parlist))</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_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         <span class="keywordflow">return</span> -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>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DARK_RAW) ;</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">/* Test if raw frames have been found */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordflow">if</span> (rawframes == NULL) {</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         cpl_msg_error(__func__, <span class="stringliteral">"No raw frame in input (%s)"</span>,HAWKI_CAL_DARK_RAW);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         <span class="keywordflow">return</span> -1 ;</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="l00340"></a><span class="lineno">  340</span>     <span class="comment">/* At least 3 frames */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> (cpl_frameset_get_size(rawframes) < 3) {</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         cpl_msg_error(__func__, <span class="stringliteral">"Not enough input frames"</span>);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         cpl_frameset_delete(rawframes) ;</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>     </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="comment">/* Get DIT / NDIT from the header */</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     error_prevstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     ref_frame = cpl_frameset_get_frame(rawframes, 0) ;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordflow">if</span> ((plist=cpl_propertylist_load(cpl_frame_get_filename(ref_frame),</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                     0)) == NULL) {</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         <span class="keywordflow">return</span> -1 ;</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>     hawki_cal_dark_outputs.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     hawki_cal_dark_outputs.ndit = <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(plist) ;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     hawki_cal_dark_outputs.ndsamples = <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(plist);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_error(__func__, <span class="stringliteral">"Cannot get the DIT/NDIT/NDSAMPLES from the header"</span>) ;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         <span class="keywordflow">return</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>     cpl_msg_info(__func__, <span class="stringliteral">"DIT value: %g sec."</span>, hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_msg_info(__func__, <span class="stringliteral">"NDIT value: %d"</span>, hawki_cal_dark_outputs.ndit);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     cpl_msg_info(__func__, <span class="stringliteral">"NDSAMPLES value: %d"</span>, hawki_cal_dark_outputs.ndsamples);</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">/* Check that DIT/NDIT and NDSAMPLES are the same for all the frames */</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>) ||</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>)||</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(rawframes, &<a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>))</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>         cpl_msg_error(__func__, <span class="stringliteral">"Not all input darks have the same "</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                 <span class="stringliteral">"DIT/NDIT/NDSAMPLES values"</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>         <span class="keywordflow">return</span> -1 ;        </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">/* Number of frames */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     nframes = cpl_frameset_get_size(rawframes) ;</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">/* Create the statistics table */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     raw_dark_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         raw_dark_stats[idet] = cpl_table_new(nframes);</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__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_dark_stats);</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">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     master_dark = cpl_imagelist_new();</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         master_dark_err = cpl_imagelist_new();</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     bpmdark = cpl_imagelist_new();</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     cpl_msg_info(__func__, <span class="stringliteral">"Dark computation"</span>);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         cpl_msg_info(__func__, <span class="stringliteral">"Handle chip number %d"</span>, idet+1) ;</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">/* Create the rons vectors */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         rons[idet] = cpl_vector_new(nframes) ;</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">/* Load the input data */</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         darks_raw = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(rawframes, idet+1, CPL_TYPE_FLOAT) ;</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">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         <span class="keywordflow">for</span> (j=0 ; j<nframes ; j++) {</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>             <span class="comment">/* Load the current and next images */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>             <span class="keywordflow">if</span> (j==nframes-1) {</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                 ima_curr = cpl_imagelist_get(darks_raw, j) ;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                 ima_next = cpl_imagelist_get(darks_raw, 0) ;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>             } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                 ima_curr = cpl_imagelist_get(darks_raw, j) ;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                 ima_next = cpl_imagelist_get(darks_raw, j+1) ;</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">/* Compute the dark stats and store in table */</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                 (raw_dark_stats,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                  ima_curr,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                  hawki_cal_dark_config.llx,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                  hawki_cal_dark_config.lly,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                  hawki_cal_dark_config.urx,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                  hawki_cal_dark_config.ury,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                  idet,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                  j) != 0)</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_error(__func__, <span class="stringliteral">"Cannot compute statistics"</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_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                 cpl_imagelist_delete(master_dark);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                 <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                     cpl_imagelist_delete(master_dark_err);                </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                 cpl_imagelist_delete(darks_raw); </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                 cpl_imagelist_delete(bpmdark) ;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                     cpl_vector_delete(rons[k]) ;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                 <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                     cpl_table_delete(raw_dark_stats[idet]);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                 cpl_free(raw_dark_stats);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                 <span class="keywordflow">return</span> -1 ;</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="comment">/* Compute the RON */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>             ron = hawki_cal_dark_ron(ima_curr, ima_next, hawki_cal_dark_outputs.ndit) ;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>             cpl_vector_set(rons[idet], j, ron);</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="comment">/* Collapse */</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         <span class="keywordflow">if</span> (nframes > 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>             ima_accu = cpl_imagelist_collapse_minmax_create(darks_raw, 0, 1) ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</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_imagelist * variances;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                 cpl_image     * accu_var;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>                 cpl_msg_info(__func__, <span class="stringliteral">"Computing the uncertainty in dark"</span>);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                 variances = <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                     (darks_raw, hawki_cal_dark_config.gain, </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                      hawki_cal_dark_config.ron, hawki_cal_dark_outputs.ndit,</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                      hawki_cal_dark_outputs.ndsamples);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                 <span class="comment">/* The variances are collapsed, like the dark_raw. Given that</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> <span class="comment">                 * the variances are a monotically increasing function with</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> <span class="comment">                 * respect to the dark_raw, the minmax algorithm will select</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> <span class="comment">                 * the same values as for the dark_raw </span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="comment">                 * The nframes - 1 is because only one frame is being rejected*/</span>  </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                 accu_var = cpl_imagelist_collapse_minmax_create(variances,0,1);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                 cpl_image_divide_scalar(accu_var, nframes - 1);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                 ima_accu_err = cpl_image_duplicate(accu_var);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                 cpl_image_power(ima_accu_err, 0.5);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>                 cpl_imagelist_delete(variances);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                 cpl_image_delete(accu_var);</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>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>             ima_accu = cpl_imagelist_collapse_create(darks_raw) ;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</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_imagelist * variances;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                 cpl_image     * accu_var;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                 cpl_msg_info(__func__, <span class="stringliteral">"Computing the uncertainty in dark"</span>);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                 variances = <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                     (darks_raw, hawki_cal_dark_config.gain, </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                      hawki_cal_dark_config.ron, hawki_cal_dark_outputs.ndit,</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                      hawki_cal_dark_outputs.ndsamples);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                 accu_var = cpl_imagelist_collapse_create(variances);                </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                 cpl_image_divide_scalar(accu_var, nframes); </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                 ima_accu_err = cpl_image_duplicate(accu_var);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                 cpl_image_power(ima_accu_err, 0.5);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                 cpl_imagelist_delete(variances);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>                 cpl_image_delete(accu_var);</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="keywordflow">if</span> (ima_accu == NULL) {</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the average"</span>) ;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>             cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             cpl_imagelist_delete(bpmdark) ;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             cpl_imagelist_delete(master_dark) ;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             <span class="keywordflow">if</span>(ima_accu_err != NULL)</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                 cpl_image_delete(ima_accu_err);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>             cpl_imagelist_delete(darks_raw); </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                 cpl_vector_delete(rons[idet]) ;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>                  cpl_table_delete(raw_dark_stats[idet]);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             cpl_free(raw_dark_stats);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>             <span class="keywordflow">return</span> -1 ;</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_imagelist_delete(darks_raw) ;</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">/* Put the result in the list */</span></div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         cpl_imagelist_set(master_dark, ima_accu, idet) ;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             cpl_imagelist_set(master_dark_err, ima_accu_err, idet) ;</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="comment">/* Compute the dark_med and stdev */</span></div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         hawki_cal_dark_outputs.master_dark_med[idet]=</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>             cpl_image_get_median(ima_accu) / hawki_cal_dark_outputs.dit;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         hawki_cal_dark_outputs.master_dark_mean[idet] =</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>             cpl_image_get_mean(ima_accu) / hawki_cal_dark_outputs.dit;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         hawki_cal_dark_outputs.master_dark_stdev[idet] =</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>             cpl_image_get_stdev(ima_accu) / hawki_cal_dark_outputs.dit;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</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>             hawki_cal_dark_outputs.master_dark_error_med[idet]=</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                 cpl_image_get_median(ima_accu_err) / hawki_cal_dark_outputs.dit;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             hawki_cal_dark_outputs.master_dark_error_mean[idet] =</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>                 cpl_image_get_mean(ima_accu_err) / hawki_cal_dark_outputs.dit;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>             hawki_cal_dark_outputs.master_dark_error_stdev[idet] =</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>                 cpl_image_get_stdev(ima_accu_err) / hawki_cal_dark_outputs.dit;</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="comment">/* Compute the Video Channels stats */</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         vc_lly = 973 ;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         vc_ury = 1036 ;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) {</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>             vc_llx = j*(2048/HAWKI_NB_VC) + 1 ;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             vc_urx = (j+1)*(2048/HAWKI_NB_VC) ;</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>             hawki_cal_dark_outputs.vc_mean[idet][j] =</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                 cpl_image_get_mean_window(ima_accu, vc_llx, vc_lly,</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>                         vc_urx, vc_ury) ;</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>             hawki_cal_dark_outputs.vc_med[idet][j] =</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>                 cpl_image_get_median_window(ima_accu, vc_llx, vc_lly,</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>                         vc_urx, vc_ury) ;</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>             hawki_cal_dark_outputs.vc_stdev[idet][j] =</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                 cpl_image_get_stdev_window(ima_accu, vc_llx, vc_lly,</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                         vc_urx, vc_ury) ;</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">/* Compute the HOT pixels map */</span></div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         cpl_msg_info(__func__, <span class="stringliteral">"Compute the BPM from the dark"</span>) ;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         <span class="keywordflow">if</span> ((bpm=<a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a>(ima_accu, </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                         hawki_cal_dark_config.sigma)) == NULL) {</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the hot pixels"</span>) ;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>             cpl_msg_indent_less() ; </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             cpl_imagelist_delete(bpmdark) ;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>             cpl_imagelist_delete(master_dark);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                 cpl_imagelist_delete(master_dark_err);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>                 cpl_vector_delete(rons[idet]) ;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>                 cpl_table_delete(raw_dark_stats[idet]);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             cpl_free(raw_dark_stats);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>             <span class="keywordflow">return</span> -1 ;</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_imagelist_set(bpmdark, bpm, idet) ;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         hawki_cal_dark_outputs.nb_badpix[idet]=(int)cpl_image_get_flux(bpm);</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         cpl_msg_indent_less() ;</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_msg_indent_less() ;</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">/* Divide by DIT */</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     cpl_msg_info(__func__, <span class="stringliteral">"Division by DIT"</span>) ;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     cpl_imagelist_divide_scalar(master_dark, hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         cpl_imagelist_divide_scalar(master_dark_err, hawki_cal_dark_outputs.dit);</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="comment">/* Save the product */</span></div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordflow">if</span> (hawki_cal_dark_save(master_dark, master_dark_err,</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>                             bpmdark, raw_dark_stats, </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>                             (<span class="keyword">const</span> cpl_vector **)rons,</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>                             rawframes,</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>                             parlist, frameset)) </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>                                  <span class="stringliteral">"Check permisions or disk space"</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="comment">/* Free */</span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         cpl_vector_delete(rons[idet]) ;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_imagelist_delete(master_dark) ;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         cpl_imagelist_delete(master_dark_err);</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     cpl_imagelist_delete(bpmdark) ;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>          cpl_table_delete(raw_dark_stats[idet]);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_free(raw_dark_stats);</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">/* Return */</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         <span class="keywordflow">return</span> -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>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;</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="l00630"></a><span class="lineno">  630</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> <span class="keyword">static</span> <span class="keywordtype">double</span> hawki_cal_dark_ron(</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         <span class="keyword">const</span> cpl_image     *   ima1, </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         <span class="keyword">const</span> cpl_image     *   ima2, </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         <span class="keywordtype">int</span>                     ndit) </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_image       *   ima ;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     <span class="keywordtype">double</span>              norm ;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordtype">double</span>              ron ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordflow">if</span> (ima1 == NULL)   <span class="keywordflow">return</span> -1.0 ;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="keywordflow">if</span> (ima2 == NULL)   <span class="keywordflow">return</span> -1.0 ;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">if</span> (ndit < 1)       <span class="keywordflow">return</span> -1.0 ;</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">/* Compute norm */</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     norm = 0.5 * ndit ;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     norm = sqrt(norm) ;</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="comment">/* Subtraction */</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordflow">if</span> ((ima = cpl_image_subtract_create(ima2, ima1)) == NULL) <span class="keywordflow">return</span> -1.0 ;</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">/* RON measurement */</span></div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     cpl_flux_get_noise_window(ima, NULL, hawki_cal_dark_config.hsize,</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>             hawki_cal_dark_config.nsamples, &ron, NULL) ;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="keywordflow">return</span> norm*ron ;</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> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_save</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> (<span class="keyword">const</span> cpl_imagelist *   master_dark,</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>  <span class="keyword">const</span> cpl_imagelist *   master_dark_err,</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>  <span class="keyword">const</span> cpl_imagelist *   bpmdark,</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>  cpl_table           **  raw_dark_stats,</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>  <span class="keyword">const</span> cpl_vector    **  rons,</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>  <span class="keyword">const</span> cpl_frameset  *   used_frames,</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>  cpl_frameset        *   <span class="keyword">set</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>     cpl_propertylist    **  qclists ;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordtype">char</span>                    sval[32] ;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_dark"</span> ;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordtype">int</span>                     i, j ;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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="comment">/* Get the reference frame */</span></div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW) ;</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="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>         qclists[i] = cpl_propertylist_new();</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC DARK NBADPIX"</span>,</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>                 hawki_cal_dark_outputs.nb_badpix[i]);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK MEAN"</span>,</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>                 hawki_cal_dark_outputs.master_dark_mean[i]);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK MED"</span>,</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>                 hawki_cal_dark_outputs.master_dark_med[i]);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK STDEV"</span>,</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                 hawki_cal_dark_outputs.master_dark_stdev[i]);</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM MEAN"</span>,</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                 hawki_cal_dark_outputs.master_dark_mean[i] * hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM MED"</span>,</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>                 hawki_cal_dark_outputs.master_dark_med[i] * hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK NONORM STDEV"</span>,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                 hawki_cal_dark_outputs.master_dark_stdev[i] * hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>         <span class="keywordflow">if</span>(hawki_cal_dark_config.error_tracking)</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>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR MEAN"</span>,</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>                  hawki_cal_dark_outputs.master_dark_error_mean[i]);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR MED"</span>,</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                  hawki_cal_dark_outputs.master_dark_error_med[i]);</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR STDEV"</span>,</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                  hawki_cal_dark_outputs.master_dark_error_stdev[i]);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM MEAN"</span>,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                  hawki_cal_dark_outputs.master_dark_error_mean[i] * hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM MED"</span>,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                  hawki_cal_dark_outputs.master_dark_error_med[i] * hawki_cal_dark_outputs.dit);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>             cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DARK ERR NONORM STDEV"</span>,</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                  hawki_cal_dark_outputs.master_dark_error_stdev[i] * hawki_cal_dark_outputs.dit);</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">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) {</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d MEAN"</span>, j+1) ;</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>             cpl_propertylist_append_double(qclists[i], sval,</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                     hawki_cal_dark_outputs.vc_mean[i][j]) ;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d MED"</span>, j+1) ;</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>             cpl_propertylist_append_double(qclists[i], sval,</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>                     hawki_cal_dark_outputs.vc_med[i][j]) ;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>             sprintf(sval, <span class="stringliteral">"ESO QC DARK VC%d STDEV"</span>, j+1) ;</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>             cpl_propertylist_append_double(qclists[i], sval,</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>                     hawki_cal_dark_outputs.vc_stdev[i][j]) ;</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">for</span> (j=0 ; j<cpl_vector_get_size(rons[i]) ; j++) {</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>             sprintf(sval, <span class="stringliteral">"ESO QC RON%d"</span>, j+1) ;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>             cpl_propertylist_append_double(qclists[i], sval,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                     cpl_vector_get(rons[i], j)) ;</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>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON MEAN"</span>,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                 cpl_vector_get_mean(rons[i])) ;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON MED"</span>,</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>                 cpl_vector_get_median_const(rons[i])) ;</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC RON STDEV"</span>,</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>                 cpl_vector_get_stdev(rons[i])) ;</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                 cpl_frameset_get_size(<span class="keyword">set</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="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>                 cpl_frame_get_filename(ref_frame), ext_nb, </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>         cpl_propertylist_append(qclists[i], inputlist) ; </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         cpl_propertylist_delete(inputlist) ;</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="comment">/* Statistics of the raw images in the QC */</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_dark_stats, qclists);</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="comment">/* Write the dark image */</span></div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                          parlist,</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                          used_frames, </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                          master_dark, </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                          recipe_name,</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>                          HAWKI_CALPRO_DARK, </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                          HAWKI_PROTYPE_DARK,</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>                          NULL,</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>                          (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                          <span class="stringliteral">"hawki_cal_dark.fits"</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>     <span class="comment">/* Write the dark image error */</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <span class="keywordflow">if</span>(master_dark_err != 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>         <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>                              parlist,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                              used_frames, </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                              master_dark_err, </div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                              recipe_name,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>                              HAWKI_CALPRO_DARK_ERR, </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>                              HAWKI_PROTYPE_DARK_ERR,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>                              NULL,</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>                              NULL,</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>                              <span class="stringliteral">"hawki_cal_dark_err.fits"</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> </div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     <span class="comment">/* Write the bpmdark pixels image */</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>                          parlist,</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                          used_frames, </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>                          bpmdark, </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                          recipe_name,</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>                          HAWKI_CALPRO_BPM_HOT, </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>                          HAWKI_PROTYPE_BPM,</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>                          NULL,</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>                          <span class="stringliteral">"hawki_cal_dark_bpmdark.fits"</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="comment">/* Write the table with the statistics */</span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>                       parlist,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>                       used_frames,</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>                       (<span class="keyword">const</span> cpl_table **)raw_dark_stats,</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>                       recipe_name,</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                       HAWKI_CALPRO_DARK_STATS,</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                       HAWKI_PROTYPE_DARK_STATS,</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>                       NULL,</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>                       NULL,</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                       <span class="stringliteral">"hawki_cal_dark_stats.fits"</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">/* Free and return */</span></div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>         cpl_propertylist_delete(qclists[i]) ;</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>     cpl_free(qclists) ;</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         <span class="keywordflow">return</span> -1;</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">return</span>  0;</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_dark_retrieve_input_param</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> (cpl_parameterlist * parlist)</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>     cpl_parameter       *   par ;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.sigma"</span>) ;</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     hawki_cal_dark_config.sigma = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.hsize"</span>) ;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     hawki_cal_dark_config.hsize = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.nsamples"</span>) ;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     hawki_cal_dark_config.nsamples = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.zone"</span>) ;</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     sval = cpl_parameter_get_string(par) ;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>                     &hawki_cal_dark_config.llx,</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>                     &hawki_cal_dark_config.lly,</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>                     &hawki_cal_dark_config.urx,</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>                     &hawki_cal_dark_config.ury)!=4) {</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         <span class="keywordflow">return</span> -1 ;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.gain"</span>) ;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>     hawki_cal_dark_config.gain = cpl_parameter_get_double(par);</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_dark.ron"</span>) ;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     hawki_cal_dark_config.ron = cpl_parameter_get_double(par);</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>     hawki_cal_dark_config.error_tracking = 0; </div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>     <span class="keywordflow">if</span>(hawki_cal_dark_config.gain > 0 && hawki_cal_dark_config.ron > 0)</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         hawki_cal_dark_config.error_tracking = 1; </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="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>         <span class="keywordflow">return</span> -1;</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">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> <span class="keywordtype">void</span> hawki_cal_dark_initialise_qc(<span class="keywordtype">void</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="keywordtype">int</span> idet;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     <span class="keywordtype">int</span> j;</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">for</span>(idet=0; idet<HAWKI_NB_DETECTORS; idet++) </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>         hawki_cal_dark_outputs.nb_badpix[idet] = -1 ;</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>         hawki_cal_dark_outputs.master_dark_mean[idet] = -1.0 ;</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         hawki_cal_dark_outputs.master_dark_med[idet] = -1.0 ;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>         hawki_cal_dark_outputs.master_dark_stdev[idet] = -1.0 ;</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         hawki_cal_dark_outputs.master_dark_error_mean[idet] = -1.0 ;</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         hawki_cal_dark_outputs.master_dark_error_med[idet] = -1.0 ;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>         hawki_cal_dark_outputs.master_dark_error_stdev[idet] = -1.0 ;</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_VC ; j++) </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>             hawki_cal_dark_outputs.vc_mean[idet][j] = -1.0 ;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             hawki_cal_dark_outputs.vc_med[idet][j] = -1.0 ;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             hawki_cal_dark_outputs.vc_stdev[idet][j] = -1.0 ;</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> }</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/hawki__cal__distortion_8c_source.html b/html/hawki__cal__distortion_8c_source.html
index 761505f..a5bea7f 100644
--- a/html/hawki__cal__distortion_8c_source.html
+++ b/html/hawki__cal__distortion_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_distortion.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,1302 +40,1327 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_distortion.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_distortion.c,v 1.14 2012/04/23 10:02: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/04/23 10:02:57 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.14 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_alloc.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "irplib_cat.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "irplib_stdstar.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "irplib_match_cats.h"</span>
-<a name="l00053"></a>00053 <span class="preprocessor">#include "hawki_match_cats.h"</span>
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00056"></a>00056 <span class="comment">                            Functions prototypes</span>
-<a name="l00057"></a>00057 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_create(cpl_plugin *) ;
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_exec(cpl_plugin *) ;
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_destroy(cpl_plugin *) ;
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion(cpl_parameterlist   *   parlist,
-<a name="l00063"></a>00063                                    cpl_frameset        *   frameset);
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">int</span>  hawki_cal_distortion_get_apertures_from_raw_distor
-<a name="l00067"></a>00067 (cpl_frameset      *  raw_target,
-<a name="l00068"></a>00068  <span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00069"></a>00069  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00070"></a>00070  <span class="keyword">const</span> cpl_frame   *  bpm,
-<a name="l00071"></a>00071  cpl_image         ** master_sky,
-<a name="l00072"></a>00072  <span class="keywordtype">double</span>               sigma_det,
-<a name="l00073"></a>00073  cpl_apertures     *** apertures);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_load_master_calib
-<a name="l00076"></a>00076 (<span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00077"></a>00077  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00078"></a>00078  <span class="keyword">const</span> cpl_frame   *  bpm,
-<a name="l00079"></a>00079  cpl_imagelist     ** flat_images,
-<a name="l00080"></a>00080  cpl_imagelist     ** dark_images,
-<a name="l00081"></a>00081  cpl_imagelist     ** bpm_images);
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="keyword">static</span> cpl_image **  hawki_cal_distortion_get_master_sky
-<a name="l00084"></a>00084 (cpl_frameset      *  raw_target,
-<a name="l00085"></a>00085  <span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00086"></a>00086  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00087"></a>00087  <span class="keyword">const</span> cpl_frame   *  bpm);
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_subtract_sky
-<a name="l00090"></a>00090 (cpl_imagelist * distor_corrected,
-<a name="l00091"></a>00091  cpl_image     * master_sky);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093 <span class="keyword">static</span> hawki_distortion  ** hawki_cal_distortion_compute_dist_solution
-<a name="l00094"></a>00094 (cpl_apertures    *** apertures,
-<a name="l00095"></a>00095  <span class="keywordtype">int</span>                  nframes,
-<a name="l00096"></a>00096  cpl_bivector     *   offsets,
-<a name="l00097"></a>00097  <span class="keywordtype">int</span>                  grid_points,
-<a name="l00098"></a>00098  <span class="keywordtype">int</span>              *   nmatched_pairs,
-<a name="l00099"></a>00099  <span class="keywordtype">double</span>           *   rms,
-<a name="l00100"></a>00100  hawki_distortion **  distortion_guess);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102 <span class="keyword">static</span> cpl_apertures * hawki_cal_distortion_get_image_apertures
-<a name="l00103"></a>00103 (cpl_image * image,
-<a name="l00104"></a>00104  <span class="keywordtype">double</span> sigma_det);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fill_obj_pos
-<a name="l00107"></a>00107 (cpl_table     * objects_positions,
-<a name="l00108"></a>00108  cpl_apertures * apertures);
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_add_offset_to_positions
-<a name="l00111"></a>00111 (cpl_table     ** objects_positions,
-<a name="l00112"></a>00112  cpl_bivector   * offsets);
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fit_first_order_solution
-<a name="l00115"></a>00115 (hawki_distortion * distortion,
-<a name="l00116"></a>00116  cpl_polynomial   * fit2d_x,
-<a name="l00117"></a>00117  cpl_polynomial   * fit2d_y);
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119 <span class="keyword">static</span> cpl_propertylist ** hawki_cal_distortion_qc
-<a name="l00120"></a>00120 (hawki_distortion ** distortion,
-<a name="l00121"></a>00121  <span class="keywordtype">int</span>              *  nmatched_pairs,
-<a name="l00122"></a>00122  <span class="keywordtype">double</span>           *  rms);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_save
-<a name="l00125"></a>00125 (hawki_distortion       **  distortion,
-<a name="l00126"></a>00126  cpl_parameterlist       *  parlist,
-<a name="l00127"></a>00127  cpl_propertylist       **  qclists,
-<a name="l00128"></a>00128  cpl_frameset            *  recipe_set);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_retrieve_input_param
-<a name="l00131"></a>00131 (cpl_parameterlist  *  parlist);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00135"></a>00135 <span class="comment">                            Static variables</span>
-<a name="l00136"></a>00136 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00139"></a>00139 {
-<a name="l00140"></a>00140     <span class="comment">/* Inputs */</span>
-<a name="l00141"></a>00141     <span class="keywordtype">double</span> sigma_det;
-<a name="l00142"></a>00142     <span class="keywordtype">int</span>    grid_points;
-<a name="l00143"></a>00143     <span class="keywordtype">int</span>    borders;
-<a name="l00144"></a>00144     <span class="keywordtype">int</span>    subtract_linear;
-<a name="l00145"></a>00145 } hawki_cal_distortion_config;
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_distortion_description[] = 
-<a name="l00148"></a>00148 <span class="stringliteral">"hawki_cal_distortion -- HAWK-I distortion and astrometry autocalibration.\n\n"</span>
-<a name="l00149"></a>00149 <span class="stringliteral">"The input files must be tagged:\n"</span>
-<a name="l00150"></a>00150 <span class="stringliteral">"distortion_field.fits "</span>HAWKI_CAL_DISTOR_RAW<span class="stringliteral">"\n"</span>
-<a name="l00151"></a>00151 <span class="stringliteral">"sky_distortion.fits "</span>HAWKI_CAL_DISTOR_SKY_RAW<span class="stringliteral">"\n"</span>
-<a name="l00152"></a>00152 <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" (optional)\n"</span>
-<a name="l00153"></a>00153 <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" (optional)\n"</span>
-<a name="l00154"></a>00154 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" (optional)\n\n"</span>
-<a name="l00155"></a>00155 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00156"></a>00156 <span class="stringliteral">"hawki_cal_distortion_distx.fits ("</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">") \n"</span>
-<a name="l00157"></a>00157 <span class="stringliteral">"hawki_cal_distortion_disty.fits ("</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">") \n\n"</span>
-<a name="l00158"></a>00158 <span class="stringliteral">"The recipe performs the following steps:\n"</span>
-<a name="l00159"></a>00159 <span class="stringliteral">"-Basic calibration of astrometry fields\n"</span>
-<a name="l00160"></a>00160 <span class="stringliteral">"-Autocalibration of distortion, using method in A&A 454,1029 (2006)\n\n"</span>
-<a name="l00161"></a>00161 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00162"></a>00162 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00163"></a>00163 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00166"></a>00166 <span class="comment">                                Functions code</span>
-<a name="l00167"></a>00167 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00168"></a>00168 
-<a name="l00169"></a>00169 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00177"></a>00177 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00178"></a>00178 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00179"></a>00179 {
-<a name="l00180"></a>00180     cpl_recipe *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00181"></a>00181     cpl_plugin *   plugin = &recipe->interface ;
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     cpl_plugin_init(plugin,
-<a name="l00184"></a>00184                     CPL_PLUGIN_API,
-<a name="l00185"></a>00185                     HAWKI_BINARY_VERSION,
-<a name="l00186"></a>00186                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00187"></a>00187                     <span class="stringliteral">"hawki_cal_distortion"</span>,
-<a name="l00188"></a>00188                     <span class="stringliteral">"Distortion autocalibration"</span>,
-<a name="l00189"></a>00189                     hawki_cal_distortion_description,
-<a name="l00190"></a>00190                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00191"></a>00191                     PACKAGE_BUGREPORT,
-<a name="l00192"></a>00192                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00193"></a>00193                     hawki_cal_distortion_create,
-<a name="l00194"></a>00194                     hawki_cal_distortion_exec,
-<a name="l00195"></a>00195                     hawki_cal_distortion_destroy);
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     cpl_pluginlist_append(list, plugin) ;
-<a name="l00198"></a>00198     
-<a name="l00199"></a>00199     <span class="keywordflow">return</span> 0;
-<a name="l00200"></a>00200 }
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00211"></a>00211 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00212"></a>00212 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_create(cpl_plugin * plugin)
-<a name="l00213"></a>00213 {
-<a name="l00214"></a>00214     cpl_recipe *   recipe ;
-<a name="l00215"></a>00215     cpl_parameter   * p ;
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00218"></a>00218     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00219"></a>00219         recipe = (cpl_recipe *)plugin ;
-<a name="l00220"></a>00220     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00223"></a>00223     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00224"></a>00224     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00225"></a>00225         <span class="keywordflow">return</span> 1;
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00228"></a>00228     <span class="comment">/* --sigma_det */</span>
-<a name="l00229"></a>00229     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.sigma_det"</span>, 
-<a name="l00230"></a>00230                                 CPL_TYPE_DOUBLE, <span class="stringliteral">"detection level"</span>,
-<a name="l00231"></a>00231                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 6.) ;
-<a name="l00232"></a>00232     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_det"</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="comment">/* --grid_points */</span>
-<a name="l00237"></a>00237     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.grid_points"</span>, 
-<a name="l00238"></a>00238                                 CPL_TYPE_INT,
-<a name="l00239"></a>00239                                 <span class="stringliteral">"number of points in distortion grid"</span>,
-<a name="l00240"></a>00240                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 9) ;
-<a name="l00241"></a>00241     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"grid_points"</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">/* --borders */</span>
-<a name="l00246"></a>00246     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.borders"</span>, 
-<a name="l00247"></a>00247                                 CPL_TYPE_INT,
-<a name="l00248"></a>00248                                 <span class="stringliteral">"number of pixels to trim at the borders"</span>,
-<a name="l00249"></a>00249                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 6) ;
-<a name="l00250"></a>00250     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"borders"</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">/* --subtract_linear */</span>
-<a name="l00255"></a>00255     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.subtract_linear"</span>, 
-<a name="l00256"></a>00256                                 CPL_TYPE_BOOL,
-<a name="l00257"></a>00257                                 <span class="stringliteral">"Subtract a linear term to the solution"</span>,
-<a name="l00258"></a>00258                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, TRUE) ;
-<a name="l00259"></a>00259     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"subtract_linear"</span>) ;
-<a name="l00260"></a>00260     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00261"></a>00261     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00273"></a>00273 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00274"></a>00274 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_exec(cpl_plugin * plugin)
-<a name="l00275"></a>00275 {
-<a name="l00276"></a>00276     cpl_recipe  *   recipe ;
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00279"></a>00279     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00280"></a>00280         recipe = (cpl_recipe *)plugin ;
-<a name="l00281"></a>00281     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     <span class="comment">/* Issue a banner */</span>
-<a name="l00284"></a>00284     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     <span class="keywordflow">return</span> hawki_cal_distortion(recipe->parameters, recipe->frames) ;
-<a name="l00287"></a>00287 }
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00295"></a>00295 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00296"></a>00296 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_destroy(cpl_plugin * plugin)
-<a name="l00297"></a>00297 {
-<a name="l00298"></a>00298     cpl_recipe  *   recipe ;
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00306"></a>00306     <span class="keywordflow">return</span> 0 ;
-<a name="l00307"></a>00307 }
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00315"></a>00315 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00316"></a>00316 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion(cpl_parameterlist *   parlist,
-<a name="l00317"></a>00317                                 cpl_frameset *        frameset)
-<a name="l00318"></a>00318 {
-<a name="l00319"></a>00319     <span class="keyword">const</span> cpl_frame  *  flat = NULL;
-<a name="l00320"></a>00320     <span class="keyword">const</span> cpl_frame  *  dark = NULL;
-<a name="l00321"></a>00321     <span class="keyword">const</span> cpl_frame  *  bpm = NULL;
-<a name="l00322"></a>00322     cpl_frameset     *  distorframes = NULL;
-<a name="l00323"></a>00323     cpl_frameset     *  skyframes = NULL;
-<a name="l00324"></a>00324     <span class="keyword">const</span> cpl_frame  *  distorxguess = NULL;
-<a name="l00325"></a>00325     <span class="keyword">const</span> cpl_frame  *  distoryguess = NULL;
-<a name="l00326"></a>00326     hawki_distortion ** distortionguess = NULL;
-<a name="l00327"></a>00327     hawki_distortion ** distortion = NULL;
-<a name="l00328"></a>00328     cpl_propertylist ** qclists = NULL;
-<a name="l00329"></a>00329     cpl_image        ** master_sky = NULL;
-<a name="l00330"></a>00330     cpl_bivector     *  nominal_offsets = NULL;
-<a name="l00331"></a>00331     cpl_apertures    ** apertures[HAWKI_NB_DETECTORS];
-<a name="l00332"></a>00332     <span class="keywordtype">int</span>                 nmatched_pairs[HAWKI_NB_DETECTORS];
-<a name="l00333"></a>00333     <span class="keywordtype">double</span>              rms[HAWKI_NB_DETECTORS];
-<a name="l00334"></a>00334     <span class="keywordtype">int</span>                 idet;
-<a name="l00335"></a>00335     <span class="keywordtype">int</span>                 ioff;
-<a name="l00336"></a>00336     <span class="keywordtype">int</span>                 iframe;
-<a name="l00337"></a>00337     <span class="keywordtype">int</span>                 nframes;
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00341"></a>00341     <span class="keywordflow">if</span>(hawki_cal_distortion_retrieve_input_param(parlist))
-<a name="l00342"></a>00342     {
-<a name="l00343"></a>00343         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00344"></a>00344         <span class="keywordflow">return</span> -1;
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00348"></a>00348     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00349"></a>00349         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00350"></a>00350         <span class="keywordflow">return</span> -1 ;
-<a name="l00351"></a>00351     }
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     <span class="comment">/* Retrieve calibration data */</span>
-<a name="l00354"></a>00354     cpl_msg_info(__func__, <span class="stringliteral">"Identifying calibration data"</span>);
-<a name="l00355"></a>00355     flat   = cpl_frameset_find_const(frameset, HAWKI_CALPRO_FLAT);
-<a name="l00356"></a>00356     dark   = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DARK);
-<a name="l00357"></a>00357     bpm    = cpl_frameset_find_const(frameset, HAWKI_CALPRO_BPM);
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00360"></a>00360     cpl_msg_info(__func__, <span class="stringliteral">"Identifying distortion and sky data"</span>);
-<a name="l00361"></a>00361     distorframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DISTOR_RAW) ;
-<a name="l00362"></a>00362     <span class="keywordflow">if</span> (distorframes == NULL)
-<a name="l00363"></a>00363     {
-<a name="l00364"></a>00364         cpl_msg_error(__func__, <span class="stringliteral">"Distortion images have to be provided (%s)"</span>,
-<a name="l00365"></a>00365                       HAWKI_CAL_DISTOR_RAW);
-<a name="l00366"></a>00366         <span class="keywordflow">return</span> -1 ;
-<a name="l00367"></a>00367     }
-<a name="l00368"></a>00368     <span class="comment">/* Retrieve sky frames */</span>
-<a name="l00369"></a>00369     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DISTOR_SKY_RAW) ;
-<a name="l00370"></a>00370     <span class="keywordflow">if</span> (skyframes == NULL)
-<a name="l00371"></a>00371     {
-<a name="l00372"></a>00372         cpl_msg_error(__func__, <span class="stringliteral">"Sky images have to be provided (%s)"</span>,
-<a name="l00373"></a>00373                       HAWKI_CAL_DISTOR_SKY_RAW);
-<a name="l00374"></a>00374         cpl_frameset_delete(distorframes);
-<a name="l00375"></a>00375         <span class="keywordflow">return</span> -1 ;
-<a name="l00376"></a>00376     }
-<a name="l00377"></a>00377     <span class="comment">/* Retrieve the distortion first guess (if provided) */</span>
-<a name="l00378"></a>00378     distorxguess = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DISTORTION_X);
-<a name="l00379"></a>00379     distoryguess = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00380"></a>00380     <span class="keywordflow">if</span>(distorxguess != NULL && distoryguess != NULL)
-<a name="l00381"></a>00381     {
-<a name="l00382"></a>00382         <span class="comment">//distortionguess = hawki_distortion_load(distorxtguess)</span>
-<a name="l00383"></a>00383     }
-<a name="l00384"></a>00384     
-<a name="l00385"></a>00385     <span class="comment">/* Get the master sky frame */</span>
-<a name="l00386"></a>00386     cpl_msg_info(__func__, <span class="stringliteral">"Computing the master sky image"</span>);
-<a name="l00387"></a>00387     master_sky = hawki_cal_distortion_get_master_sky(skyframes, flat, dark, bpm);
-<a name="l00388"></a>00388     <span class="keywordflow">if</span>(master_sky == NULL)
-<a name="l00389"></a>00389     {
-<a name="l00390"></a>00390         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get master sky image"</span>) ;
-<a name="l00391"></a>00391         cpl_frameset_delete(distorframes);
-<a name="l00392"></a>00392         cpl_frameset_delete(skyframes);
-<a name="l00393"></a>00393         <span class="keywordflow">return</span> -1;        
-<a name="l00394"></a>00394     }
-<a name="l00395"></a>00395     
-<a name="l00396"></a>00396     <span class="comment">/* Aperture detection, basic reduction and sky subtraction of distortion images */</span>
-<a name="l00397"></a>00397     cpl_msg_info(__func__, <span class="stringliteral">"Getting objects from distortion images"</span>);
-<a name="l00398"></a>00398     <span class="keywordflow">if</span>(hawki_cal_distortion_get_apertures_from_raw_distor
-<a name="l00399"></a>00399        (distorframes, flat, dark, bpm, master_sky,
-<a name="l00400"></a>00400         hawki_cal_distortion_config.sigma_det, apertures) == -1)
-<a name="l00401"></a>00401     {
-<a name="l00402"></a>00402         cpl_msg_error(__func__, 
-<a name="l00403"></a>00403                 <span class="stringliteral">"Cannot get objects from distortion images"</span>);
-<a name="l00404"></a>00404         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00405"></a>00405             cpl_image_delete(master_sky[idet]);
-<a name="l00406"></a>00406         cpl_free(master_sky);
-<a name="l00407"></a>00407         cpl_frameset_delete(distorframes);
-<a name="l00408"></a>00408         cpl_frameset_delete(skyframes);
-<a name="l00409"></a>00409         <span class="keywordflow">return</span> -1 ;        
-<a name="l00410"></a>00410     }
-<a name="l00411"></a>00411     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00412"></a>00412         cpl_image_delete(master_sky[idet]);
-<a name="l00413"></a>00413     cpl_free(master_sky);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="comment">/* Get the nominal offsets from the header */</span>
-<a name="l00416"></a>00416     cpl_msg_info(__func__,<span class="stringliteral">"Getting the nominal offsets"</span>);
-<a name="l00417"></a>00417     nominal_offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(distorframes); 
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (nominal_offsets  == NULL) 
-<a name="l00419"></a>00419     {
-<a name="l00420"></a>00420         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>) ;
-<a name="l00421"></a>00421         cpl_frameset_delete(distorframes);
-<a name="l00422"></a>00422         cpl_frameset_delete(skyframes);
-<a name="l00423"></a>00423         <span class="keywordflow">return</span> -1;
-<a name="l00424"></a>00424     }
-<a name="l00425"></a>00425     
-<a name="l00426"></a>00426     <span class="comment">/* Get the oposite offsets. This is to change from </span>
-<a name="l00427"></a>00427 <span class="comment">     * telescope convention to cpl convention */</span>
-<a name="l00428"></a>00428     cpl_vector_multiply_scalar(cpl_bivector_get_x(nominal_offsets), -1.0);
-<a name="l00429"></a>00429     cpl_vector_multiply_scalar(cpl_bivector_get_y(nominal_offsets), -1.0);
-<a name="l00430"></a>00430     
-<a name="l00431"></a>00431     <span class="comment">/* Print the header offsets */</span>
-<a name="l00432"></a>00432     cpl_msg_indent_more();
-<a name="l00433"></a>00433     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) 
-<a name="l00434"></a>00434     {
-<a name="l00435"></a>00435         cpl_msg_info(__func__, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,
-<a name="l00436"></a>00436                 cpl_bivector_get_x_data(nominal_offsets)[ioff],
-<a name="l00437"></a>00437                 cpl_bivector_get_y_data(nominal_offsets)[ioff]);
-<a name="l00438"></a>00438     }
-<a name="l00439"></a>00439     cpl_msg_indent_less();
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     <span class="comment">/* Get the distortion solution, the real stuff */</span>
-<a name="l00442"></a>00442     cpl_msg_info(__func__, <span class="stringliteral">"Computing the distortion"</span>);
-<a name="l00443"></a>00443     nframes = cpl_frameset_get_size(distorframes);
-<a name="l00444"></a>00444     distortion = hawki_cal_distortion_compute_dist_solution
-<a name="l00445"></a>00445         (apertures, nframes, nominal_offsets,
-<a name="l00446"></a>00446          hawki_cal_distortion_config.grid_points,
-<a name="l00447"></a>00447          nmatched_pairs, rms,
-<a name="l00448"></a>00448          distortionguess);
-<a name="l00449"></a>00449     cpl_bivector_delete(nominal_offsets);
-<a name="l00450"></a>00450     <span class="keywordflow">if</span>(distortion  == NULL)
-<a name="l00451"></a>00451     {
-<a name="l00452"></a>00452         cpl_frameset_delete(distorframes);
-<a name="l00453"></a>00453         cpl_frameset_delete(skyframes);
-<a name="l00454"></a>00454         <span class="keywordflow">return</span> -1;        
-<a name="l00455"></a>00455     }
-<a name="l00456"></a>00456     
-<a name="l00457"></a>00457     <span class="comment">/* Get some QC */</span>
-<a name="l00458"></a>00458     qclists =  hawki_cal_distortion_qc(distortion, nmatched_pairs, rms);
-<a name="l00459"></a>00459     
-<a name="l00460"></a>00460     <span class="comment">/* Save the products */</span>
-<a name="l00461"></a>00461     cpl_msg_info(__func__,<span class="stringliteral">"Saving products"</span>);
-<a name="l00462"></a>00462     <span class="keywordflow">if</span>(hawki_cal_distortion_save(distortion,
-<a name="l00463"></a>00463                                  parlist, qclists, frameset) == -1)
-<a name="l00464"></a>00464     {
-<a name="l00465"></a>00465         cpl_msg_error(__func__,<span class="stringliteral">"Could not save products"</span>);
-<a name="l00466"></a>00466         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00467"></a>00467             cpl_propertylist_delete(qclists[idet]);
-<a name="l00468"></a>00468         cpl_free(qclists);
-<a name="l00469"></a>00469         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00470"></a>00470             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);
-<a name="l00471"></a>00471         cpl_free(distortion);
-<a name="l00472"></a>00472         cpl_frameset_delete(distorframes);
-<a name="l00473"></a>00473         cpl_frameset_delete(skyframes);
-<a name="l00474"></a>00474         <span class="keywordflow">return</span> -1;
-<a name="l00475"></a>00475     }
-<a name="l00476"></a>00476     
-<a name="l00477"></a>00477     <span class="comment">/* Free and return */</span>
-<a name="l00478"></a>00478     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00479"></a>00479         cpl_propertylist_delete(qclists[idet]);
-<a name="l00480"></a>00480     cpl_free(qclists);
-<a name="l00481"></a>00481     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00482"></a>00482         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);
-<a name="l00483"></a>00483     cpl_free(distortion);
-<a name="l00484"></a>00484     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00485"></a>00485     {
-<a name="l00486"></a>00486         <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes; iframe++)
-<a name="l00487"></a>00487             cpl_apertures_delete(apertures[idet][iframe]);
-<a name="l00488"></a>00488         cpl_free(apertures[idet]);
-<a name="l00489"></a>00489     }
-<a name="l00490"></a>00490     cpl_frameset_delete(distorframes);
-<a name="l00491"></a>00491     cpl_frameset_delete(skyframes);
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     <span class="comment">/* Return */</span>
-<a name="l00495"></a>00495     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00496"></a>00496     {
-<a name="l00497"></a>00497         cpl_msg_error(__func__,
-<a name="l00498"></a>00498                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00499"></a>00499         <span class="keywordflow">return</span> -1 ;
-<a name="l00500"></a>00500     }
-<a name="l00501"></a>00501     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00502"></a>00502 }
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504 <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">int</span> hawki_cal_distortion_load_master_calib
-<a name="l00517"></a>00517 (<span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00518"></a>00518  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00519"></a>00519  <span class="keyword">const</span> cpl_frame   *  bpm,
-<a name="l00520"></a>00520  cpl_imagelist     ** flat_images,
-<a name="l00521"></a>00521  cpl_imagelist     ** dark_images,
-<a name="l00522"></a>00522  cpl_imagelist     ** bpm_images)
-<a name="l00523"></a>00523 {
-<a name="l00524"></a>00524     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00525"></a>00525     
-<a name="l00526"></a>00526     <span class="comment">/* Initializing the pointers */</span>
-<a name="l00527"></a>00527     *flat_images = NULL;
-<a name="l00528"></a>00528     *dark_images = NULL;
-<a name="l00529"></a>00529     *bpm_images  = NULL;
-<a name="l00530"></a>00530     
-<a name="l00531"></a>00531     <span class="comment">/* Loading the calibration files */</span>
-<a name="l00532"></a>00532     cpl_msg_info(__func__, <span class="stringliteral">"Loading the calibration data"</span>) ;
-<a name="l00533"></a>00533     <span class="keywordflow">if</span>(flat != NULL)
-<a name="l00534"></a>00534     {
-<a name="l00535"></a>00535         *flat_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(flat, CPL_TYPE_FLOAT);
-<a name="l00536"></a>00536         <span class="keywordflow">if</span>(flat_images == NULL)
-<a name="l00537"></a>00537         {
-<a name="l00538"></a>00538             cpl_msg_error(__func__, <span class="stringliteral">"Error reading flat"</span>) ;
-<a name="l00539"></a>00539             <span class="keywordflow">return</span> -1;
-<a name="l00540"></a>00540         }
-<a name="l00541"></a>00541     }
-<a name="l00542"></a>00542     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l00543"></a>00543     {
-<a name="l00544"></a>00544         *dark_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(dark, CPL_TYPE_FLOAT);
-<a name="l00545"></a>00545         <span class="keywordflow">if</span>(dark_images == NULL)
-<a name="l00546"></a>00546         {
-<a name="l00547"></a>00547             cpl_msg_error(__func__, <span class="stringliteral">"Error reading dark"</span>) ;
-<a name="l00548"></a>00548             cpl_imagelist_delete(*flat_images);
-<a name="l00549"></a>00549             <span class="keywordflow">return</span> -1;
-<a name="l00550"></a>00550         }
-<a name="l00551"></a>00551     }
-<a name="l00552"></a>00552     <span class="keywordflow">if</span>(bpm != NULL)
-<a name="l00553"></a>00553     {
-<a name="l00554"></a>00554         *bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm, CPL_TYPE_INT);
-<a name="l00555"></a>00555         <span class="keywordflow">if</span>(bpm_images == NULL)
-<a name="l00556"></a>00556         {
-<a name="l00557"></a>00557             cpl_msg_error(__func__, <span class="stringliteral">"Error reading bpm"</span>) ;
-<a name="l00558"></a>00558             cpl_imagelist_delete(*flat_images);
-<a name="l00559"></a>00559             cpl_imagelist_delete(*dark_images);
-<a name="l00560"></a>00560             <span class="keywordflow">return</span> -1;
-<a name="l00561"></a>00561         }
-<a name="l00562"></a>00562     }
-<a name="l00563"></a>00563     
-<a name="l00564"></a>00564     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l00565"></a>00565     {
-<a name="l00566"></a>00566         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened loading calibration"</span>);
-<a name="l00567"></a>00567         cpl_imagelist_delete(*flat_images);
-<a name="l00568"></a>00568         cpl_imagelist_delete(*dark_images);
-<a name="l00569"></a>00569         cpl_imagelist_delete(*bpm_images);
-<a name="l00570"></a>00570         <span class="keywordflow">return</span> -1;
-<a name="l00571"></a>00571     }
-<a name="l00572"></a>00572     <span class="keywordflow">return</span> 0;
-<a name="l00573"></a>00573 }
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00585"></a>00585 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00586"></a>00586 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_get_apertures_from_raw_distor
-<a name="l00587"></a>00587 (cpl_frameset      *   raw_distor,
-<a name="l00588"></a>00588  <span class="keyword">const</span> cpl_frame   *   flat,
-<a name="l00589"></a>00589  <span class="keyword">const</span> cpl_frame   *   dark,
-<a name="l00590"></a>00590  <span class="keyword">const</span> cpl_frame   *   bpm,
-<a name="l00591"></a>00591  cpl_image         **  master_sky,
-<a name="l00592"></a>00592  <span class="keywordtype">double</span>                sigma_det,
-<a name="l00593"></a>00593  cpl_apertures     *** apertures)
-<a name="l00594"></a>00594 {
-<a name="l00595"></a>00595     cpl_imagelist    *  flat_images;
-<a name="l00596"></a>00596     cpl_imagelist    *  dark_images;
-<a name="l00597"></a>00597     cpl_imagelist    *  bpm_images;
-<a name="l00598"></a>00598     cpl_propertylist *  plist;
-<a name="l00599"></a>00599     
-<a name="l00600"></a>00600     <span class="keywordtype">double</span>              science_dit;
-<a name="l00601"></a>00601     <span class="keywordtype">int</span>                 iframe;
-<a name="l00602"></a>00602     <span class="keywordtype">int</span>                 nframes;
-<a name="l00603"></a>00603     <span class="keywordtype">int</span>                 idet;
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00606"></a>00606     
-<a name="l00607"></a>00607     <span class="comment">/* Indentation */</span>
-<a name="l00608"></a>00608     cpl_msg_indent_more();
-<a name="l00609"></a>00609     
-<a name="l00610"></a>00610     <span class="comment">/* Loading calibrations */</span>
-<a name="l00611"></a>00611     hawki_cal_distortion_load_master_calib
-<a name="l00612"></a>00612         (flat, dark, bpm, &flat_images, &dark_images, &bpm_images);
-<a name="l00613"></a>00613     
-<a name="l00614"></a>00614     <span class="comment">/* Multiply the dark image by the science exposure time */</span>
-<a name="l00615"></a>00615     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l00616"></a>00616     {
-<a name="l00617"></a>00617         <span class="keywordflow">if</span> ((plist=cpl_propertylist_load
-<a name="l00618"></a>00618                 (cpl_frame_get_filename
-<a name="l00619"></a>00619                  (cpl_frameset_get_first_const(raw_distor)), 0)) == NULL) 
-<a name="l00620"></a>00620         {
-<a name="l00621"></a>00621             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);
-<a name="l00622"></a>00622             cpl_imagelist_delete(flat_images);
-<a name="l00623"></a>00623             cpl_imagelist_delete(dark_images);
-<a name="l00624"></a>00624             <span class="keywordflow">return</span> -1;
-<a name="l00625"></a>00625         }
-<a name="l00626"></a>00626         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);
-<a name="l00627"></a>00627         cpl_imagelist_multiply_scalar(dark_images, science_dit);
-<a name="l00628"></a>00628         cpl_propertylist_delete(plist);
-<a name="l00629"></a>00629     }
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     <span class="comment">/* Loop on detectors */</span>
-<a name="l00632"></a>00632     nframes = cpl_frameset_get_size(raw_distor);
-<a name="l00633"></a>00633     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00634"></a>00634     {
-<a name="l00635"></a>00635         cpl_imagelist * distor_serie;
-<a name="l00636"></a>00636         cpl_imagelist * distor_serie_trimmed;
-<a name="l00637"></a>00637         
-<a name="l00638"></a>00638         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet + 1);
-<a name="l00639"></a>00639         cpl_msg_indent_more();
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641         <span class="comment">/* Loading the distortion images for one detector */</span>
-<a name="l00642"></a>00642         cpl_msg_info(__func__, <span class="stringliteral">"Loading distortion images"</span>);
-<a name="l00643"></a>00643         distor_serie = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw_distor, idet + 1, CPL_TYPE_FLOAT);
-<a name="l00644"></a>00644         <span class="keywordflow">if</span>(distor_serie== NULL)
-<a name="l00645"></a>00645         {
-<a name="l00646"></a>00646             cpl_msg_error(__func__, <span class="stringliteral">"Error reading distortion images"</span>);
-<a name="l00647"></a>00647             <span class="keywordflow">return</span> -1;
-<a name="l00648"></a>00648         } 
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650         <span class="comment">/* Applying the calibrations */</span>
-<a name="l00651"></a>00651         cpl_msg_info(__func__, <span class="stringliteral">"Applying basic calibration"</span>) ;
-<a name="l00652"></a>00652         cpl_msg_indent_more();
-<a name="l00653"></a>00653         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>
-<a name="l00654"></a>00654                 (distor_serie,
-<a name="l00655"></a>00655                  cpl_imagelist_get(flat_images, idet),
-<a name="l00656"></a>00656                  cpl_imagelist_get(dark_images, idet),
-<a name="l00657"></a>00657                  cpl_imagelist_get(bpm_images, idet)) == -1)
-<a name="l00658"></a>00658         {
-<a name="l00659"></a>00659             cpl_msg_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;
-<a name="l00660"></a>00660             cpl_imagelist_delete(flat_images);
-<a name="l00661"></a>00661             cpl_imagelist_delete(dark_images);
-<a name="l00662"></a>00662             cpl_imagelist_delete(bpm_images);
-<a name="l00663"></a>00663             cpl_imagelist_delete(distor_serie);
-<a name="l00664"></a>00664             cpl_msg_indent_less() ;
-<a name="l00665"></a>00665             <span class="keywordflow">return</span> -1;
-<a name="l00666"></a>00666         }
-<a name="l00667"></a>00667         cpl_msg_indent_less();
-<a name="l00668"></a>00668         
-<a name="l00669"></a>00669         <span class="comment">/* Discard the pixels on the sides */</span>
-<a name="l00670"></a>00670         <span class="keywordflow">if</span> (hawki_cal_distortion_config.borders > 0) 
-<a name="l00671"></a>00671         {
-<a name="l00672"></a>00672           distor_serie_trimmed = <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>(distor_serie,
-<a name="l00673"></a>00673                                  hawki_cal_distortion_config.borders);
-<a name="l00674"></a>00674           cpl_imagelist_delete(distor_serie);
-<a name="l00675"></a>00675         }
-<a name="l00676"></a>00676         <span class="keywordflow">else</span>
-<a name="l00677"></a>00677           distor_serie_trimmed = distor_serie;
-<a name="l00678"></a>00678 
-<a name="l00679"></a>00679         <span class="comment">/* Subtract sky */</span>
-<a name="l00680"></a>00680         cpl_msg_info(__func__, <span class="stringliteral">"Subtracting master sky"</span>) ;
-<a name="l00681"></a>00681         <span class="keywordflow">if</span>(hawki_cal_distortion_subtract_sky(distor_serie_trimmed, master_sky[idet]) == -1)
-<a name="l00682"></a>00682         {
-<a name="l00683"></a>00683             cpl_msg_error(__func__, <span class="stringliteral">"Cannot subtract the sky"</span>) ;
-<a name="l00684"></a>00684             cpl_imagelist_delete(flat_images);
-<a name="l00685"></a>00685             cpl_imagelist_delete(dark_images);
-<a name="l00686"></a>00686             cpl_imagelist_delete(bpm_images);
-<a name="l00687"></a>00687             cpl_imagelist_delete(distor_serie_trimmed);
-<a name="l00688"></a>00688             <span class="keywordflow">return</span> -1;        
-<a name="l00689"></a>00689         }
-<a name="l00690"></a>00690 
-<a name="l00691"></a>00691         <span class="comment">/* Creating apertures */</span>
-<a name="l00692"></a>00692         apertures[idet] = cpl_malloc(<span class="keyword">sizeof</span>(*(apertures[idet])) * nframes);
-<a name="l00693"></a>00693         <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes; iframe++)
-<a name="l00694"></a>00694         {
-<a name="l00695"></a>00695             cpl_image * this_image = cpl_imagelist_get(distor_serie_trimmed, iframe);
-<a name="l00696"></a>00696             cpl_msg_info(__func__,<span class="stringliteral">"Working with distortion image %d"</span>, iframe+1);
-<a name="l00697"></a>00697             cpl_msg_indent_more();
-<a name="l00698"></a>00698             apertures[idet][iframe] = 
-<a name="l00699"></a>00699                     hawki_cal_distortion_get_image_apertures(this_image, sigma_det);
-<a name="l00700"></a>00700             cpl_msg_indent_less();
-<a name="l00701"></a>00701         }
-<a name="l00702"></a>00702         
-<a name="l00703"></a>00703         <span class="comment">/* Delete the list of images */</span>
-<a name="l00704"></a>00704         cpl_imagelist_delete(distor_serie_trimmed);
-<a name="l00705"></a>00705         cpl_msg_indent_less();
-<a name="l00706"></a>00706     }
-<a name="l00707"></a>00707     cpl_imagelist_delete(flat_images);
-<a name="l00708"></a>00708     cpl_imagelist_delete(dark_images);
-<a name="l00709"></a>00709     cpl_imagelist_delete(bpm_images);
-<a name="l00710"></a>00710     
-<a name="l00711"></a>00711     
-<a name="l00712"></a>00712     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l00713"></a>00713     {
-<a name="l00714"></a>00714         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened with basic calibration"</span>);
-<a name="l00715"></a>00715         <span class="keywordflow">return</span> -1 ;
-<a name="l00716"></a>00716     }
-<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="keyword">static</span> cpl_image **  hawki_cal_distortion_get_master_sky
-<a name="l00721"></a>00721 (cpl_frameset      *  raw_sky_frames,
-<a name="l00722"></a>00722  <span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00723"></a>00723  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00724"></a>00724  <span class="keyword">const</span> cpl_frame   *  bpm)
-<a name="l00725"></a>00725 {
-<a name="l00726"></a>00726     cpl_propertylist *  plist;
-<a name="l00727"></a>00727     <span class="keywordtype">double</span>              science_dit;
-<a name="l00728"></a>00728     <span class="keywordtype">int</span>                 idet;
-<a name="l00729"></a>00729     <span class="keywordtype">int</span>                 jdet;
-<a name="l00730"></a>00730     cpl_imagelist    *  flat_images;
-<a name="l00731"></a>00731     cpl_imagelist    *  dark_images;
-<a name="l00732"></a>00732     cpl_imagelist    *  bpm_images;
-<a name="l00733"></a>00733     cpl_image        ** bkg_images = NULL;
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     <span class="comment">/* Indentation */</span>
-<a name="l00738"></a>00738     cpl_msg_indent_more();
-<a name="l00739"></a>00739     
-<a name="l00740"></a>00740     <span class="comment">/* Reading calibrations */</span>
-<a name="l00741"></a>00741     hawki_cal_distortion_load_master_calib
-<a name="l00742"></a>00742         (flat, dark, bpm, &flat_images, &dark_images, &bpm_images);
-<a name="l00743"></a>00743     
-<a name="l00744"></a>00744     <span class="comment">/* Multiply the dark image by the science exposure time */</span>
-<a name="l00745"></a>00745     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l00746"></a>00746     {
-<a name="l00747"></a>00747         <span class="keywordflow">if</span> ((plist=cpl_propertylist_load
-<a name="l00748"></a>00748                 (cpl_frame_get_filename
-<a name="l00749"></a>00749                  (cpl_frameset_get_first_const(raw_sky_frames)), 0)) == NULL) 
-<a name="l00750"></a>00750         {
-<a name="l00751"></a>00751             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);
-<a name="l00752"></a>00752             cpl_imagelist_delete(flat_images);
-<a name="l00753"></a>00753             cpl_imagelist_delete(dark_images);
-<a name="l00754"></a>00754             cpl_imagelist_delete(bpm_images);
-<a name="l00755"></a>00755             <span class="keywordflow">return</span> NULL;
-<a name="l00756"></a>00756         }
-<a name="l00757"></a>00757         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);
-<a name="l00758"></a>00758         cpl_imagelist_multiply_scalar(dark_images, science_dit);
-<a name="l00759"></a>00759         cpl_propertylist_delete(plist);
-<a name="l00760"></a>00760     }
-<a name="l00761"></a>00761 
-<a name="l00762"></a>00762     <span class="comment">/* Compute the sky median */</span>
-<a name="l00763"></a>00763     bkg_images = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(*bkg_images));
-<a name="l00764"></a>00764     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00765"></a>00765     {
-<a name="l00766"></a>00766         cpl_imagelist * sky_serie;
-<a name="l00767"></a>00767         cpl_imagelist * sky_serie_trimmed;
-<a name="l00768"></a>00768         
-<a name="l00769"></a>00769         <span class="comment">/* Loading the sky images for one detector */</span>
-<a name="l00770"></a>00770         sky_serie = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw_sky_frames, idet + 1, CPL_TYPE_FLOAT);
-<a name="l00771"></a>00771         <span class="keywordflow">if</span>(sky_serie== NULL)
-<a name="l00772"></a>00772         {
-<a name="l00773"></a>00773             cpl_msg_error(__func__, <span class="stringliteral">"Error reading object image"</span>) ;
-<a name="l00774"></a>00774             <span class="keywordflow">return</span> NULL;
-<a name="l00775"></a>00775         }
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777         <span class="comment">/* Applying the calibrations */</span>
-<a name="l00778"></a>00778         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet + 1);
-<a name="l00779"></a>00779         cpl_msg_indent_more();
-<a name="l00780"></a>00780         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>
-<a name="l00781"></a>00781                 (sky_serie,
-<a name="l00782"></a>00782                  cpl_imagelist_get(flat_images, idet),
-<a name="l00783"></a>00783                  cpl_imagelist_get(dark_images, idet),
-<a name="l00784"></a>00784                  cpl_imagelist_get(bpm_images, idet)) == -1)
-<a name="l00785"></a>00785         {
-<a name="l00786"></a>00786             cpl_msg_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;
-<a name="l00787"></a>00787             cpl_imagelist_delete(flat_images);
-<a name="l00788"></a>00788             cpl_imagelist_delete(dark_images);
-<a name="l00789"></a>00789             cpl_imagelist_delete(bpm_images);
-<a name="l00790"></a>00790             cpl_imagelist_delete(sky_serie);
-<a name="l00791"></a>00791             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00792"></a>00792                 cpl_image_delete(bkg_images[jdet]);
-<a name="l00793"></a>00793             cpl_free(bkg_images);
-<a name="l00794"></a>00794             cpl_msg_indent_less() ;
-<a name="l00795"></a>00795             <span class="keywordflow">return</span> NULL;
-<a name="l00796"></a>00796         }
-<a name="l00797"></a>00797         
-<a name="l00798"></a>00798         <span class="comment">/* Discard the pixels on the sides */</span>
-<a name="l00799"></a>00799         <span class="keywordflow">if</span> (hawki_cal_distortion_config.borders > 0) 
-<a name="l00800"></a>00800         {
-<a name="l00801"></a>00801           sky_serie_trimmed = <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>(sky_serie,
-<a name="l00802"></a>00802                           hawki_cal_distortion_config.borders);
-<a name="l00803"></a>00803           cpl_imagelist_delete(sky_serie);
-<a name="l00804"></a>00804         }
-<a name="l00805"></a>00805         <span class="keywordflow">else</span>
-<a name="l00806"></a>00806           sky_serie_trimmed = sky_serie;
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808         <span class="comment">/* Averaging */</span>
-<a name="l00809"></a>00809         <span class="keywordflow">if</span> ((bkg_images[idet] =
-<a name="l00810"></a>00810                 cpl_imagelist_collapse_median_create(sky_serie_trimmed))  == NULL) 
-<a name="l00811"></a>00811         {
-<a name="l00812"></a>00812             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the median of obj images"</span>);
-<a name="l00813"></a>00813             cpl_imagelist_delete(flat_images);
-<a name="l00814"></a>00814             cpl_imagelist_delete(dark_images);
-<a name="l00815"></a>00815             cpl_imagelist_delete(bpm_images);
-<a name="l00816"></a>00816             cpl_imagelist_delete(sky_serie_trimmed);
-<a name="l00817"></a>00817             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00818"></a>00818                 cpl_image_delete(bkg_images[jdet]);
-<a name="l00819"></a>00819             cpl_free(bkg_images);
-<a name="l00820"></a>00820             cpl_msg_indent_less();
-<a name="l00821"></a>00821             <span class="keywordflow">return</span> NULL;
-<a name="l00822"></a>00822         }
-<a name="l00823"></a>00823         cpl_imagelist_delete(sky_serie_trimmed);
-<a name="l00824"></a>00824         cpl_msg_indent_less();
-<a name="l00825"></a>00825     }
-<a name="l00826"></a>00826     
-<a name="l00827"></a>00827     <span class="comment">/* Subtract the median of the frame */</span>
-<a name="l00828"></a>00828     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00829"></a>00829         cpl_image_subtract_scalar(bkg_images[idet],
-<a name="l00830"></a>00830                                   cpl_image_get_median(bkg_images[idet]));
-<a name="l00831"></a>00831     
-<a name="l00832"></a>00832     <span class="comment">/* Cleaning up */</span>
-<a name="l00833"></a>00833     cpl_msg_indent_less();
-<a name="l00834"></a>00834     cpl_imagelist_delete(flat_images);
-<a name="l00835"></a>00835     cpl_imagelist_delete(dark_images);
-<a name="l00836"></a>00836     cpl_imagelist_delete(bpm_images);
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l00839"></a>00839     {
-<a name="l00840"></a>00840         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened with basic calibration"</span>);
-<a name="l00841"></a>00841         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00842"></a>00842             cpl_image_delete(bkg_images[idet]);
-<a name="l00843"></a>00843         cpl_free(bkg_images);
-<a name="l00844"></a>00844         <span class="keywordflow">return</span> NULL ;
-<a name="l00845"></a>00845     }
-<a name="l00846"></a>00846    <span class="keywordflow">return</span> bkg_images;
-<a name="l00847"></a>00847 }
-<a name="l00848"></a>00848 
-<a name="l00849"></a>00849 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_subtract_sky
-<a name="l00850"></a>00850 (cpl_imagelist * distor_corrected,
-<a name="l00851"></a>00851  cpl_image     * master_sky)
-<a name="l00852"></a>00852 {
-<a name="l00853"></a>00853     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00854"></a>00854 
-<a name="l00855"></a>00855     <span class="comment">/* Subtract the background to each object frame */</span>
-<a name="l00856"></a>00856     <span class="keywordtype">int</span> idist, ndistor;
-<a name="l00857"></a>00857     ndistor = cpl_imagelist_get_size(distor_corrected);
-<a name="l00858"></a>00858     <span class="keywordflow">for</span>(idist = 0; idist < ndistor; ++idist)
-<a name="l00859"></a>00859     {
-<a name="l00860"></a>00860         cpl_image * target_image =
-<a name="l00861"></a>00861             cpl_imagelist_get(distor_corrected, idist);
-<a name="l00862"></a>00862         <span class="comment">/* First subtract the median of the image */</span>
-<a name="l00863"></a>00863         cpl_image_subtract_scalar
-<a name="l00864"></a>00864             (target_image, cpl_image_get_median(target_image));
-<a name="l00865"></a>00865 
-<a name="l00866"></a>00866         <span class="keywordflow">if</span> (cpl_image_subtract
-<a name="l00867"></a>00867                 (target_image, master_sky)!=CPL_ERROR_NONE) 
-<a name="l00868"></a>00868         {
-<a name="l00869"></a>00869             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the bkg to the images"</span>);
-<a name="l00870"></a>00870             <span class="keywordflow">return</span> -1 ;
-<a name="l00871"></a>00871         }
-<a name="l00872"></a>00872     }
-<a name="l00873"></a>00873     
-<a name="l00874"></a>00874     <span class="comment">/* Free and return */</span>
-<a name="l00875"></a>00875     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l00876"></a>00876     {
-<a name="l00877"></a>00877         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened with sky subtraction"</span>);
-<a name="l00878"></a>00878         <span class="keywordflow">return</span> -1;
-<a name="l00879"></a>00879     }
-<a name="l00880"></a>00880    <span class="keywordflow">return</span> 0;
-<a name="l00881"></a>00881 }
-<a name="l00882"></a>00882 
-<a name="l00883"></a>00883 
-<a name="l00884"></a>00884 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00894"></a>00894 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00895"></a>00895 <span class="keyword">static</span> hawki_distortion  ** hawki_cal_distortion_compute_dist_solution
-<a name="l00896"></a>00896 (cpl_apertures    *** apertures,
-<a name="l00897"></a>00897  <span class="keywordtype">int</span>                  nframes,
-<a name="l00898"></a>00898  cpl_bivector     *   offsets,   
-<a name="l00899"></a>00899  <span class="keywordtype">int</span>                  grid_points,
-<a name="l00900"></a>00900  <span class="keywordtype">int</span>              *   nmatched_pairs,
-<a name="l00901"></a>00901  <span class="keywordtype">double</span>           *   rms,
-<a name="l00902"></a>00902  hawki_distortion **  distortion_guess)
-<a name="l00903"></a>00903 {
-<a name="l00904"></a>00904     <span class="keywordtype">int</span>                 idet;
-<a name="l00905"></a>00905     hawki_distortion ** distortion = NULL;
-<a name="l00906"></a>00906 
-<a name="l00907"></a>00907     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     <span class="comment">/* Allocate the distortion */</span>
-<a name="l00910"></a>00910     distortion = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(*distortion));
-<a name="l00911"></a>00911     
-<a name="l00912"></a>00912     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00913"></a>00913     cpl_msg_indent_more();
-<a name="l00914"></a>00914     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00915"></a>00915     {
-<a name="l00916"></a>00916         cpl_table       ** obj_pos;
-<a name="l00917"></a>00917         cpl_table       ** obj_pos_offset;
-<a name="l00918"></a>00918         <span class="keywordtype">int</span>                iframe;
-<a name="l00919"></a>00919         cpl_table        * matches;
-<a name="l00920"></a>00920         hawki_distortion * dist_guess;
-<a name="l00921"></a>00921         cpl_polynomial   * fit2d_x = NULL;
-<a name="l00922"></a>00922         cpl_polynomial   * fit2d_y = NULL;
-<a name="l00923"></a>00923 
-<a name="l00924"></a>00924         
-<a name="l00925"></a>00925         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet+1);
-<a name="l00926"></a>00926         cpl_msg_indent_more();
-<a name="l00927"></a>00927 
-<a name="l00928"></a>00928         <span class="comment">/* Initialize the objects positions */</span>
-<a name="l00929"></a>00929         obj_pos = 
-<a name="l00930"></a>00930             cpl_malloc(<span class="keyword">sizeof</span>(*obj_pos) * nframes);
-<a name="l00931"></a>00931         obj_pos_offset = 
-<a name="l00932"></a>00932             cpl_malloc(<span class="keyword">sizeof</span>(*obj_pos_offset) * nframes);
-<a name="l00933"></a>00933         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)
-<a name="l00934"></a>00934         {
-<a name="l00935"></a>00935             obj_pos[iframe] = cpl_table_new(0);
-<a name="l00936"></a>00936             cpl_table_new_column
-<a name="l00937"></a>00937                 (obj_pos[iframe], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);
-<a name="l00938"></a>00938             cpl_table_new_column
-<a name="l00939"></a>00939                 (obj_pos[iframe], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);
-<a name="l00940"></a>00940         }
-<a name="l00941"></a>00941         
-<a name="l00942"></a>00942         <span class="comment">/* Loop on images to fill object_positions */</span>
-<a name="l00943"></a>00943         <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l00944"></a>00944         {
-<a name="l00945"></a>00945             cpl_apertures   * this_apertures;
-<a name="l00946"></a>00946 
-<a name="l00947"></a>00947             <span class="comment">/* Create the detected apertures list */</span>
-<a name="l00948"></a>00948             this_apertures = apertures[idet][iframe];
-<a name="l00949"></a>00949             
-<a name="l00950"></a>00950             <span class="comment">/* Fill the objects position table */</span>
-<a name="l00951"></a>00951             hawki_cal_distortion_fill_obj_pos(obj_pos[iframe],
-<a name="l00952"></a>00952                                               this_apertures);
-<a name="l00953"></a>00953             obj_pos_offset[iframe] = cpl_table_duplicate(obj_pos[iframe]);
-<a name="l00954"></a>00954         }
-<a name="l00955"></a>00955         
-<a name="l00956"></a>00956         <span class="comment">/* Get the objects positions with offsets */</span>
-<a name="l00957"></a>00957         hawki_cal_distortion_add_offset_to_positions
-<a name="l00958"></a>00958             (obj_pos_offset, offsets);
-<a name="l00959"></a>00959         
-<a name="l00960"></a>00960         <span class="comment">/* Get the all the matching pairs */</span>
-<a name="l00961"></a>00961         cpl_msg_info(__func__, <span class="stringliteral">"Matching all catalogs (may take a while)"</span>);
-<a name="l00962"></a>00962         matches =  irplib_match_cat_pairs(obj_pos_offset, nframes, 
-<a name="l00963"></a>00963                                           <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a>);
-<a name="l00964"></a>00964         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)
-<a name="l00965"></a>00965             cpl_table_delete(obj_pos_offset[iframe]);
-<a name="l00966"></a>00966         cpl_free(obj_pos_offset);
-<a name="l00967"></a>00967         <span class="keywordflow">if</span>(matches == NULL)
-<a name="l00968"></a>00968         {
-<a name="l00969"></a>00969             cpl_msg_error(__func__, <span class="stringliteral">"Cannot match objects "</span>);
-<a name="l00970"></a>00970             <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)
-<a name="l00971"></a>00971                 cpl_table_delete(obj_pos[iframe]);
-<a name="l00972"></a>00972             cpl_free(obj_pos);
-<a name="l00973"></a>00973             <span class="keywordflow">return</span> NULL;
-<a name="l00974"></a>00974         }
-<a name="l00975"></a>00975         cpl_msg_info(__func__,<span class="stringliteral">"Number of matching pairs %"</span>CPL_SIZE_FORMAT,
-<a name="l00976"></a>00976                      cpl_table_get_nrow(matches));
-<a name="l00977"></a>00977         nmatched_pairs[idet] = cpl_table_get_nrow(matches);
-<a name="l00978"></a>00978 
-<a name="l00979"></a>00979         <span class="comment">/* Compute the distortion */</span>
-<a name="l00980"></a>00980         cpl_msg_info(__func__, <span class="stringliteral">"Computing distortion with the matched objects"</span>);
-<a name="l00981"></a>00981         cpl_msg_info(__func__, <span class="stringliteral">"  (This step will take a long time to run)"</span>);
-<a name="l00982"></a>00982         <span class="keywordflow">if</span>(distortion_guess != NULL)
-<a name="l00983"></a>00983             dist_guess = distortion_guess[idet];
-<a name="l00984"></a>00984         <span class="keywordflow">else</span>
-<a name="l00985"></a>00985             dist_guess = NULL;
-<a name="l00986"></a>00986         distortion[idet] = hawki_distortion_compute_solution
-<a name="l00987"></a>00987              ((<span class="keyword">const</span> cpl_table **)obj_pos, offsets, matches,
-<a name="l00988"></a>00988               nframes, HAWKI_DET_NPIX_X , HAWKI_DET_NPIX_Y, grid_points,
-<a name="l00989"></a>00989               dist_guess, rms + idet);
-<a name="l00990"></a>00990         <span class="keywordflow">if</span>(distortion[idet] == NULL)
-<a name="l00991"></a>00991         {
-<a name="l00992"></a>00992             <span class="keywordtype">int</span> jdet;
-<a name="l00993"></a>00993             cpl_msg_error(__func__,<span class="stringliteral">"Could not get the distortion"</span>);
-<a name="l00994"></a>00994             <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)
-<a name="l00995"></a>00995                 cpl_table_delete(obj_pos[iframe]);
-<a name="l00996"></a>00996             cpl_free(obj_pos);
-<a name="l00997"></a>00997             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00998"></a>00998                 <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);
-<a name="l00999"></a>00999             cpl_table_delete(matches);
-<a name="l01000"></a>01000             <span class="keywordflow">return</span> NULL;
-<a name="l01001"></a>01001         }
-<a name="l01002"></a>01002 
-<a name="l01003"></a>01003         <span class="comment">/* Removing the first order polinomial to the distortion */</span>
-<a name="l01004"></a>01004         <span class="keywordflow">if</span>(hawki_cal_distortion_config.subtract_linear)
-<a name="l01005"></a>01005         {
-<a name="l01006"></a>01006             cpl_msg_info(__func__,<span class="stringliteral">"Subtracting first order polynomial"</span>);
-<a name="l01007"></a>01007             fit2d_x = cpl_polynomial_new(2);
-<a name="l01008"></a>01008             fit2d_y = cpl_polynomial_new(2);
-<a name="l01009"></a>01009             hawki_cal_distortion_fit_first_order_solution
-<a name="l01010"></a>01010                 (distortion[idet], fit2d_x, fit2d_y);
-<a name="l01011"></a>01011         }
-<a name="l01012"></a>01012         
-<a name="l01013"></a>01013         <span class="comment">/* Free */</span>
-<a name="l01014"></a>01014         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)
-<a name="l01015"></a>01015             cpl_table_delete(obj_pos[iframe]);
-<a name="l01016"></a>01016         cpl_free(obj_pos);
-<a name="l01017"></a>01017         <span class="keywordflow">if</span>(hawki_cal_distortion_config.subtract_linear)
-<a name="l01018"></a>01018         {
-<a name="l01019"></a>01019             cpl_polynomial_delete(fit2d_x);
-<a name="l01020"></a>01020             cpl_polynomial_delete(fit2d_y);
-<a name="l01021"></a>01021         }
-<a name="l01022"></a>01022         cpl_table_delete(matches);
-<a name="l01023"></a>01023         cpl_msg_indent_less();
-<a name="l01024"></a>01024     }
-<a name="l01025"></a>01025 
-<a name="l01026"></a>01026     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l01027"></a>01027     {
-<a name="l01028"></a>01028         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the distortion"</span>);
-<a name="l01029"></a>01029         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01030"></a>01030             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);
-<a name="l01031"></a>01031         <span class="keywordflow">return</span> NULL ;
-<a name="l01032"></a>01032     }
-<a name="l01033"></a>01033     <span class="comment">/* Free and return */</span>
-<a name="l01034"></a>01034     <span class="keywordflow">return</span> distortion;
-<a name="l01035"></a>01035 }
-<a name="l01036"></a>01036 
-<a name="l01037"></a>01037 <span class="keyword">static</span> cpl_apertures * hawki_cal_distortion_get_image_apertures
-<a name="l01038"></a>01038 (cpl_image * image,
-<a name="l01039"></a>01039  <span class="keywordtype">double</span> sigma_det)
-<a name="l01040"></a>01040 {
-<a name="l01041"></a>01041     cpl_apertures   * apertures = NULL;
-<a name="l01042"></a>01042     cpl_mask        * kernel = NULL;
-<a name="l01043"></a>01043     cpl_mask        * object_mask = NULL;
-<a name="l01044"></a>01044     cpl_image       * labels = NULL;
-<a name="l01045"></a>01045     cpl_size          nobj;
-<a name="l01046"></a>01046     <span class="keywordtype">double</span>            median;
-<a name="l01047"></a>01047     <span class="keywordtype">double</span>            med_dist;
-<a name="l01048"></a>01048     <span class="keywordtype">double</span>            threshold;
-<a name="l01049"></a>01049     
-<a name="l01050"></a>01050     <span class="comment">/* Get the threshold */</span>
-<a name="l01051"></a>01051     median = cpl_image_get_median_dev(image, &med_dist);
-<a name="l01052"></a>01052     threshold = median + sigma_det * med_dist;
-<a name="l01053"></a>01053     cpl_msg_info(__func__,<span class="stringliteral">"Detection threshold: %f"</span>, threshold);
-<a name="l01054"></a>01054 
-<a name="l01055"></a>01055     <span class="comment">/* Create the mask */</span>
-<a name="l01056"></a>01056     object_mask = cpl_mask_threshold_image_create
-<a name="l01057"></a>01057             (image, threshold, DBL_MAX);
-<a name="l01058"></a>01058     <span class="keywordflow">if</span> (object_mask == NULL)
-<a name="l01059"></a>01059         <span class="keywordflow">return</span> NULL;
-<a name="l01060"></a>01060 
-<a name="l01061"></a>01061     <span class="comment">/* Apply morphological opening to remove single pixel detections */</span>
-<a name="l01062"></a>01062     kernel = cpl_mask_new(3,3);
-<a name="l01063"></a>01063     cpl_mask_not(kernel);
-<a name="l01064"></a>01064 
-<a name="l01065"></a>01065     <span class="keywordflow">if</span> (cpl_mask_filter(object_mask, object_mask, kernel, 
-<a name="l01066"></a>01066             CPL_FILTER_OPENING, CPL_BORDER_ZERO) != CPL_ERROR_NONE) {
-<a name="l01067"></a>01067         cpl_mask_delete(object_mask) ;
-<a name="l01068"></a>01068         cpl_mask_delete(kernel) ;
-<a name="l01069"></a>01069         <span class="keywordflow">return</span> NULL;
-<a name="l01070"></a>01070     }
-<a name="l01071"></a>01071     cpl_mask_delete(kernel);
-<a name="l01072"></a>01072 
-<a name="l01073"></a>01073     <span class="comment">/* Labelise the different detected apertures */</span>
-<a name="l01074"></a>01074     labels = cpl_image_labelise_mask_create(object_mask, &nobj);
-<a name="l01075"></a>01075     <span class="keywordflow">if</span> (labels == NULL)
-<a name="l01076"></a>01076     {
-<a name="l01077"></a>01077         cpl_mask_delete(object_mask);
-<a name="l01078"></a>01078         <span class="keywordflow">return</span> NULL;
-<a name="l01079"></a>01079     }
-<a name="l01080"></a>01080     cpl_mask_delete(object_mask);
-<a name="l01081"></a>01081     cpl_msg_info(__func__, <span class="stringliteral">"Number of objects detected: %"</span>CPL_SIZE_FORMAT,
-<a name="l01082"></a>01082                  nobj);
-<a name="l01083"></a>01083 
-<a name="l01084"></a>01084     <span class="comment">/* Create the detected apertures list */</span>
-<a name="l01085"></a>01085     apertures = cpl_apertures_new_from_image(image, labels);
-<a name="l01086"></a>01086     <span class="keywordflow">if</span> (apertures == NULL)
-<a name="l01087"></a>01087     {
-<a name="l01088"></a>01088         cpl_image_delete(labels);
-<a name="l01089"></a>01089         <span class="keywordflow">return</span> NULL;
-<a name="l01090"></a>01090     }
-<a name="l01091"></a>01091     cpl_image_delete(labels);
-<a name="l01092"></a>01092     <span class="keywordflow">return</span> apertures;
-<a name="l01093"></a>01093 }
-<a name="l01094"></a>01094 
-<a name="l01095"></a>01095 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fill_obj_pos
-<a name="l01096"></a>01096 (cpl_table     * objects_positions,
-<a name="l01097"></a>01097  cpl_apertures * apertures)
-<a name="l01098"></a>01098 {
-<a name="l01099"></a>01099     cpl_size nobjs;
-<a name="l01100"></a>01100     cpl_size iobj;
-<a name="l01101"></a>01101     <span class="keywordtype">double</span> border_off = 0;
-<a name="l01102"></a>01102 
-<a name="l01103"></a>01103     <span class="comment">/* Take into account that the images have been trimmed */</span>
-<a name="l01104"></a>01104     <span class="keywordflow">if</span>(hawki_cal_distortion_config.borders > 0)
-<a name="l01105"></a>01105         border_off = hawki_cal_distortion_config.borders;
-<a name="l01106"></a>01106     
-<a name="l01107"></a>01107     nobjs = cpl_apertures_get_size(apertures); 
-<a name="l01108"></a>01108     cpl_table_set_size(objects_positions, nobjs);
-<a name="l01109"></a>01109     
-<a name="l01110"></a>01110     <span class="keywordflow">for</span> (iobj=0 ; iobj<nobjs ; iobj++)
-<a name="l01111"></a>01111     {
-<a name="l01112"></a>01112         <span class="comment">/* Fill with the already known information */</span>
-<a name="l01113"></a>01113         cpl_table_set_double(objects_positions, HAWKI_COL_OBJ_POSX, iobj, 
-<a name="l01114"></a>01114                              cpl_apertures_get_centroid_x(apertures,
-<a name="l01115"></a>01115                                                           iobj+1) + border_off);
-<a name="l01116"></a>01116         cpl_table_set_double(objects_positions, HAWKI_COL_OBJ_POSY, iobj, 
-<a name="l01117"></a>01117                              cpl_apertures_get_centroid_y(apertures,
-<a name="l01118"></a>01118                                                           iobj+1) + border_off);
-<a name="l01119"></a>01119     }
-<a name="l01120"></a>01120     
-<a name="l01121"></a>01121     <span class="keywordflow">return</span> 0;
-<a name="l01122"></a>01122 }
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_add_offset_to_positions
-<a name="l01125"></a>01125 (cpl_table     ** objects_positions,
-<a name="l01126"></a>01126  cpl_bivector   * offsets)
-<a name="l01127"></a>01127 {
-<a name="l01128"></a>01128     <span class="keywordtype">int</span> nframes;
-<a name="l01129"></a>01129     <span class="keywordtype">int</span> iframe;
-<a name="l01130"></a>01130     cpl_size nobjs;
-<a name="l01131"></a>01131     cpl_size iobj;
-<a name="l01132"></a>01132     
-<a name="l01133"></a>01133     nframes = cpl_bivector_get_size(offsets); 
-<a name="l01134"></a>01134 
-<a name="l01135"></a>01135     <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l01136"></a>01136     {
-<a name="l01137"></a>01137         <span class="keywordtype">double</span> offset_x;
-<a name="l01138"></a>01138         <span class="keywordtype">double</span> offset_y;
-<a name="l01139"></a>01139         <span class="keywordtype">int</span>    null;
-<a name="l01140"></a>01140         offset_x = cpl_bivector_get_x_data(offsets)[iframe];
-<a name="l01141"></a>01141         offset_y = cpl_bivector_get_y_data(offsets)[iframe];
-<a name="l01142"></a>01142         nobjs = cpl_table_get_nrow(objects_positions[iframe]);
-<a name="l01143"></a>01143         <span class="keywordflow">for</span> (iobj=0 ; iobj<nobjs ; iobj++)
-<a name="l01144"></a>01144         {
-<a name="l01145"></a>01145             cpl_table_set_double(objects_positions[iframe], 
-<a name="l01146"></a>01146                      HAWKI_COL_OBJ_POSX, iobj, 
-<a name="l01147"></a>01147                      cpl_table_get_double(objects_positions[iframe], 
-<a name="l01148"></a>01148                              HAWKI_COL_OBJ_POSX, iobj, &null) + offset_x);
-<a name="l01149"></a>01149             cpl_table_set_double(objects_positions[iframe], 
-<a name="l01150"></a>01150                      HAWKI_COL_OBJ_POSY, iobj, 
-<a name="l01151"></a>01151                      cpl_table_get_double(objects_positions[iframe], 
-<a name="l01152"></a>01152                              HAWKI_COL_OBJ_POSY, iobj, &null) + offset_y);
-<a name="l01153"></a>01153         }
-<a name="l01154"></a>01154     }
-<a name="l01155"></a>01155           
-<a name="l01156"></a>01156     <span class="keywordflow">return</span> 0;
-<a name="l01157"></a>01157 }
-<a name="l01158"></a>01158 
-<a name="l01159"></a>01159 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fit_first_order_solution
-<a name="l01160"></a>01160 (hawki_distortion * distortion,
-<a name="l01161"></a>01161  cpl_polynomial   * fit2d_x,
-<a name="l01162"></a>01162  cpl_polynomial   * fit2d_y)
-<a name="l01163"></a>01163 {
-<a name="l01164"></a>01164     cpl_matrix      * pixel_pos;
-<a name="l01165"></a>01165     cpl_vector      * dist_x_val;
-<a name="l01166"></a>01166     cpl_vector      * dist_y_val;
-<a name="l01167"></a>01167     <span class="keywordtype">int</span>               nx;
-<a name="l01168"></a>01168     <span class="keywordtype">int</span>               ny;
-<a name="l01169"></a>01169     <span class="keywordtype">int</span>               i;
-<a name="l01170"></a>01170     <span class="keywordtype">int</span>               j;
-<a name="l01171"></a>01171     <span class="keywordtype">int</span>               null;
-<a name="l01172"></a>01172     <span class="keyword">const</span> cpl_size    mindeg2d[] = {0, 0};
-<a name="l01173"></a>01173     <span class="keyword">const</span> cpl_size    maxdeg2d[] = {1, 1};
-<a name="l01174"></a>01174     cpl_errorstate    error_prevstate = cpl_errorstate_get();
-<a name="l01175"></a>01175     cpl_vector      * pix;
-<a name="l01176"></a>01176     cpl_image       * dist_x_plane;
-<a name="l01177"></a>01177     cpl_image       * dist_y_plane;
-<a name="l01178"></a>01178     <span class="keywordtype">double</span>            dist_x_mean;
-<a name="l01179"></a>01179     <span class="keywordtype">double</span>            dist_y_mean;
-<a name="l01180"></a>01180    
-<a name="l01181"></a>01181     <span class="comment">/* Fill the bivector with pixel positions in X,Y */</span>
-<a name="l01182"></a>01182     nx = <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a>(distortion);
-<a name="l01183"></a>01183     ny = <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a>(distortion);
-<a name="l01184"></a>01184     pixel_pos = cpl_matrix_new(2, nx * ny);
-<a name="l01185"></a>01185     dist_x_val = cpl_vector_new(nx*ny);
-<a name="l01186"></a>01186     dist_y_val = cpl_vector_new(nx*ny);
-<a name="l01187"></a>01187     <span class="keywordflow">for</span>(i = 0; i < nx; ++i)
-<a name="l01188"></a>01188         <span class="keywordflow">for</span>(j = 0; j < ny; ++j)
-<a name="l01189"></a>01189         {
-<a name="l01190"></a>01190             cpl_matrix_set(pixel_pos, 0, i + nx * j, (<span class="keywordtype">double</span>)i);
-<a name="l01191"></a>01191             cpl_matrix_set(pixel_pos, 1, i + nx * j, (<span class="keywordtype">double</span>)j);
-<a name="l01192"></a>01192             cpl_vector_set(dist_x_val, i + nx * j,
-<a name="l01193"></a>01193                            cpl_image_get(distortion->dist_x, i+1, j+1, &null));
-<a name="l01194"></a>01194             cpl_vector_set(dist_y_val, i + nx * j,
-<a name="l01195"></a>01195                            cpl_image_get(distortion->dist_y, i+1, j+1, &null));
-<a name="l01196"></a>01196         }
-<a name="l01197"></a>01197 
-<a name="l01198"></a>01198     <span class="comment">/* Fit the polynomial */</span>
-<a name="l01199"></a>01199     cpl_polynomial_fit(fit2d_x, pixel_pos, NULL, dist_x_val, 
-<a name="l01200"></a>01200                        NULL, CPL_FALSE, mindeg2d, maxdeg2d);
-<a name="l01201"></a>01201     cpl_polynomial_fit(fit2d_y, pixel_pos, NULL, dist_y_val,
-<a name="l01202"></a>01202                        NULL, CPL_FALSE, mindeg2d, maxdeg2d);
-<a name="l01203"></a>01203     <span class="comment">/* Removing the constant term */</span>
-<a name="l01204"></a>01204     cpl_polynomial_set_coeff(fit2d_x, mindeg2d, 0.);
-<a name="l01205"></a>01205     cpl_polynomial_set_coeff(fit2d_y, mindeg2d, 0.);
-<a name="l01206"></a>01206     
-<a name="l01207"></a>01207     <span class="comment">/* Subtract the linear term */</span>
-<a name="l01208"></a>01208     pix = cpl_vector_new(2);
-<a name="l01209"></a>01209     dist_x_plane = cpl_image_new(nx,ny,cpl_image_get_type(distortion->dist_x));
-<a name="l01210"></a>01210     dist_y_plane = cpl_image_new(nx,ny,cpl_image_get_type(distortion->dist_y));
-<a name="l01211"></a>01211     <span class="keywordflow">for</span>(i = 0; i < nx; ++i)
-<a name="l01212"></a>01212         <span class="keywordflow">for</span>(j = 0; j < ny; ++j)
-<a name="l01213"></a>01213         {
-<a name="l01214"></a>01214             <span class="keywordtype">double</span> fit_value_x;
-<a name="l01215"></a>01215             <span class="keywordtype">double</span> fit_value_y;
-<a name="l01216"></a>01216             cpl_vector_set(pix, 0, (<span class="keywordtype">double</span>)i);
-<a name="l01217"></a>01217             cpl_vector_set(pix, 1, (<span class="keywordtype">double</span>)j);
-<a name="l01218"></a>01218             fit_value_x = cpl_polynomial_eval(fit2d_x, pix);
-<a name="l01219"></a>01219             fit_value_y = cpl_polynomial_eval(fit2d_y, pix);
-<a name="l01220"></a>01220             cpl_image_set(dist_x_plane, i+1, j+1, fit_value_x);
-<a name="l01221"></a>01221             cpl_image_set(dist_y_plane, i+1, j+1, fit_value_y);
-<a name="l01222"></a>01222         }
-<a name="l01223"></a>01223     cpl_image_subtract(distortion->dist_x, dist_x_plane);
-<a name="l01224"></a>01224     cpl_image_subtract(distortion->dist_y, dist_y_plane);
-<a name="l01225"></a>01225     
-<a name="l01226"></a>01226     <span class="comment">/* Subtract the mean distortion, again */</span>
-<a name="l01227"></a>01227     dist_x_mean = cpl_image_get_mean(distortion->dist_x);
-<a name="l01228"></a>01228     dist_y_mean = cpl_image_get_mean(distortion->dist_y);
-<a name="l01229"></a>01229     cpl_msg_warning(__func__,<span class="stringliteral">"Subtracting mean distortion in X %f"</span>,dist_x_mean);
-<a name="l01230"></a>01230     cpl_msg_warning(__func__,<span class="stringliteral">"Subtracting mean distortion in Y %f"</span>,dist_y_mean);
-<a name="l01231"></a>01231     cpl_image_subtract_scalar(distortion->dist_x, dist_x_mean);
-<a name="l01232"></a>01232     cpl_image_subtract_scalar(distortion->dist_y, dist_y_mean);
-<a name="l01233"></a>01233 
-<a name="l01234"></a>01234     <span class="comment">/* Free and return */</span>
-<a name="l01235"></a>01235     cpl_matrix_delete(pixel_pos);
-<a name="l01236"></a>01236     cpl_vector_delete(dist_x_val);
-<a name="l01237"></a>01237     cpl_vector_delete(dist_y_val);
-<a name="l01238"></a>01238     cpl_vector_delete(pix);
-<a name="l01239"></a>01239     cpl_image_delete(dist_x_plane);
-<a name="l01240"></a>01240     cpl_image_delete(dist_y_plane);
-<a name="l01241"></a>01241     
-<a name="l01242"></a>01242     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l01243"></a>01243     {
-<a name="l01244"></a>01244         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the linear term"</span>);
-<a name="l01245"></a>01245         cpl_msg_error(__func__,<span class="stringliteral">"Error %s"</span>,cpl_error_get_message());
-<a name="l01246"></a>01246         <span class="comment">//cpl_msg_error(__func__,"Where  %s",cpl_error_get_where());</span>
-<a name="l01247"></a>01247         <span class="keywordflow">return</span> -1;
-<a name="l01248"></a>01248     }
-<a name="l01249"></a>01249     <span class="keywordflow">return</span> 0;
-<a name="l01250"></a>01250 }
-<a name="l01251"></a>01251 
-<a name="l01252"></a>01252 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01257"></a>01257 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01258"></a>01258 <span class="keyword">static</span> cpl_propertylist ** hawki_cal_distortion_qc
-<a name="l01259"></a>01259 (hawki_distortion ** distortion,
-<a name="l01260"></a>01260  <span class="keywordtype">int</span>              *  nmatched_pairs,
-<a name="l01261"></a>01261  <span class="keywordtype">double</span>           *  rms)
-<a name="l01262"></a>01262 {
-<a name="l01263"></a>01263     <span class="keywordtype">int</span> idet;
-<a name="l01264"></a>01264     cpl_propertylist ** qclists;
-<a name="l01265"></a>01265     
-<a name="l01266"></a>01266     <span class="comment">/* Allocate the qclists */</span>
-<a name="l01267"></a>01267     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01268"></a>01268     
-<a name="l01269"></a>01269     <span class="comment">/* Loop on the detectors to get the mean zpoint */</span>
-<a name="l01270"></a>01270     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l01271"></a>01271     {
-<a name="l01272"></a>01272         <span class="comment">/* Allocate this qclist */</span>
-<a name="l01273"></a>01273         qclists[idet] = cpl_propertylist_new() ;
-<a name="l01274"></a>01274         
-<a name="l01275"></a>01275         cpl_propertylist_append_double
-<a name="l01276"></a>01276             (qclists[idet], <span class="stringliteral">"ESO QC DIST NMATCHED"</span>, nmatched_pairs[idet]);
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278         cpl_propertylist_append_double
-<a name="l01279"></a>01279             (qclists[idet], <span class="stringliteral">"ESO QC DIST TOTAL RMS"</span>, rms[idet]);
-<a name="l01280"></a>01280 
-<a name="l01281"></a>01281         <span class="comment">/* Getting the jacobian of the distortion map */</span>
-<a name="l01282"></a>01282         <span class="comment">/* The jacobian has to be definitive positive in all the detector to </span>
-<a name="l01283"></a>01283 <span class="comment">         * be have a biyective function invertible anywhere:</span>
-<a name="l01284"></a>01284 <span class="comment">         * http://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant#Jacobian_determinant</span>
-<a name="l01285"></a>01285 <span class="comment">         * http://en.wikipedia.org/wiki/Inverse_function#Inverses_and_derivatives</span>
-<a name="l01286"></a>01286 <span class="comment">         * This should be a QC check.</span>
-<a name="l01287"></a>01287 <span class="comment">         */</span> 
-<a name="l01288"></a>01288 
-<a name="l01289"></a>01289         
-<a name="l01290"></a>01290         <span class="comment">//cpl_propertylist_append_double</span>
-<a name="l01291"></a>01291         <span class="comment">//(qclists[idet], "ESO QC DIST JACOBIAN_1_1", jacobian[1][1]);</span>
-<a name="l01292"></a>01292     }
-<a name="l01293"></a>01293     
-<a name="l01294"></a>01294     <span class="keywordflow">return</span> qclists;
-<a name="l01295"></a>01295 }
-<a name="l01296"></a>01296 
-<a name="l01297"></a>01297 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01307"></a>01307 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01308"></a>01308 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_save
-<a name="l01309"></a>01309 (hawki_distortion       **  distortion,
-<a name="l01310"></a>01310  cpl_parameterlist       *  parlist,
-<a name="l01311"></a>01311  cpl_propertylist       **  qclists,
-<a name="l01312"></a>01312  cpl_frameset            *  recipe_set)
-<a name="l01313"></a>01313 {
-<a name="l01314"></a>01314     <span class="keyword">const</span> <span class="keywordtype">char</span>   * recipe_name = <span class="stringliteral">"hawki_cal_distortion"</span>;
-<a name="l01315"></a>01315 
-<a name="l01316"></a>01316     <span class="comment">/* Write the distortion in both axes */</span>
-<a name="l01317"></a>01317     <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a>(recipe_set,
-<a name="l01318"></a>01318                           parlist,
-<a name="l01319"></a>01319                           recipe_set,
-<a name="l01320"></a>01320                           (<span class="keyword">const</span> hawki_distortion **) distortion,
-<a name="l01321"></a>01321                           recipe_name,
-<a name="l01322"></a>01322                           NULL,
-<a name="l01323"></a>01323                           (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01324"></a>01324                           <span class="stringliteral">"hawki_cal_distortion_x.fits"</span>,
-<a name="l01325"></a>01325                           <span class="stringliteral">"hawki_cal_distortion_y.fits"</span>);
-<a name="l01326"></a>01326 
-<a name="l01327"></a>01327     <span class="comment">/* Free and return */</span>
-<a name="l01328"></a>01328     <span class="keywordflow">return</span>  0;
-<a name="l01329"></a>01329 }
-<a name="l01330"></a>01330 
-<a name="l01331"></a>01331 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_retrieve_input_param
-<a name="l01332"></a>01332 (cpl_parameterlist  *  parlist)
-<a name="l01333"></a>01333 {
-<a name="l01334"></a>01334     cpl_parameter   *   par ;
-<a name="l01335"></a>01335 
-<a name="l01336"></a>01336     par = NULL ;
-<a name="l01337"></a>01337     par = cpl_parameterlist_find
-<a name="l01338"></a>01338         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.sigma_det"</span>);
-<a name="l01339"></a>01339     hawki_cal_distortion_config.sigma_det = cpl_parameter_get_double(par);
-<a name="l01340"></a>01340     par = cpl_parameterlist_find
-<a name="l01341"></a>01341         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.grid_points"</span>);
-<a name="l01342"></a>01342     hawki_cal_distortion_config.grid_points = cpl_parameter_get_int(par);
-<a name="l01343"></a>01343     par = cpl_parameterlist_find
-<a name="l01344"></a>01344         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.borders"</span>);
-<a name="l01345"></a>01345     hawki_cal_distortion_config.borders = cpl_parameter_get_int(par);
-<a name="l01346"></a>01346     par = cpl_parameterlist_find
-<a name="l01347"></a>01347         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.subtract_linear"</span>);
-<a name="l01348"></a>01348     hawki_cal_distortion_config.subtract_linear = cpl_parameter_get_bool(par);
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350 
-<a name="l01351"></a>01351     <span class="keywordflow">return</span> 0;
-<a name="l01352"></a>01352 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_distortion.c,v 1.17 2013/02/01 17:18: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/02/01 17:18:05 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.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 "hawki_alloc.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "irplib_cat.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "irplib_stdstar.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "irplib_match_cats.h"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">#include "hawki_match_cats.h"</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</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><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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="keywordtype">int</span> hawki_cal_distortion_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion(cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                    cpl_frameset        *   frameset);</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="keyword">static</span> <span class="keywordtype">int</span>  hawki_cal_distortion_get_apertures_from_raw_distor</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (cpl_frameset      *  raw_target,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  <span class="keyword">const</span> cpl_frame   *  bpm,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_image         ** master_sky,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="keywordtype">double</span>               sigma_det,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_apertures     *** apertures);</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">int</span> hawki_cal_distortion_load_master_calib</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> (<span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keyword">const</span> cpl_frame   *  bpm,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_imagelist     ** flat_images,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_imagelist     ** dark_images,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>  cpl_imagelist     ** bpm_images);</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_image **  hawki_cal_distortion_get_master_sky</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> (cpl_frameset      *  raw_target,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  <span class="keyword">const</span> cpl_frame   *  bpm);</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_subtract_sky</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> (cpl_imagelist * distor_corrected,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  cpl_image     * master_sky);</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">static</span> hawki_distortion  ** hawki_cal_distortion_compute_dist_solution</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> (cpl_apertures    *** apertures,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>  <span class="keywordtype">int</span>                  nframes,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>  cpl_bivector     *   offsets,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>  <span class="keywordtype">int</span>                  grid_points,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>  <span class="keywordtype">int</span>              *   nmatched_pairs,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>  <span class="keywordtype">double</span>           *   rms,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>  hawki_distortion **  distortion_guess);</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="keyword">static</span> cpl_apertures * hawki_cal_distortion_get_image_apertures</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> (cpl_image * image,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>  <span class="keywordtype">double</span> sigma_det);</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">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fill_obj_pos</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> (cpl_table     * objects_positions,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>  cpl_apertures * apertures);</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">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_add_offset_to_positions</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> (cpl_table     ** objects_positions,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>  cpl_bivector   * offsets);</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fit_first_order_solution</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> (hawki_distortion * distortion,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>  cpl_polynomial   * fit2d_x,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>  cpl_polynomial   * fit2d_y);</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> cpl_propertylist ** hawki_cal_distortion_qc</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> (hawki_distortion ** distortion,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>  <span class="keywordtype">int</span>              *  nmatched_pairs,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>  <span class="keywordtype">double</span>           *  rms);</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">int</span> hawki_cal_distortion_save</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> (hawki_distortion       **  distortion,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>  cpl_parameterlist       *  parlist,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>  cpl_propertylist       **  qclists,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>  cpl_frameset            *  recipe_set);</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">int</span> hawki_cal_distortion_retrieve_input_param</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> (cpl_parameterlist  *  parlist);</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> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="keyword">static</span> <span class="keyword">struct </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">/* Inputs */</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordtype">double</span> sigma_det;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordtype">int</span>    grid_points;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordtype">int</span>    borders;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="keywordtype">int</span>    subtract_linear;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> } hawki_cal_distortion_config;</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">static</span> <span class="keywordtype">char</span> hawki_cal_distortion_description[] = </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="stringliteral">"hawki_cal_distortion -- HAWK-I distortion and astrometry autocalibration.\n\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="stringliteral">"The input files must be tagged:\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="stringliteral">"distortion_field.fits "</span>HAWKI_CAL_DISTOR_RAW<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="stringliteral">"sky_distortion.fits "</span>HAWKI_CAL_DISTOR_SKY_RAW<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" (optional)\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" (optional)\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" (optional)\n\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="stringliteral">"hawki_cal_distortion_distx.fits ("</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">") \n"</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="stringliteral">"hawki_cal_distortion_disty.fits ("</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">") \n\n"</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="stringliteral">"The recipe performs the following steps:\n"</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="stringliteral">"-Basic calibration of astrometry fields\n"</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="stringliteral">"-Autocalibration of distortion, using method in A&A 454,1029 (2006)\n\n"</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="stringliteral">"or 1 otherwise"</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> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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 = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_plugin *   plugin = &recipe->interface ;</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>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                     <span class="stringliteral">"hawki_cal_distortion"</span>,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                     <span class="stringliteral">"Distortion autocalibration"</span>,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                     hawki_cal_distortion_description,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                     hawki_cal_distortion_create,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                     hawki_cal_distortion_exec,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                     hawki_cal_distortion_destroy);</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>     cpl_pluginlist_append(list, plugin) ;</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="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_create(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>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="comment">/* --sigma_det */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.sigma_det"</span>, </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 CPL_TYPE_DOUBLE, <span class="stringliteral">"detection level"</span>,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 6.) ;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_det"</span>) ;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --grid_points */</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.grid_points"</span>, </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                 <span class="stringliteral">"number of points in distortion grid"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 9) ;</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">"grid_points"</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">/* --borders */</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.borders"</span>, </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                                 <span class="stringliteral">"number of pixels to trim at the borders"</span>,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, 6) ;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"borders"</span>) ;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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="comment">/* --subtract_linear */</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_distortion.subtract_linear"</span>, </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 <span class="stringliteral">"Subtract a linear term to the solution"</span>,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 <span class="stringliteral">"hawki.hawki_cal_distortion"</span>, TRUE) ;</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">"subtract_linear"</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">/* Return */</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_cal_distortion(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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</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 class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion(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>     <span class="keyword">const</span> cpl_frame  *  flat = NULL;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keyword">const</span> cpl_frame  *  dark = NULL;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keyword">const</span> cpl_frame  *  bpm = NULL;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_frameset     *  distorframes = NULL;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cpl_frameset     *  skyframes = NULL;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keyword">const</span> cpl_frame  *  distorxguess = NULL;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keyword">const</span> cpl_frame  *  distoryguess = NULL;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     hawki_distortion ** distortionguess = NULL;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     hawki_distortion ** distortion = NULL;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     cpl_propertylist ** qclists = NULL;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_image        ** master_sky = NULL;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_bivector     *  nominal_offsets = NULL;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_apertures    ** apertures[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">int</span>                 nmatched_pairs[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">double</span>              rms[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">int</span>                 ioff;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">int</span>                 iframe;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordtype">int</span>                 nframes;</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="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">if</span>(hawki_cal_distortion_retrieve_input_param(parlist))</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_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>         <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve calibration data */</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying calibration data"</span>);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     flat   = cpl_frameset_find_const(frameset, HAWKI_CALPRO_FLAT);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     dark   = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DARK);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     bpm    = cpl_frameset_find_const(frameset, HAWKI_CALPRO_BPM);</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying distortion and sky data"</span>);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     distorframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DISTOR_RAW) ;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordflow">if</span> (distorframes == NULL)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Distortion images have to be provided (%s)"</span>,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                       HAWKI_CAL_DISTOR_RAW);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve sky frames */</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, HAWKI_CAL_DISTOR_SKY_RAW) ;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordflow">if</span> (skyframes == NULL)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Sky images have to be provided (%s)"</span>,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                       HAWKI_CAL_DISTOR_SKY_RAW);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve the distortion first guess (if provided) */</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     distorxguess = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DISTORTION_X);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     distoryguess = cpl_frameset_find_const(frameset, HAWKI_CALPRO_DISTORTION_Y);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordflow">if</span>(distorxguess != NULL && distoryguess != 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>         <span class="comment">//distortionguess = hawki_distortion_load(distorxtguess)</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="comment">/* Get the master sky frame */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_msg_info(__func__, <span class="stringliteral">"Computing the master sky image"</span>);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     master_sky = hawki_cal_distortion_get_master_sky(skyframes, flat, dark, bpm);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordflow">if</span>(master_sky == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get master sky image"</span>) ;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         cpl_frameset_delete(skyframes);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         <span class="keywordflow">return</span> -1;        </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">/* Aperture detection, basic reduction and sky subtraction of distortion images */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_msg_info(__func__, <span class="stringliteral">"Getting objects from distortion images"</span>);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">if</span>(hawki_cal_distortion_get_apertures_from_raw_distor</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>        (distorframes, flat, dark, bpm, master_sky,</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         hawki_cal_distortion_config.sigma_det, apertures) == -1)</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_error(__func__, </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                 <span class="stringliteral">"Cannot get objects from distortion images"</span>);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>             cpl_image_delete(master_sky[idet]);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         cpl_free(master_sky);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         cpl_frameset_delete(skyframes);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <span class="keywordflow">return</span> -1 ;        </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">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         cpl_image_delete(master_sky[idet]);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_free(master_sky);</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">/* Get the nominal offsets from the header */</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_msg_info(__func__,<span class="stringliteral">"Getting the nominal offsets"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     nominal_offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(distorframes); </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordflow">if</span> (nominal_offsets  == NULL) </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_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>) ;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         cpl_frameset_delete(skyframes);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Get the oposite offsets. This is to change from </span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">     * telescope convention to cpl convention */</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_vector_multiply_scalar(cpl_bivector_get_x(nominal_offsets), -1.0);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_vector_multiply_scalar(cpl_bivector_get_y(nominal_offsets), -1.0);</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">/* Print the header offsets */</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>     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) </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_msg_info(__func__, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                 cpl_bivector_get_x_data(nominal_offsets)[ioff],</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                 cpl_bivector_get_y_data(nominal_offsets)[ioff]);</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> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="comment">/* Get the distortion solution, the real stuff */</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_msg_info(__func__, <span class="stringliteral">"Computing the distortion"</span>);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     nframes = cpl_frameset_get_size(distorframes);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     distortion = hawki_cal_distortion_compute_dist_solution</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         (apertures, nframes, nominal_offsets,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>          hawki_cal_distortion_config.grid_points,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>          nmatched_pairs, rms,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>          distortionguess);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_bivector_delete(nominal_offsets);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span>(distortion  == 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>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         cpl_frameset_delete(skyframes);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         <span class="keywordflow">return</span> -1;        </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>     <span class="comment">/* Get some QC */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     qclists =  hawki_cal_distortion_qc(distortion, nmatched_pairs, rms);</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">/* Save the products */</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     cpl_msg_info(__func__,<span class="stringliteral">"Saving products"</span>);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="keywordflow">if</span>(hawki_cal_distortion_save(distortion,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                  parlist, qclists, frameset) == -1)</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_msg_error(__func__,<span class="stringliteral">"Could not save products"</span>);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>             cpl_propertylist_delete(qclists[idet]);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         cpl_free(qclists);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cpl_free(distortion);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         cpl_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         cpl_frameset_delete(skyframes);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_propertylist_delete(qclists[idet]);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     cpl_free(qclists);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     cpl_free(distortion);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">for</span>(iframe = 0 ; iframe < nframes; iframe++)</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>             cpl_apertures_delete(apertures[idet][iframe]);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         cpl_free(apertures[idet]);</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_frameset_delete(distorframes);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     cpl_frameset_delete(skyframes);</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>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         <span class="keywordflow">return</span> -1 ;</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> <span class="keywordflow">return</span> 0 ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_load_master_calib</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> (<span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>  <span class="keyword">const</span> cpl_frame   *  bpm,</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>  cpl_imagelist     ** flat_images,</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>  cpl_imagelist     ** dark_images,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>  cpl_imagelist     ** bpm_images)</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>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Initializing the pointers */</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     *flat_images = NULL;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     *dark_images = NULL;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     *bpm_images  = NULL;</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="comment">/* Loading the calibration files */</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cpl_msg_info(__func__, <span class="stringliteral">"Loading the calibration data"</span>) ;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keywordflow">if</span>(flat != NULL)</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>         *flat_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(flat, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         <span class="keywordflow">if</span>(*flat_images == NULL)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading flat"</span>) ;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>             <span class="keywordflow">return</span> -1;</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>(dark != NULL)</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>         *dark_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(dark, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         <span class="keywordflow">if</span>(*dark_images == NULL)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading dark"</span>) ;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             cpl_imagelist_delete(*flat_images);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <span class="keywordflow">return</span> -1;</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>(bpm != NULL)</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>         *bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         <span class="keywordflow">if</span>(*bpm_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading bpm"</span>) ;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>             cpl_imagelist_delete(*flat_images);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             cpl_imagelist_delete(*dark_images);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             <span class="keywordflow">return</span> -1;</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>     </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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>         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened loading calibration"</span>);</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         cpl_imagelist_delete(*flat_images);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         cpl_imagelist_delete(*dark_images);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         cpl_imagelist_delete(*bpm_images);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         <span class="keywordflow">return</span> -1;</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> 0;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_get_apertures_from_raw_distor</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> (cpl_frameset      *   raw_distor,</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>  <span class="keyword">const</span> cpl_frame   *   flat,</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>  <span class="keyword">const</span> cpl_frame   *   dark,</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>  <span class="keyword">const</span> cpl_frame   *   bpm,</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>  cpl_image         **  master_sky,</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>  <span class="keywordtype">double</span>                sigma_det,</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>  cpl_apertures     *** apertures)</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>     cpl_imagelist    *  flat_images;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     cpl_imagelist    *  dark_images;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_imagelist    *  bpm_images;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_propertylist *  plist;</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="keywordtype">double</span>              science_dit;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     <span class="keywordtype">int</span>                 iframe;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordtype">int</span>                 nframes;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <span class="keywordtype">int</span>                 idet;</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_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Indentation */</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>     </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="comment">/* Loading calibrations */</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     hawki_cal_distortion_load_master_calib</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         (flat, dark, bpm, &flat_images, &dark_images, &bpm_images);</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="comment">/* Multiply the dark image by the science exposure time */</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordflow">if</span>(dark != 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">if</span> ((plist=cpl_propertylist_load</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>                 (cpl_frame_get_filename</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                  (cpl_frameset_get_first_const(raw_distor)), 0)) == 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_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>             <span class="keywordflow">return</span> -1;</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>         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         cpl_imagelist_multiply_scalar(dark_images, science_dit);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         cpl_propertylist_delete(plist);</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">/* Loop on detectors */</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     nframes = cpl_frameset_get_size(raw_distor);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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_imagelist * distor_serie;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         cpl_imagelist * distor_serie_trimmed;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         cpl_image     * flat_det = NULL;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>         cpl_image     * dark_det = NULL;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>         cpl_image     * bpm_det  = 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>         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet + 1);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         cpl_msg_indent_more();</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="comment">/* Loading the distortion images for one detector */</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         cpl_msg_info(__func__, <span class="stringliteral">"Loading distortion images"</span>);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         distor_serie = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw_distor, idet + 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         <span class="keywordflow">if</span>(distor_serie== 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_msg_error(__func__, <span class="stringliteral">"Error reading distortion images"</span>);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Getting the calibs */</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordflow">if</span>(flat_images != NULL)</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             flat_det = cpl_imagelist_get(flat_images, idet);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>         <span class="keywordflow">if</span>(dark_images != NULL)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>             dark_det = cpl_imagelist_get(dark_images, idet);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>         <span class="keywordflow">if</span>(bpm_images != NULL)</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>             bpm_det = cpl_imagelist_get(bpm_images, idet);</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>(!cpl_errorstate_is_equal(error_prevstate ))</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>             cpl_msg_warning(cpl_func,<span class="stringliteral">"PPPPPP5"</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="comment">/* Applying the calibrations */</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         cpl_msg_info(__func__, <span class="stringliteral">"Applying basic calibration"</span>) ;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                 (distor_serie, flat_det, dark_det, bpm_det) == -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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>             cpl_imagelist_delete(distor_serie);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>             <span class="keywordflow">return</span> -1;</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_msg_indent_less();</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">/* Discard the pixels on the sides */</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>         <span class="keywordflow">if</span> (hawki_cal_distortion_config.borders > 0) </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>           distor_serie_trimmed = <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>(distor_serie,</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>                                  hawki_cal_distortion_config.borders);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>           cpl_imagelist_delete(distor_serie);</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">else</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>           distor_serie_trimmed = distor_serie;</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">/* Subtract sky */</span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>         cpl_msg_info(__func__, <span class="stringliteral">"Subtracting master sky"</span>) ;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>         <span class="keywordflow">if</span>(hawki_cal_distortion_subtract_sky(distor_serie_trimmed, master_sky[idet]) == -1)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot subtract the sky"</span>) ;</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>             cpl_imagelist_delete(distor_serie_trimmed);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>             <span class="keywordflow">return</span> -1;        </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> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>         <span class="comment">/* Creating apertures */</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>         apertures[idet] = cpl_malloc(<span class="keyword">sizeof</span>(*(apertures[idet])) * nframes);</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>         <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes; iframe++)</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>             cpl_image * this_image = cpl_imagelist_get(distor_serie_trimmed, iframe);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>             cpl_msg_info(__func__,<span class="stringliteral">"Working with distortion image %d"</span>, iframe+1);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>             apertures[idet][iframe] = </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                     hawki_cal_distortion_get_image_apertures(this_image, sigma_det);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>             cpl_msg_indent_less();</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>         </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         <span class="comment">/* Delete the list of images */</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         cpl_imagelist_delete(distor_serie_trimmed);</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>     }</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     cpl_imagelist_delete(bpm_images);</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>     </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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_error(__func__, <span class="stringliteral">"A problem happened detecting objects"</span>);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>         <span class="keywordflow">return</span> -1 ;</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">return</span> 0;</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> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> <span class="keyword">static</span> cpl_image **  hawki_cal_distortion_get_master_sky</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> (cpl_frameset      *  raw_sky_frames,</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>  <span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>  <span class="keyword">const</span> cpl_frame   *  bpm)</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>     cpl_propertylist *  plist;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     <span class="keywordtype">double</span>              science_dit;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordtype">int</span>                 jdet;</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     cpl_imagelist    *  flat_images;</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     cpl_imagelist    *  dark_images;</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     cpl_imagelist    *  bpm_images;</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     cpl_image        ** bkg_images = 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>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Indentation */</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     cpl_msg_indent_more();</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="comment">/* Reading calibrations */</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     hawki_cal_distortion_load_master_calib</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         (flat, dark, bpm, &flat_images, &dark_images, &bpm_images);</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="comment">/* Multiply the dark image by the science exposure time */</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     <span class="keywordflow">if</span>(dark != NULL)</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> ((plist=cpl_propertylist_load</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                 (cpl_frame_get_filename</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                  (cpl_frameset_get_first_const(raw_sky_frames)), 0)) == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             <span class="keywordflow">return</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>         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         cpl_imagelist_multiply_scalar(dark_images, science_dit);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         cpl_propertylist_delete(plist);</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">/* Compute the sky median */</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     bkg_images = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(*bkg_images));</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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_imagelist * sky_serie;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         cpl_imagelist * sky_serie_trimmed;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         cpl_image     * flat_det = NULL;</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         cpl_image     * dark_det = NULL;</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         cpl_image     * bpm_det  = NULL;</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="comment">/* Loading the sky images for one detector */</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>         sky_serie = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw_sky_frames, idet + 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         <span class="keywordflow">if</span>(sky_serie== 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading object image"</span>) ;</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>             <span class="keywordflow">return</span> NULL;</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> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         <span class="comment">/* Getting the calibs */</span></div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>         <span class="keywordflow">if</span>(flat_images != NULL)</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>             flat_det = cpl_imagelist_get(flat_images, idet);</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>         <span class="keywordflow">if</span>(dark_images != NULL)</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             dark_det = cpl_imagelist_get(dark_images, idet);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>         <span class="keywordflow">if</span>(bpm_images != NULL)</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             bpm_det = cpl_imagelist_get(bpm_images, idet);</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">/* Applying the calibrations */</span></div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet + 1);</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                 (sky_serie, flat_det, dark_det, bpm_det) == -1)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>             cpl_imagelist_delete(sky_serie);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                 cpl_image_delete(bkg_images[jdet]);</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             cpl_free(bkg_images);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>             <span class="keywordflow">return</span> 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>         </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         <span class="comment">/* Discard the pixels on the sides */</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         <span class="keywordflow">if</span> (hawki_cal_distortion_config.borders > 0) </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>           sky_serie_trimmed = <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>(sky_serie,</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                           hawki_cal_distortion_config.borders);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>           cpl_imagelist_delete(sky_serie);</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">else</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>           sky_serie_trimmed = sky_serie;</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">/* Averaging */</span></div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         <span class="keywordflow">if</span> ((bkg_images[idet] =</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                 cpl_imagelist_collapse_median_create(sky_serie_trimmed))  == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute the median of obj images"</span>);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>             cpl_imagelist_delete(sky_serie_trimmed);</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>                 cpl_image_delete(bkg_images[jdet]);</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>             cpl_free(bkg_images);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>             <span class="keywordflow">return</span> 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>         cpl_imagelist_delete(sky_serie_trimmed);</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         cpl_msg_indent_less();</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">/* Subtract the median of the frame */</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>         cpl_image_subtract_scalar(bkg_images[idet],</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>                                   cpl_image_get_median(bkg_images[idet]));</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="comment">/* Cleaning up */</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>     cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>     cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>     cpl_imagelist_delete(bpm_images);</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>(!cpl_errorstate_is_equal(error_prevstate ))</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>         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened with basic calibration"</span>);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             cpl_image_delete(bkg_images[idet]);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         cpl_free(bkg_images);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         <span class="keywordflow">return</span> NULL ;</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">return</span> bkg_images;</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> </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_subtract_sky</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span> (cpl_imagelist * distor_corrected,</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>  cpl_image     * master_sky)</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>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Subtract the background to each object frame */</span></div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     <span class="keywordtype">int</span> idist, ndistor;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>     ndistor = cpl_imagelist_get_size(distor_corrected);</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     <span class="keywordflow">for</span>(idist = 0; idist < ndistor; ++idist)</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>         cpl_image * target_image =</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>             cpl_imagelist_get(distor_corrected, idist);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         <span class="comment">/* First subtract the median of the image */</span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>         cpl_image_subtract_scalar</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>             (target_image, cpl_image_get_median(target_image));</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="keywordflow">if</span> (cpl_image_subtract</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>                 (target_image, master_sky)!=CPL_ERROR_NONE) </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>             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the bkg to the images"</span>);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             <span class="keywordflow">return</span> -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>     }</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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_msg_error(__func__, <span class="stringliteral">"A problem happened with sky subtraction"</span>);</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>         <span class="keywordflow">return</span> -1;</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> 0;</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="l00918"></a><span class="lineno">  918</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> <span class="keyword">static</span> hawki_distortion  ** hawki_cal_distortion_compute_dist_solution</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span> (cpl_apertures    *** apertures,</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>  <span class="keywordtype">int</span>                  nframes,</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>  cpl_bivector     *   offsets,   </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>  <span class="keywordtype">int</span>                  grid_points,</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>  <span class="keywordtype">int</span>              *   nmatched_pairs,</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>  <span class="keywordtype">double</span>           *   rms,</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>  hawki_distortion **  distortion_guess)</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="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     hawki_distortion ** distortion = NULL;</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_errorstate          error_prevstate = cpl_errorstate_get();</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="comment">/* Allocate the distortion */</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>     distortion = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(*distortion));</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">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_table       ** obj_pos;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         cpl_table       ** obj_pos_offset;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>         <span class="keywordtype">int</span>                iframe;</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         cpl_table        * matches;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>         hawki_distortion * dist_guess;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>         cpl_polynomial   * fit2d_x = NULL;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         cpl_polynomial   * fit2d_y = 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>         </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector %d"</span>, idet+1);</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         cpl_msg_indent_more();</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>         <span class="comment">/* Initialize the objects positions */</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>         obj_pos = </div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>             cpl_malloc(<span class="keyword">sizeof</span>(*obj_pos) * nframes);</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>         obj_pos_offset = </div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>             cpl_malloc(<span class="keyword">sizeof</span>(*obj_pos_offset) * nframes);</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)</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>             obj_pos[iframe] = cpl_table_new(0);</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             cpl_table_new_column</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>                 (obj_pos[iframe], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             cpl_table_new_column</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>                 (obj_pos[iframe], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);</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="comment">/* Loop on images to fill object_positions */</span></div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes ; ++iframe)</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_apertures   * this_apertures;</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="comment">/* Create the detected apertures list */</span></div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             this_apertures = apertures[idet][iframe];</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">/* Fill the objects position table */</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>             hawki_cal_distortion_fill_obj_pos(obj_pos[iframe],</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>                                               this_apertures);</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>             obj_pos_offset[iframe] = cpl_table_duplicate(obj_pos[iframe]);</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>         </div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>         <span class="comment">/* Get the objects positions with offsets */</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         hawki_cal_distortion_add_offset_to_positions</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>             (obj_pos_offset, offsets);</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="comment">/* Get the all the matching pairs */</span></div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>         cpl_msg_info(__func__, <span class="stringliteral">"Matching all catalogs (may take a while)"</span>);</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         matches =  irplib_match_cat_pairs(obj_pos_offset, nframes, </div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                                           <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a>);</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             cpl_table_delete(obj_pos_offset[iframe]);</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>         cpl_free(obj_pos_offset);</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         <span class="keywordflow">if</span>(matches == NULL)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot match objects "</span>);</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                 cpl_table_delete(obj_pos[iframe]);</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             cpl_free(obj_pos);</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>             <span class="keywordflow">return</span> 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_msg_info(__func__,<span class="stringliteral">"Number of matching pairs %"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>                      cpl_table_get_nrow(matches));</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>         nmatched_pairs[idet] = cpl_table_get_nrow(matches);</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">/* Compute the distortion */</span></div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>         cpl_msg_info(__func__, <span class="stringliteral">"Computing distortion with the matched objects"</span>);</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>         cpl_msg_info(__func__, <span class="stringliteral">"  (This step will take a long time to run)"</span>);</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>         <span class="keywordflow">if</span>(distortion_guess != NULL)</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>             dist_guess = distortion_guess[idet];</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>             dist_guess = NULL;</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>         distortion[idet] = hawki_distortion_compute_solution</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>              ((<span class="keyword">const</span> cpl_table **)obj_pos, offsets, matches,</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>               nframes, HAWKI_DET_NPIX_X , HAWKI_DET_NPIX_Y, grid_points,</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>               dist_guess, rms + idet);</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>         <span class="keywordflow">if</span>(distortion[idet] == NULL)</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="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>             cpl_msg_error(__func__,<span class="stringliteral">"Could not get the distortion"</span>);</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>             <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>                 cpl_table_delete(obj_pos[iframe]);</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>             cpl_free(obj_pos);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>                 <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>             cpl_table_delete(matches);</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>             <span class="keywordflow">return</span> NULL;</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">/* Removing the first order polinomial to the distortion */</span></div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>         <span class="keywordflow">if</span>(hawki_cal_distortion_config.subtract_linear)</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(__func__,<span class="stringliteral">"Subtracting first order polynomial"</span>);</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>             fit2d_x = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>             fit2d_y = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>             hawki_cal_distortion_fit_first_order_solution</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>                 (distortion[idet], fit2d_x, fit2d_y);</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</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>         <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>         <span class="keywordflow">for</span>(iframe = 0; iframe < nframes; ++iframe)</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>             cpl_table_delete(obj_pos[iframe]);</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>         cpl_free(obj_pos);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         <span class="keywordflow">if</span>(hawki_cal_distortion_config.subtract_linear)</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_polynomial_delete(fit2d_x);</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             cpl_polynomial_delete(fit2d_y);</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>         cpl_table_delete(matches);</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>         cpl_msg_indent_less();</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> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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>         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the distortion"</span>);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion[idet]);</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>         <span class="keywordflow">return</span> 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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>     <span class="keywordflow">return</span> distortion;</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> <span class="keyword">static</span> cpl_apertures * hawki_cal_distortion_get_image_apertures</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> (cpl_image * image,</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>  <span class="keywordtype">double</span> sigma_det)</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_apertures   * apertures = NULL;</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>     cpl_mask        * kernel = NULL;</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     cpl_mask        * object_mask = NULL;</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>     cpl_image       * labels = NULL;</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>     cpl_size          nobj;</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>     <span class="keywordtype">double</span>            median;</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>     <span class="keywordtype">double</span>            med_dist;</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>     <span class="keywordtype">double</span>            threshold;</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">/* Get the threshold */</span></div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>     median = cpl_image_get_median_dev(image, &med_dist);</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>     threshold = median + sigma_det * med_dist;</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     cpl_msg_info(__func__,<span class="stringliteral">"Detection threshold: %f"</span>, threshold);</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="comment">/* Create the mask */</span></div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     object_mask = cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>             (image, threshold, DBL_MAX);</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>     <span class="keywordflow">if</span> (object_mask == NULL)</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>         <span class="keywordflow">return</span> NULL;</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">/* Apply morphological opening to remove single pixel detections */</span></div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>     kernel = cpl_mask_new(3,3);</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>     cpl_mask_not(kernel);</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_mask_filter(object_mask, object_mask, kernel, </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>             CPL_FILTER_OPENING, CPL_BORDER_ZERO) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         cpl_mask_delete(object_mask) ;</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         cpl_mask_delete(kernel) ;</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>         <span class="keywordflow">return</span> NULL;</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>     cpl_mask_delete(kernel);</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="comment">/* Labelise the different detected apertures */</span></div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>     labels = cpl_image_labelise_mask_create(object_mask, &nobj);</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>     <span class="keywordflow">if</span> (labels == 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_mask_delete(object_mask);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>         <span class="keywordflow">return</span> 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>     cpl_mask_delete(object_mask);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>     cpl_msg_info(__func__, <span class="stringliteral">"Number of objects detected: %"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                  nobj);</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="comment">/* Create the detected apertures list */</span></div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>     apertures = cpl_apertures_new_from_image(image, labels);</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>     <span class="keywordflow">if</span> (apertures == NULL)</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>         cpl_image_delete(labels);</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>         <span class="keywordflow">return</span> NULL;</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_image_delete(labels);</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>     <span class="keywordflow">return</span> apertures;</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fill_obj_pos</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> (cpl_table     * objects_positions,</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>  cpl_apertures * apertures)</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>     cpl_size nobjs;</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>     cpl_size iobj;</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     <span class="keywordtype">double</span> border_off = 0;</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="comment">/* Take into account that the images have been trimmed */</span></div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>     <span class="keywordflow">if</span>(hawki_cal_distortion_config.borders > 0)</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         border_off = hawki_cal_distortion_config.borders;</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>     nobjs = cpl_apertures_get_size(apertures); </div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>     cpl_table_set_size(objects_positions, nobjs);</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">for</span> (iobj=0 ; iobj<nobjs ; iobj++)</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="comment">/* Fill with the already known information */</span></div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>         cpl_table_set_double(objects_positions, HAWKI_COL_OBJ_POSX, iobj, </div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                              cpl_apertures_get_centroid_x(apertures,</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                                                           iobj+1) + border_off);</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>         cpl_table_set_double(objects_positions, HAWKI_COL_OBJ_POSY, iobj, </div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>                              cpl_apertures_get_centroid_y(apertures,</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>                                                           iobj+1) + border_off);</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="keywordflow">return</span> 0;</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_add_offset_to_positions</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> (cpl_table     ** objects_positions,</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>  cpl_bivector   * offsets)</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="keywordtype">int</span> nframes;</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>     <span class="keywordtype">int</span> iframe;</div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>     cpl_size nobjs;</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>     cpl_size iobj;</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>     nframes = cpl_bivector_get_size(offsets); </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">for</span>(iframe = 0 ; iframe < nframes ; ++iframe)</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="keywordtype">double</span> offset_x;</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>         <span class="keywordtype">double</span> offset_y;</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>         <span class="keywordtype">int</span>    null;</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>         offset_x = cpl_bivector_get_x_data(offsets)[iframe];</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         offset_y = cpl_bivector_get_y_data(offsets)[iframe];</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>         nobjs = cpl_table_get_nrow(objects_positions[iframe]);</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nobjs ; iobj++)</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_table_set_double(objects_positions[iframe], </div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>                      HAWKI_COL_OBJ_POSX, iobj, </div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>                      cpl_table_get_double(objects_positions[iframe], </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>                              HAWKI_COL_OBJ_POSX, iobj, &null) + offset_x);</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>             cpl_table_set_double(objects_positions[iframe], </div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>                      HAWKI_COL_OBJ_POSY, iobj, </div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>                      cpl_table_get_double(objects_positions[iframe], </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>                              HAWKI_COL_OBJ_POSY, iobj, &null) + offset_y);</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>           </div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>     <span class="keywordflow">return</span> 0;</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_fit_first_order_solution</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span> (hawki_distortion * distortion,</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>  cpl_polynomial   * fit2d_x,</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>  cpl_polynomial   * fit2d_y)</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>     cpl_matrix      * pixel_pos;</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     cpl_vector      * dist_x_val;</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>     cpl_vector      * dist_y_val;</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>     <span class="keywordtype">int</span>               nx;</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>     <span class="keywordtype">int</span>               ny;</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>     <span class="keywordtype">int</span>               i;</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>     <span class="keywordtype">int</span>               j;</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>     <span class="keywordtype">int</span>               null;</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>     <span class="keyword">const</span> cpl_size    mindeg2d[] = {0, 0};</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     <span class="keyword">const</span> cpl_size    maxdeg2d[] = {1, 1};</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>     cpl_errorstate    error_prevstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     cpl_vector      * pix;</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>     cpl_image       * dist_x_plane;</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     cpl_image       * dist_y_plane;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordtype">double</span>            dist_x_mean;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordtype">double</span>            dist_y_mean;</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">/* Fill the bivector with pixel positions in X,Y */</span></div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>     nx = <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a>(distortion);</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>     ny = <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a>(distortion);</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>     pixel_pos = cpl_matrix_new(2, nx * ny);</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>     dist_x_val = cpl_vector_new(nx*ny);</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>     dist_y_val = cpl_vector_new(nx*ny);</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>     <span class="keywordflow">for</span>(i = 0; i < nx; ++i)</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         <span class="keywordflow">for</span>(j = 0; j < ny; ++j)</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>             cpl_matrix_set(pixel_pos, 0, i + nx * j, (<span class="keywordtype">double</span>)i);</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>             cpl_matrix_set(pixel_pos, 1, i + nx * j, (<span class="keywordtype">double</span>)j);</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>             cpl_vector_set(dist_x_val, i + nx * j,</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>                            cpl_image_get(distortion->dist_x, i+1, j+1, &null));</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>             cpl_vector_set(dist_y_val, i + nx * j,</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>                            cpl_image_get(distortion->dist_y, i+1, j+1, &null));</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">/* Fit the polynomial */</span></div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>     cpl_polynomial_fit(fit2d_x, pixel_pos, NULL, dist_x_val, </div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>                        NULL, CPL_FALSE, mindeg2d, maxdeg2d);</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>     cpl_polynomial_fit(fit2d_y, pixel_pos, NULL, dist_y_val,</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>                        NULL, CPL_FALSE, mindeg2d, maxdeg2d);</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     <span class="comment">/* Removing the constant term */</span></div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>     cpl_polynomial_set_coeff(fit2d_x, mindeg2d, 0.);</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>     cpl_polynomial_set_coeff(fit2d_y, mindeg2d, 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>     <span class="comment">/* Subtract the linear term */</span></div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>     pix = cpl_vector_new(2);</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     dist_x_plane = cpl_image_new(nx,ny,cpl_image_get_type(distortion->dist_x));</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     dist_y_plane = cpl_image_new(nx,ny,cpl_image_get_type(distortion->dist_y));</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>     <span class="keywordflow">for</span>(i = 0; i < nx; ++i)</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>         <span class="keywordflow">for</span>(j = 0; j < ny; ++j)</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>             <span class="keywordtype">double</span> fit_value_x;</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>             <span class="keywordtype">double</span> fit_value_y;</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>             cpl_vector_set(pix, 0, (<span class="keywordtype">double</span>)i);</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>             cpl_vector_set(pix, 1, (<span class="keywordtype">double</span>)j);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>             fit_value_x = cpl_polynomial_eval(fit2d_x, pix);</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>             fit_value_y = cpl_polynomial_eval(fit2d_y, pix);</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>             cpl_image_set(dist_x_plane, i+1, j+1, fit_value_x);</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>             cpl_image_set(dist_y_plane, i+1, j+1, fit_value_y);</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>     cpl_image_subtract(distortion->dist_x, dist_x_plane);</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     cpl_image_subtract(distortion->dist_y, dist_y_plane);</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>     <span class="comment">/* Subtract the mean distortion, again */</span></div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     dist_x_mean = cpl_image_get_mean(distortion->dist_x);</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     dist_y_mean = cpl_image_get_mean(distortion->dist_y);</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     cpl_msg_warning(__func__,<span class="stringliteral">"Subtracting mean distortion in X %f"</span>,dist_x_mean);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     cpl_msg_warning(__func__,<span class="stringliteral">"Subtracting mean distortion in Y %f"</span>,dist_y_mean);</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>     cpl_image_subtract_scalar(distortion->dist_x, dist_x_mean);</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>     cpl_image_subtract_scalar(distortion->dist_y, dist_y_mean);</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">/* Free and return */</span></div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>     cpl_matrix_delete(pixel_pos);</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>     cpl_vector_delete(dist_x_val);</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     cpl_vector_delete(dist_y_val);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     cpl_vector_delete(pix);</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>     cpl_image_delete(dist_x_plane);</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     cpl_image_delete(dist_y_plane);</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>     </div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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>         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the linear term"</span>);</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>         cpl_msg_error(__func__,<span class="stringliteral">"Error %s"</span>,cpl_error_get_message());</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         <span class="comment">//cpl_msg_error(__func__,"Where  %s",cpl_error_get_where());</span></div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         <span class="keywordflow">return</span> -1;</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">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_propertylist ** hawki_cal_distortion_qc</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span> (hawki_distortion ** distortion,</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>  <span class="keywordtype">int</span>              *  nmatched_pairs,</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>  <span class="keywordtype">double</span>           *  rms)</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> idet;</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     cpl_propertylist ** qclists;</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="comment">/* Allocate the qclists */</span></div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</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">/* Loop on the detectors to get the mean zpoint */</span></div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS ; ++idet)</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">/* Allocate this qclist */</span></div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>         qclists[idet] = cpl_propertylist_new() ;</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_propertylist_append_double</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>             (qclists[idet], <span class="stringliteral">"ESO QC DIST NMATCHED"</span>, nmatched_pairs[idet]);</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>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>             (qclists[idet], <span class="stringliteral">"ESO QC DIST TOTAL RMS"</span>, rms[idet]);</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>         <span class="comment">/* Getting the jacobian of the distortion map */</span></div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>         <span class="comment">/* The jacobian has to be definitive positive in all the detector to </span></div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span> <span class="comment">         * be have a biyective function invertible anywhere:</span></div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span> <span class="comment">         * http://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant#Jacobian_determinant</span></div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span> <span class="comment">         * http://en.wikipedia.org/wiki/Inverse_function#Inverses_and_derivatives</span></div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> <span class="comment">         * This should be a QC check.</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>         </div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>         <span class="comment">//cpl_propertylist_append_double</span></div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>         <span class="comment">//(qclists[idet], "ESO QC DIST JACOBIAN_1_1", jacobian[1][1]);</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>     </div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>     <span class="keywordflow">return</span> qclists;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_save</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span> (hawki_distortion       **  distortion,</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>  cpl_parameterlist       *  parlist,</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>  cpl_propertylist       **  qclists,</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>  cpl_frameset            *  recipe_set)</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="keyword">const</span> <span class="keywordtype">char</span>   * recipe_name = <span class="stringliteral">"hawki_cal_distortion"</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="comment">/* Write the distortion in both axes */</span></div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>     <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a>(recipe_set,</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>                           parlist,</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>                           recipe_set,</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>                           (<span class="keyword">const</span> hawki_distortion **) distortion,</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>                           recipe_name,</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>                           NULL,</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>                           (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>                           <span class="stringliteral">"hawki_cal_distortion_x.fits"</span>,</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>                           <span class="stringliteral">"hawki_cal_distortion_y.fits"</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>     <span class="keywordflow">return</span>  0;</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> </div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_distortion_retrieve_input_param</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span> (cpl_parameterlist  *  parlist)</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>     cpl_parameter   *   par ;</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>     par = NULL ;</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.sigma_det"</span>);</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     hawki_cal_distortion_config.sigma_det = cpl_parameter_get_double(par);</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.grid_points"</span>);</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>     hawki_cal_distortion_config.grid_points = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.borders"</span>);</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>     hawki_cal_distortion_config.borders = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         (parlist, <span class="stringliteral">"hawki.hawki_cal_distortion.subtract_linear"</span>);</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>     hawki_cal_distortion_config.subtract_linear = cpl_parameter_get_bool(par);</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>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</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/hawki__cal__flat_8c_source.html b/html/hawki__cal__flat_8c_source.html
index 96a9cef..d55a7fd 100644
--- a/html/hawki__cal__flat_8c_source.html
+++ b/html/hawki__cal__flat_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_flat.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,1884 +40,1885 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_flat.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_flat.c,v 1.25 2012/01/11 15:02:18 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/01/11 15:02:18 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.25 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <string.h></span>
-<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 "irplib_utils.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00048"></a>00048 
-<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> <span class="keywordtype">int</span> hawki_cal_flat_create(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_exec(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_destroy(cpl_plugin *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_retrieve_input_param
-<a name="l00059"></a>00059 (cpl_parameterlist  *  parlist);
-<a name="l00060"></a>00060 <span class="keyword">static</span> cpl_imagelist ** hawki_cal_flat_reduce(
-<a name="l00061"></a>00061         cpl_frameset    *   flatframes,
-<a name="l00062"></a>00062         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_file,
-<a name="l00063"></a>00063         cpl_table       **  raw_flat_stats,
-<a name="l00064"></a>00064         cpl_table       **  raw_flat_odd_column_stats,
-<a name="l00065"></a>00065         cpl_table       **  raw_flat_even_column_stats,
-<a name="l00066"></a>00066         cpl_table       **  raw_flat_odd_row_stats,
-<a name="l00067"></a>00067         cpl_table       **  raw_flat_even_row_stats,
-<a name="l00068"></a>00068         cpl_vector      **  selected); 
-<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_clean_outliers(cpl_image *, cpl_imagelist *,
-<a name="l00070"></a>00070         cpl_imagelist *, cpl_vector *, cpl_image **) ;
-<a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_save
-<a name="l00072"></a>00072 (cpl_imagelist     ** flat,
-<a name="l00073"></a>00073  cpl_table         ** raw_flat_stats,
-<a name="l00074"></a>00074  cpl_table         ** raw_flat_odd_column_stats,
-<a name="l00075"></a>00075  cpl_table         ** raw_flat_even_column_stats,
-<a name="l00076"></a>00076  cpl_table         ** raw_flat_odd_row_stats,
-<a name="l00077"></a>00077  cpl_table         ** raw_flat_even_row_stats,
-<a name="l00078"></a>00078  cpl_vector        ** raw_selected,
-<a name="l00079"></a>00079  <span class="keywordtype">int</span>                  set_nb,
-<a name="l00080"></a>00080  <span class="keyword">const</span> cpl_frame   *  bpmdark,
-<a name="l00081"></a>00081  cpl_frameset      *  flatframes,
-<a name="l00082"></a>00082  cpl_frameset      *  calibframes,
-<a name="l00083"></a>00083  cpl_parameterlist *  parlist,
-<a name="l00084"></a>00084  cpl_frameset      *  set_tot);
-<a name="l00085"></a>00085 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_compare(<span class="keyword">const</span> cpl_frame *, <span class="keyword">const</span> cpl_frame *) ;
-<a name="l00086"></a>00086 <span class="keyword">static</span> cpl_imagelist * hawki_cal_flat_merge_bpms
-<a name="l00087"></a>00087 (<span class="keyword">const</span> cpl_frame *   bpm_orig,
-<a name="l00088"></a>00088  cpl_imagelist   *   bpm_to_add);
-<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_select
-<a name="l00090"></a>00090 (cpl_vector  *   meds,
-<a name="l00091"></a>00091  cpl_vector  *   rms,
-<a name="l00092"></a>00092  <span class="keywordtype">int</span>             auto_flag,
-<a name="l00093"></a>00093  <span class="keywordtype">int</span>             auto_max_bins,
-<a name="l00094"></a>00094  <span class="keywordtype">double</span>          min_level,
-<a name="l00095"></a>00095  <span class="keywordtype">double</span>          max_level,
-<a name="l00096"></a>00096  <span class="keywordtype">double</span>          max_rms,
-<a name="l00097"></a>00097  <span class="keywordtype">int</span>             min_nframes,
-<a name="l00098"></a>00098  cpl_vector  *   selection);
-<a name="l00099"></a>00099 <span class="keyword">static</span> cpl_vector * hawki_cal_flat_extract_vector(cpl_vector *,
-<a name="l00100"></a>00100         cpl_vector *) ;
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00103"></a>00103 <span class="comment">                            Static variables</span>
-<a name="l00104"></a>00104 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00107"></a>00107     <span class="comment">/* Inputs */</span>
-<a name="l00108"></a>00108     <span class="keywordtype">int</span>         llx ;
-<a name="l00109"></a>00109     <span class="keywordtype">int</span>         lly ;
-<a name="l00110"></a>00110     <span class="keywordtype">int</span>         urx ;
-<a name="l00111"></a>00111     <span class="keywordtype">int</span>         ury ;
-<a name="l00112"></a>00112     <span class="keywordtype">int</span>         normalise ;
-<a name="l00113"></a>00113     <span class="keywordtype">int</span>         second_pass ;
-<a name="l00114"></a>00114     <span class="keywordtype">double</span>      sigma_badres ;
-<a name="l00115"></a>00115     <span class="keywordtype">double</span>      sigma_bpm ;
-<a name="l00116"></a>00116     <span class="keywordtype">double</span>      lowval_bpm ;
-<a name="l00117"></a>00117     <span class="keywordtype">double</span>      highval_bpm ;
-<a name="l00118"></a>00118     <span class="keywordtype">int</span>         select_auto ;
-<a name="l00119"></a>00119     <span class="keywordtype">int</span>         select_auto_max_bins;
-<a name="l00120"></a>00120     <span class="keywordtype">double</span>      select_min_level[HAWKI_NB_DETECTORS];
-<a name="l00121"></a>00121     <span class="keywordtype">double</span>      select_max_level[HAWKI_NB_DETECTORS];
-<a name="l00122"></a>00122     <span class="keywordtype">double</span>      select_max_rms[HAWKI_NB_DETECTORS];
-<a name="l00123"></a>00123     <span class="keywordtype">int</span>         select_min_nframes ;
-<a name="l00124"></a>00124     <span class="keywordtype">int</span>         extra_stats;
-<a name="l00125"></a>00125 } hawki_cal_flat_config ;
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00128"></a>00128     <span class="comment">/* Outputs */</span>
-<a name="l00129"></a>00129     <span class="keywordtype">int</span>         nb_badpix[HAWKI_NB_DETECTORS];
-<a name="l00130"></a>00130     <span class="keywordtype">double</span>      norm[HAWKI_NB_DETECTORS];
-<a name="l00131"></a>00131     <span class="keywordtype">double</span>      med_stdev[HAWKI_NB_DETECTORS];
-<a name="l00132"></a>00132     <span class="keywordtype">double</span>      med_avg[HAWKI_NB_DETECTORS];
-<a name="l00133"></a>00133     <span class="keywordtype">double</span>      med_med[HAWKI_NB_DETECTORS];
-<a name="l00134"></a>00134     <span class="keywordtype">double</span>      med_min[HAWKI_NB_DETECTORS];
-<a name="l00135"></a>00135     <span class="keywordtype">double</span>      med_max[HAWKI_NB_DETECTORS];
-<a name="l00136"></a>00136 } hawki_cal_flat_outputs;
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_flat_description[] = 
-<a name="l00139"></a>00139 <span class="stringliteral">"hawki_cal_flat -- HAWKĪI imaging flat-field creation from twillight images.\n"</span>
-<a name="l00140"></a>00140 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00141"></a>00141 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00142"></a>00142 <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_FLAT_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00143"></a>00143 <span class="stringliteral">"Optional inputs are:\n"</span>
-<a name="l00144"></a>00144 <span class="stringliteral">"bpmdark-file.fits "</span>HAWKI_CALPRO_BPM_HOT<span class="stringliteral">"\n"</span>
-<a name="l00145"></a>00145 <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">"\n"</span>
-<a name="l00146"></a>00146 <span class="stringliteral">"dark_err-file.fits "</span>HAWKI_CALPRO_DARK_ERR<span class="stringliteral">"\n"</span>
-<a name="l00147"></a>00147 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00148"></a>00148 <span class="stringliteral">"hawki_cal_flat_setxx.fits ("</span>HAWKI_CALPRO_FLAT<span class="stringliteral">"): Master flat for filter xx\n"</span>
-<a name="l00149"></a>00149 <span class="stringliteral">"hawki_cal_flat_err_setxx.fits ("</span>HAWKI_CALPRO_FLAT_ERRMAP<span class="stringliteral">"): Master flat residuals\n"</span>
-<a name="l00150"></a>00150 <span class="stringliteral">"hawki_cal_flat_bpmflat_setxx.fits ("</span>HAWKI_CALPRO_BPM_COLD<span class="stringliteral">"): BPM from the flat\n"</span>
-<a name="l00151"></a>00151 <span class="stringliteral">"hawki_cal_flat_stats_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS<span class="stringliteral">"): Stats of the individual flats\n"</span>
-<a name="l00152"></a>00152 <span class="stringliteral">"Optionally it also creates:\n"</span>
-<a name="l00153"></a>00153 <span class="stringliteral">"hawki_cal_flat_bpm_setxx.fits ("</span>HAWKI_CALPRO_BPM<span class="stringliteral">"): Bad pixel mask combining bpm from dark and flat\n"</span>
-<a name="l00154"></a>00154 <span class="stringliteral">"hawki_cal_flat_stats_ec_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_EVEN_COL<span class="stringliteral">"): Stats of the individual flats for even columns\n"</span>
-<a name="l00155"></a>00155 <span class="stringliteral">"hawki_cal_flat_stats_oc_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_ODD_COL<span class="stringliteral">"): Stats of the individual flats for odd columns\n"</span>
-<a name="l00156"></a>00156 <span class="stringliteral">"hawki_cal_flat_stats_er_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_EVEN_ROW<span class="stringliteral">"): Stats of the individual flats for even rows\n"</span>
-<a name="l00157"></a>00157 <span class="stringliteral">"hawki_cal_flat_stats_or_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_ODD_ROW<span class="stringliteral">"): Stats of the individual flats for odd rows\n"</span>
-<a name="l00158"></a>00158 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00159"></a>00159 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00160"></a>00160 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00167"></a>00167 <span class="comment">                                Functions code</span>
-<a name="l00168"></a>00168 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00178"></a>00178 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00179"></a>00179 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00180"></a>00180 {
-<a name="l00181"></a>00181     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00182"></a>00182     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     cpl_plugin_init(plugin,
-<a name="l00185"></a>00185                     CPL_PLUGIN_API,
-<a name="l00186"></a>00186                     HAWKI_BINARY_VERSION,
-<a name="l00187"></a>00187                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00188"></a>00188                     <span class="stringliteral">"hawki_cal_flat"</span>,
-<a name="l00189"></a>00189                     <span class="stringliteral">"Twillight flat recipe"</span>,
-<a name="l00190"></a>00190                     hawki_cal_flat_description,
-<a name="l00191"></a>00191                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00192"></a>00192                     PACKAGE_BUGREPORT,  
-<a name="l00193"></a>00193                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00194"></a>00194                     hawki_cal_flat_create,
-<a name="l00195"></a>00195                     hawki_cal_flat_exec,
-<a name="l00196"></a>00196                     hawki_cal_flat_destroy) ;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     cpl_pluginlist_append(list, plugin) ;
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     <span class="keywordflow">return</span> 0;
-<a name="l00201"></a>00201 }
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00212"></a>00212 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00213"></a>00213 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_create(cpl_plugin * plugin)
-<a name="l00214"></a>00214 {
-<a name="l00215"></a>00215     cpl_recipe      * recipe ;
-<a name="l00216"></a>00216     cpl_parameter   * p ;
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00219"></a>00219     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00220"></a>00220         recipe = (cpl_recipe *)plugin ;
-<a name="l00221"></a>00221     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00224"></a>00224     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00227"></a>00227     <span class="comment">/* --zone */</span>
-<a name="l00228"></a>00228     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.zone"</span>,
-<a name="l00229"></a>00229                                 CPL_TYPE_STRING,
-<a name="l00230"></a>00230                                 <span class="stringliteral">"Stats zone"</span>,
-<a name="l00231"></a>00231                                 <span class="stringliteral">"hawki.hawki_cal_flat"</span>,
-<a name="l00232"></a>00232                                 <span class="stringliteral">"1,1,2048,2048"</span>) ;
-<a name="l00233"></a>00233     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"zone"</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">/* --normalise */</span>
-<a name="l00238"></a>00238     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.normalise"</span>,
-<a name="l00239"></a>00239             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to apply the normalisation"</span>,
-<a name="l00240"></a>00240             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, FALSE) ;
-<a name="l00241"></a>00241     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"normalise"</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">/* --second_pass */</span>
-<a name="l00246"></a>00246     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.second_pass"</span>,
-<a name="l00247"></a>00247             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to apply a second pass computation"</span>,
-<a name="l00248"></a>00248             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, TRUE) ;
-<a name="l00249"></a>00249     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"second_pass"</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">/* --sigma_badres */</span>
-<a name="l00254"></a>00254     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.sigma_badres"</span>,
-<a name="l00255"></a>00255             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for detection of bad flat results"</span>,
-<a name="l00256"></a>00256             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 1.0) ;
-<a name="l00257"></a>00257     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_badres"</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">/* --sigma_bpm */</span>
-<a name="l00262"></a>00262     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.sigma_bpm"</span>,
-<a name="l00263"></a>00263             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for detection of bad pixels"</span>,
-<a name="l00264"></a>00264             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10.0) ;
-<a name="l00265"></a>00265     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_bpm"</span>) ;
-<a name="l00266"></a>00266     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00267"></a>00267     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00268"></a>00268  
-<a name="l00269"></a>00269     <span class="comment">/* --lowval_bpm */</span>
-<a name="l00270"></a>00270     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.lowval_bpm"</span>,
-<a name="l00271"></a>00271             CPL_TYPE_DOUBLE, <span class="stringliteral">"values of the flat below this will be included "</span>
-<a name="l00272"></a>00272             <span class="stringliteral">"in the bpm. In units of final flat (normalised if normalise is on)"</span>,
-<a name="l00273"></a>00273             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, .1) ;
-<a name="l00274"></a>00274     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"lowval_bpm"</span>) ;
-<a name="l00275"></a>00275     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00276"></a>00276     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00277"></a>00277  
-<a name="l00278"></a>00278     <span class="comment">/* --highval_bpm */</span>
-<a name="l00279"></a>00279     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.highval_bpm"</span>,
-<a name="l00280"></a>00280             CPL_TYPE_DOUBLE, <span class="stringliteral">"values of the flat above this will be included "</span>
-<a name="l00281"></a>00281             <span class="stringliteral">"in the bpm. In units of final flat (normalized if normalise is on)"</span>,
-<a name="l00282"></a>00282             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10.0) ;
-<a name="l00283"></a>00283     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"highval_bpm"</span>) ;
-<a name="l00284"></a>00284     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00285"></a>00285     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00286"></a>00286  
-<a name="l00287"></a>00287     <span class="comment">/* --select_auto */</span>
-<a name="l00288"></a>00288     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_auto"</span>,
-<a name="l00289"></a>00289             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to automatically select the good input frames"</span>,
-<a name="l00290"></a>00290             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, TRUE);
-<a name="l00291"></a>00291     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_auto"</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">/* --select_auto_max_bins */</span>
-<a name="l00296"></a>00296     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_auto_max_bins"</span>,
-<a name="l00297"></a>00297             CPL_TYPE_INT, <span class="stringliteral">"Maximum number of frames requested"</span>,
-<a name="l00298"></a>00298             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10) ;
-<a name="l00299"></a>00299     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_auto_max_bins"</span>);
-<a name="l00300"></a>00300     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00301"></a>00301     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00302"></a>00302  
-<a name="l00303"></a>00303     <span class="comment">/* --select_min_level */</span>
-<a name="l00304"></a>00304     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_min_level"</span>,
-<a name="l00305"></a>00305             CPL_TYPE_STRING, <span class="stringliteral">"Minimum ADU level for frames selection"</span>,
-<a name="l00306"></a>00306             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"-1.0"</span>) ;
-<a name="l00307"></a>00307     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_min_level"</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">/* --select_max_level */</span>
-<a name="l00312"></a>00312     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_max_level"</span>,
-<a name="l00313"></a>00313             CPL_TYPE_STRING, <span class="stringliteral">"Maximum ADU level for frames selection"</span>,
-<a name="l00314"></a>00314             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"25000"</span>);
-<a name="l00315"></a>00315     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_max_level"</span>);
-<a name="l00316"></a>00316     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00317"></a>00317     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00318"></a>00318  
-<a name="l00319"></a>00319     <span class="comment">/* --select_max_rms */</span>
-<a name="l00320"></a>00320     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_max_rms"</span>,
-<a name="l00321"></a>00321             CPL_TYPE_STRING, <span class="stringliteral">"Maximum RMS for frames selection"</span>,
-<a name="l00322"></a>00322             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"4000"</span>);
-<a name="l00323"></a>00323     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_max_rms"</span>);
-<a name="l00324"></a>00324     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00325"></a>00325     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00326"></a>00326  
-<a name="l00327"></a>00327     <span class="comment">/* --select_min_nframes */</span>
-<a name="l00328"></a>00328     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_min_nframes"</span>,
-<a name="l00329"></a>00329             CPL_TYPE_INT, <span class="stringliteral">"Minimum number of frames requested"</span>,
-<a name="l00330"></a>00330             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 3);
-<a name="l00331"></a>00331     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_min_nframes"</span>) ;
-<a name="l00332"></a>00332     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00333"></a>00333     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00334"></a>00334  
-<a name="l00335"></a>00335     <span class="comment">/* --extra_stats */</span>
-<a name="l00336"></a>00336     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.extra_stats"</span>,
-<a name="l00337"></a>00337             CPL_TYPE_BOOL, <span class="stringliteral">"Request for even/odd column/rows statistics"</span>,
-<a name="l00338"></a>00338             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, FALSE) ;
-<a name="l00339"></a>00339     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"extra_stats"</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">/* Return */</span>
-<a name="l00344"></a>00344     <span class="keywordflow">return</span> 0;
-<a name="l00345"></a>00345 }
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00353"></a>00353 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00354"></a>00354 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_exec(cpl_plugin * plugin)
-<a name="l00355"></a>00355 {
-<a name="l00356"></a>00356     cpl_recipe  *   recipe ;
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="comment">/* Issue a banner */</span>
-<a name="l00364"></a>00364     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordflow">return</span> hawki_cal_flat(recipe->parameters, recipe->frames) ;
-<a name="l00367"></a>00367 }
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00375"></a>00375 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00376"></a>00376 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_destroy(cpl_plugin * plugin)
-<a name="l00377"></a>00377 {
-<a name="l00378"></a>00378     cpl_recipe  *   recipe ;
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00381"></a>00381     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00382"></a>00382         recipe = (cpl_recipe *)plugin ;
-<a name="l00383"></a>00383     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00386"></a>00386     <span class="keywordflow">return</span> 0 ;
-<a name="l00387"></a>00387 }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00396"></a>00396 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00397"></a>00397 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat(
-<a name="l00398"></a>00398         cpl_parameterlist   *   parlist, 
-<a name="l00399"></a>00399         cpl_frameset        *   framelist)
-<a name="l00400"></a>00400 {
-<a name="l00401"></a>00401     cpl_size        *   labels ;
-<a name="l00402"></a>00402     cpl_size            nlabels ;
-<a name="l00403"></a>00403     cpl_frameset    *   flatframes ;
-<a name="l00404"></a>00404     <span class="keywordtype">int</span>                 nflats;
-<a name="l00405"></a>00405     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark ;
-<a name="l00406"></a>00406     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_err;
-<a name="l00407"></a>00407     <span class="keyword">const</span> cpl_frame *   bpmdark ;
-<a name="l00408"></a>00408     cpl_imagelist   **  twflat ;
-<a name="l00409"></a>00409     cpl_table       **  raw_flat_stats;
-<a name="l00410"></a>00410     cpl_table       **  raw_flat_odd_column_stats = NULL;
-<a name="l00411"></a>00411     cpl_table       **  raw_flat_even_column_stats = NULL;
-<a name="l00412"></a>00412     cpl_table       **  raw_flat_odd_row_stats = NULL;
-<a name="l00413"></a>00413     cpl_table       **  raw_flat_even_row_stats = NULL;
-<a name="l00414"></a>00414     cpl_vector      **  raw_selected;
-<a name="l00415"></a>00415     cpl_size            i;
-<a name="l00416"></a>00416     <span class="keywordtype">int</span>                 j ;
-<a name="l00417"></a>00417     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l00418"></a>00418     
-<a name="l00419"></a>00419     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00420"></a>00420     <span class="keywordflow">if</span>(hawki_cal_flat_retrieve_input_param(parlist))
-<a name="l00421"></a>00421     {
-<a name="l00422"></a>00422         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00423"></a>00423         <span class="keywordflow">return</span> -1;
-<a name="l00424"></a>00424     }
-<a name="l00425"></a>00425     
-<a name="l00426"></a>00426     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00427"></a>00427     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00428"></a>00428         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00429"></a>00429         <span class="keywordflow">return</span> -1;
-<a name="l00430"></a>00430     }
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00433"></a>00433     <span class="keywordflow">if</span> ((flatframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,
-<a name="l00434"></a>00434                     HAWKI_CAL_FLAT_RAW)) == NULL) {
-<a name="l00435"></a>00435         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find flat frames in the input list (%s)"</span>,
-<a name="l00436"></a>00436                       HAWKI_CAL_FLAT_RAW);
-<a name="l00437"></a>00437         <span class="keywordflow">return</span> -1 ;
-<a name="l00438"></a>00438     }
-<a name="l00439"></a>00439 
-<a name="l00440"></a>00440     <span class="comment">/* Retrieve calibration frames */</span>
-<a name="l00441"></a>00441     bpmdark = cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM_HOT);
-<a name="l00442"></a>00442     dark = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK);
-<a name="l00443"></a>00443     dark_err = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK_ERR);
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     <span class="comment">/* Labelise all input flat frames */</span>
-<a name="l00446"></a>00446     labels = cpl_frameset_labelise(flatframes, hawki_cal_flat_compare, 
-<a name="l00447"></a>00447                 &nlabels);
-<a name="l00448"></a>00448     <span class="keywordflow">if</span> (labels == NULL) {
-<a name="l00449"></a>00449         cpl_msg_error(__func__, <span class="stringliteral">"Cannot labelise input frames"</span>) ;
-<a name="l00450"></a>00450         cpl_frameset_delete(flatframes);
-<a name="l00451"></a>00451         <span class="keywordflow">return</span> -1;
-<a name="l00452"></a>00452     }
-<a name="l00453"></a>00453    
-<a name="l00454"></a>00454     <span class="comment">/* Extract sets and reduce each of them */</span>
-<a name="l00455"></a>00455     <span class="keywordflow">for</span> (i=0 ; i<nlabels ; i++) 
-<a name="l00456"></a>00456     {
-<a name="l00457"></a>00457         cpl_frameset    *   this_filter_flats;
-<a name="l00458"></a>00458         
-<a name="l00459"></a>00459         <span class="comment">/* Reduce data set nb i */</span>
-<a name="l00460"></a>00460         cpl_msg_info(__func__, <span class="stringliteral">"Reduce data set no %d out of %d"</span>, i+1, nlabels);
-<a name="l00461"></a>00461         cpl_msg_indent_more() ;
-<a name="l00462"></a>00462         this_filter_flats = cpl_frameset_extract(flatframes, labels, i) ;
-<a name="l00463"></a>00463         nflats = cpl_frameset_get_size(this_filter_flats);
-<a name="l00464"></a>00464         
-<a name="l00465"></a>00465         <span class="comment">/* Allocate and initialize statistics */</span>
-<a name="l00466"></a>00466         raw_flat_stats = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00467"></a>00467         raw_selected = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_vector*));
-<a name="l00468"></a>00468         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00469"></a>00469         {
-<a name="l00470"></a>00470             raw_selected[j] = cpl_vector_new(nflats);
-<a name="l00471"></a>00471             raw_flat_stats[j] = cpl_table_new(nflats);
-<a name="l00472"></a>00472         }
-<a name="l00473"></a>00473         <span class="comment">/* Initialize the statistics table */</span>
-<a name="l00474"></a>00474         <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_stats);
-<a name="l00475"></a>00475         <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l00476"></a>00476         {
-<a name="l00477"></a>00477             raw_flat_odd_column_stats = 
-<a name="l00478"></a>00478                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00479"></a>00479             raw_flat_even_column_stats = 
-<a name="l00480"></a>00480                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00481"></a>00481             raw_flat_odd_row_stats = 
-<a name="l00482"></a>00482                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00483"></a>00483             raw_flat_even_row_stats = 
-<a name="l00484"></a>00484                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00485"></a>00485             <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00486"></a>00486             {
-<a name="l00487"></a>00487                 raw_flat_odd_column_stats[j] = cpl_table_new(nflats);
-<a name="l00488"></a>00488                 raw_flat_even_column_stats[j] = cpl_table_new(nflats);
-<a name="l00489"></a>00489                 raw_flat_odd_row_stats[j] = cpl_table_new(nflats);
-<a name="l00490"></a>00490                 raw_flat_even_row_stats[j] = cpl_table_new(nflats);
-<a name="l00491"></a>00491             }
-<a name="l00492"></a>00492             <span class="comment">/* Initialize the statistics table */</span>
-<a name="l00493"></a>00493             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_odd_column_stats);
-<a name="l00494"></a>00494             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_even_column_stats);
-<a name="l00495"></a>00495             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_odd_row_stats);
-<a name="l00496"></a>00496             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_even_row_stats);
-<a name="l00497"></a>00497         }
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499         <span class="comment">/* Reduce */</span>
-<a name="l00500"></a>00500         <span class="keywordflow">if</span> ((twflat = hawki_cal_flat_reduce
-<a name="l00501"></a>00501                 (this_filter_flats, 
-<a name="l00502"></a>00502                  dark,
-<a name="l00503"></a>00503                  raw_flat_stats,
-<a name="l00504"></a>00504                  raw_flat_odd_column_stats,
-<a name="l00505"></a>00505                  raw_flat_even_column_stats,
-<a name="l00506"></a>00506                  raw_flat_odd_row_stats,
-<a name="l00507"></a>00507                  raw_flat_even_row_stats,
-<a name="l00508"></a>00508                  raw_selected)) == NULL) 
-<a name="l00509"></a>00509         {
-<a name="l00510"></a>00510             <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00511"></a>00511             {
-<a name="l00512"></a>00512                 cpl_table_delete(raw_flat_stats[j]);
-<a name="l00513"></a>00513                 cpl_vector_delete(raw_selected[j]);
-<a name="l00514"></a>00514             }
-<a name="l00515"></a>00515             cpl_free(raw_flat_stats);
-<a name="l00516"></a>00516             cpl_free(raw_selected);
-<a name="l00517"></a>00517             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l00518"></a>00518             {
-<a name="l00519"></a>00519                 <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00520"></a>00520                 {
-<a name="l00521"></a>00521                     cpl_table_delete(raw_flat_odd_column_stats[j]);
-<a name="l00522"></a>00522                     cpl_table_delete(raw_flat_even_column_stats[j]);
-<a name="l00523"></a>00523                     cpl_table_delete(raw_flat_odd_row_stats[j]);
-<a name="l00524"></a>00524                     cpl_table_delete(raw_flat_even_row_stats[j]);
-<a name="l00525"></a>00525                 }
-<a name="l00526"></a>00526                 cpl_free(raw_flat_odd_column_stats);
-<a name="l00527"></a>00527                 cpl_free(raw_flat_even_column_stats);
-<a name="l00528"></a>00528                 cpl_free(raw_flat_odd_row_stats);
-<a name="l00529"></a>00529                 cpl_free(raw_flat_even_row_stats);
-<a name="l00530"></a>00530             }
-<a name="l00531"></a>00531             cpl_frameset_delete(this_filter_flats);
-<a name="l00532"></a>00532             cpl_frameset_delete(flatframes);
-<a name="l00533"></a>00533             cpl_free(labels);
-<a name="l00534"></a>00534             cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce set nb %d"</span>, i+1) ;
-<a name="l00535"></a>00535             <span class="keywordflow">return</span> 1;
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537         } <span class="keywordflow">else</span> {
-<a name="l00538"></a>00538             <span class="comment">/* Save the products */</span>
-<a name="l00539"></a>00539             cpl_frameset    *   calib_frames;
-<a name="l00540"></a>00540 
-<a name="l00541"></a>00541             cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00542"></a>00542             calib_frames = cpl_frameset_new();
-<a name="l00543"></a>00543             <span class="keywordflow">if</span>(bpmdark)
-<a name="l00544"></a>00544                 cpl_frameset_insert(calib_frames, cpl_frame_duplicate(bpmdark));
-<a name="l00545"></a>00545             <span class="keywordflow">if</span>(dark)
-<a name="l00546"></a>00546                 cpl_frameset_insert(calib_frames,
-<a name="l00547"></a>00547                         cpl_frame_duplicate(cpl_frameset_find_const(framelist, 
-<a name="l00548"></a>00548                                 HAWKI_CALPRO_DARK)));
-<a name="l00549"></a>00549             <span class="keywordflow">if</span>(dark_err)
-<a name="l00550"></a>00550                 cpl_frameset_insert(calib_frames,
-<a name="l00551"></a>00551                         cpl_frame_duplicate(cpl_frameset_find_const(framelist, 
-<a name="l00552"></a>00552                                 HAWKI_CALPRO_DARK_ERR)));
-<a name="l00553"></a>00553             hawki_cal_flat_save
-<a name="l00554"></a>00554                 (twflat, raw_flat_stats, 
-<a name="l00555"></a>00555                  raw_flat_odd_column_stats,
-<a name="l00556"></a>00556                  raw_flat_even_column_stats,
-<a name="l00557"></a>00557                  raw_flat_odd_row_stats,
-<a name="l00558"></a>00558                  raw_flat_even_row_stats,
-<a name="l00559"></a>00559                  raw_selected,
-<a name="l00560"></a>00560                  i+1, bpmdark, this_filter_flats, calib_frames, 
-<a name="l00561"></a>00561                  parlist, framelist);
-<a name="l00562"></a>00562             cpl_imagelist_delete(twflat[0]);
-<a name="l00563"></a>00563             cpl_imagelist_delete(twflat[1]);
-<a name="l00564"></a>00564             cpl_imagelist_delete(twflat[2]);
-<a name="l00565"></a>00565             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass)
-<a name="l00566"></a>00566                 cpl_imagelist_delete(twflat[3]);
-<a name="l00567"></a>00567             cpl_free(twflat);
-<a name="l00568"></a>00568             <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00569"></a>00569             {
-<a name="l00570"></a>00570                 cpl_table_delete(raw_flat_stats[j]);
-<a name="l00571"></a>00571                 cpl_vector_delete(raw_selected[j]);
-<a name="l00572"></a>00572             }
-<a name="l00573"></a>00573             cpl_free(raw_flat_stats);
-<a name="l00574"></a>00574             cpl_free(raw_selected);
-<a name="l00575"></a>00575             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l00576"></a>00576             {
-<a name="l00577"></a>00577                 <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)
-<a name="l00578"></a>00578                 {
-<a name="l00579"></a>00579                     cpl_table_delete(raw_flat_odd_column_stats[j]);
-<a name="l00580"></a>00580                     cpl_table_delete(raw_flat_even_column_stats[j]);
-<a name="l00581"></a>00581                     cpl_table_delete(raw_flat_odd_row_stats[j]);
-<a name="l00582"></a>00582                     cpl_table_delete(raw_flat_even_row_stats[j]);
-<a name="l00583"></a>00583                 }
-<a name="l00584"></a>00584                 cpl_free(raw_flat_odd_column_stats);
-<a name="l00585"></a>00585                 cpl_free(raw_flat_even_column_stats);
-<a name="l00586"></a>00586                 cpl_free(raw_flat_odd_row_stats);
-<a name="l00587"></a>00587                 cpl_free(raw_flat_even_row_stats);
-<a name="l00588"></a>00588             }
-<a name="l00589"></a>00589             cpl_frameset_delete(calib_frames);            
-<a name="l00590"></a>00590         }
-<a name="l00591"></a>00591         cpl_msg_indent_less();
-<a name="l00592"></a>00592         cpl_frameset_delete(this_filter_flats);
-<a name="l00593"></a>00593     }
-<a name="l00594"></a>00594     
-<a name="l00595"></a>00595     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00596"></a>00596         cpl_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span>
-<a name="l00597"></a>00597                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00598"></a>00598     
-<a name="l00599"></a>00599     
-<a name="l00600"></a>00600     <span class="comment">/* Free and return */</span>
-<a name="l00601"></a>00601     cpl_frameset_delete(flatframes);
-<a name="l00602"></a>00602     cpl_free(labels); 
-<a name="l00603"></a>00603 
-<a name="l00604"></a>00604     <span class="comment">/* Return */</span>
-<a name="l00605"></a>00605     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l00606"></a>00606     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0;
-<a name="l00607"></a>00607 }
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00620"></a>00620 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00621"></a>00621 <span class="keyword">static</span> cpl_imagelist ** hawki_cal_flat_reduce(
-<a name="l00622"></a>00622         cpl_frameset    *   flatframes,
-<a name="l00623"></a>00623         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_file,
-<a name="l00624"></a>00624         cpl_table       **  raw_flat_stats,
-<a name="l00625"></a>00625         cpl_table       **  raw_flat_odd_column_stats,
-<a name="l00626"></a>00626         cpl_table       **  raw_flat_even_column_stats,
-<a name="l00627"></a>00627         cpl_table       **  raw_flat_odd_row_stats,
-<a name="l00628"></a>00628         cpl_table       **  raw_flat_even_row_stats,
-<a name="l00629"></a>00629         cpl_vector      **  selected) 
-<a name="l00630"></a>00630 {
-<a name="l00631"></a>00631     <span class="keywordtype">int</span>                     nima ;
-<a name="l00632"></a>00632     cpl_image           *   ima_cur ;
-<a name="l00633"></a>00633     cpl_image           *   big_ima ;
-<a name="l00634"></a>00634     cpl_image           *   big_badres ;
-<a name="l00635"></a>00635     cpl_vector          *   medians[HAWKI_NB_DETECTORS];
-<a name="l00636"></a>00636     cpl_vector          *   stdevs[HAWKI_NB_DETECTORS];
-<a name="l00637"></a>00637     cpl_vector          *   sub_medians ;
-<a name="l00638"></a>00638     cpl_imagelist       *   in_quad ;
-<a name="l00639"></a>00639     cpl_imagelist       **  results ;
-<a name="l00640"></a>00640     cpl_imagelist       *   res_quad[4] ;
-<a name="l00641"></a>00641     cpl_image           *   err_quad[4] ;
-<a name="l00642"></a>00642     cpl_image           *   badres_mask[4] ;
-<a name="l00643"></a>00643     cpl_image           *   flat_image ;
-<a name="l00644"></a>00644     cpl_image           *   dark ;
-<a name="l00645"></a>00645     cpl_propertylist    *   plist;
-<a name="l00646"></a>00646     <span class="keywordtype">double</span>                  gradient ;
-<a name="l00647"></a>00647     <span class="keywordtype">double</span>                  flat_dit;
-<a name="l00648"></a>00648     cpl_image           *   bpmflat;
-<a name="l00649"></a>00649     <span class="keywordtype">int</span>                     j, k ;
-<a name="l00650"></a>00650     <span class="keywordtype">int</span>                     idet;
-<a name="l00651"></a>00651 
-<a name="l00652"></a>00652     <span class="comment">/* Test entries */</span>
-<a name="l00653"></a>00653     <span class="keywordflow">if</span> (flatframes == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655     <span class="comment">/* Initialise */</span>
-<a name="l00656"></a>00656     nima = cpl_frameset_get_size(flatframes) ;
-<a name="l00657"></a>00657     <span class="keywordflow">if</span> (nima < 3) {
-<a name="l00658"></a>00658         cpl_msg_error(__func__, <span class="stringliteral">"Not enough frames (%d)"</span>, nima) ;
-<a name="l00659"></a>00659         <span class="keywordflow">return</span> NULL ;
-<a name="l00660"></a>00660     }
-<a name="l00661"></a>00661     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00662"></a>00662         hawki_cal_flat_outputs.norm[idet] = 1.0 ;
-<a name="l00663"></a>00663     
-<a name="l00664"></a>00664     <span class="comment">/* Compute statistics */</span>
-<a name="l00665"></a>00665     cpl_msg_info(__func__, <span class="stringliteral">"Compute statistics"</span>) ;
-<a name="l00666"></a>00666     cpl_msg_indent_more() ;
-<a name="l00667"></a>00667     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS chips */</span>
-<a name="l00668"></a>00668     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00669"></a>00669     {
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671         <span class="comment">/* Compute some stats on input images */</span>
-<a name="l00672"></a>00672         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;
-<a name="l00673"></a>00673         cpl_msg_info(__func__, <span class="stringliteral">"image      min        max        med     rms"</span>) ;
-<a name="l00674"></a>00674         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</span>) ;
-<a name="l00675"></a>00675         medians[idet] = cpl_vector_new(nima);
-<a name="l00676"></a>00676         stdevs[idet] = cpl_vector_new(nima);
-<a name="l00677"></a>00677         <span class="keywordflow">for</span> (j=0 ; j<nima ; j++)
-<a name="l00678"></a>00678         {
-<a name="l00679"></a>00679             <span class="comment">/* Load the image */</span>
-<a name="l00680"></a>00680             ima_cur = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(flatframes, j, idet+1, CPL_TYPE_FLOAT) ;
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682             <span class="comment">/* Compute the stats */</span>
-<a name="l00683"></a>00683             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00684"></a>00684                 (raw_flat_stats,
-<a name="l00685"></a>00685                  ima_cur,
-<a name="l00686"></a>00686                  hawki_cal_flat_config.llx,
-<a name="l00687"></a>00687                  hawki_cal_flat_config.lly,
-<a name="l00688"></a>00688                  hawki_cal_flat_config.urx,
-<a name="l00689"></a>00689                  hawki_cal_flat_config.ury,
-<a name="l00690"></a>00690                  idet,
-<a name="l00691"></a>00691                  j) !=0 )
-<a name="l00692"></a>00692             {
-<a name="l00693"></a>00693                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute stats on image %d"</span>,j+1);
-<a name="l00694"></a>00694                 cpl_msg_indent_less() ;
-<a name="l00695"></a>00695                 cpl_image_delete(ima_cur);
-<a name="l00696"></a>00696                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;
-<a name="l00697"></a>00697                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;
-<a name="l00698"></a>00698                 <span class="keywordflow">return</span> NULL ;
-<a name="l00699"></a>00699             }
-<a name="l00700"></a>00700             
-<a name="l00701"></a>00701             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l00702"></a>00702             {
-<a name="l00703"></a>00703                 <span class="keywordflow">if</span>(hawki_image_stats_odd_even_column_row_fill_from_image
-<a name="l00704"></a>00704                         (raw_flat_odd_column_stats,
-<a name="l00705"></a>00705                          raw_flat_even_column_stats,
-<a name="l00706"></a>00706                          raw_flat_odd_row_stats,
-<a name="l00707"></a>00707                          raw_flat_even_row_stats,
-<a name="l00708"></a>00708                          ima_cur,
-<a name="l00709"></a>00709                          idet,
-<a name="l00710"></a>00710                          j) !=0 )
-<a name="l00711"></a>00711                 {
-<a name="l00712"></a>00712                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute extra stats"</span>);
-<a name="l00713"></a>00713                     cpl_msg_indent_less() ;
-<a name="l00714"></a>00714                     cpl_image_delete(ima_cur);
-<a name="l00715"></a>00715                     <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;
-<a name="l00716"></a>00716                     <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;
-<a name="l00717"></a>00717                     <span class="keywordflow">return</span> NULL ;
-<a name="l00718"></a>00718                 }
-<a name="l00719"></a>00719             }
-<a name="l00720"></a>00720             cpl_vector_set(medians[idet], j, cpl_table_get_double
-<a name="l00721"></a>00721                            (raw_flat_stats[idet],HAWKI_COL_STAT_MED,j,NULL )) ;
-<a name="l00722"></a>00722             cpl_vector_set(stdevs[idet], j, cpl_table_get_double
-<a name="l00723"></a>00723                            (raw_flat_stats[idet],HAWKI_COL_STAT_RMS,j,NULL )) ;
-<a name="l00724"></a>00724             cpl_msg_info(__func__, <span class="stringliteral">"%02d   %10.2f %10.2f %10.2f %10.2f"</span>,
-<a name="l00725"></a>00725                     j+1,
-<a name="l00726"></a>00726                     cpl_table_get_double(raw_flat_stats[idet],
-<a name="l00727"></a>00727                                          HAWKI_COL_STAT_MIN,j,NULL ),
-<a name="l00728"></a>00728                     cpl_table_get_double(raw_flat_stats[idet],
-<a name="l00729"></a>00729                                          HAWKI_COL_STAT_MAX,j,NULL ),
-<a name="l00730"></a>00730                     cpl_table_get_double(raw_flat_stats[idet],
-<a name="l00731"></a>00731                                          HAWKI_COL_STAT_MED,j,NULL ),
-<a name="l00732"></a>00732                     cpl_table_get_double(raw_flat_stats[idet],
-<a name="l00733"></a>00733                                          HAWKI_COL_STAT_RMS,j,NULL ));
-<a name="l00734"></a>00734             <span class="keywordflow">if</span> (cpl_table_get_double
-<a name="l00735"></a>00735                     (raw_flat_stats[idet],HAWKI_COL_STAT_MED,j,NULL ) < 1e-6) 
-<a name="l00736"></a>00736             {
-<a name="l00737"></a>00737                 cpl_msg_error(__func__, <span class="stringliteral">"image %d has negative flux: aborting"</span>, 
-<a name="l00738"></a>00738                         j+1) ;
-<a name="l00739"></a>00739                 cpl_msg_indent_less() ;
-<a name="l00740"></a>00740                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;
-<a name="l00741"></a>00741                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;
-<a name="l00742"></a>00742                 <span class="keywordflow">return</span> NULL ;
-<a name="l00743"></a>00743             }
-<a name="l00744"></a>00744             cpl_image_delete(ima_cur);
-<a name="l00745"></a>00745         }
-<a name="l00746"></a>00746         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</span>) ;
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748         <span class="comment">/* Compute min max stdev and mean of the medians */</span>
-<a name="l00749"></a>00749         hawki_cal_flat_outputs.med_min[idet]   = 
-<a name="l00750"></a>00750             cpl_vector_get_min(medians[idet]);
-<a name="l00751"></a>00751         hawki_cal_flat_outputs.med_max[idet]   = 
-<a name="l00752"></a>00752             cpl_vector_get_max(medians[idet]);
-<a name="l00753"></a>00753         hawki_cal_flat_outputs.med_avg[idet]   = 
-<a name="l00754"></a>00754             cpl_vector_get_mean(medians[idet]);
-<a name="l00755"></a>00755         hawki_cal_flat_outputs.med_med[idet]   =
-<a name="l00756"></a>00756             cpl_vector_get_median_const(medians[idet]);
-<a name="l00757"></a>00757         hawki_cal_flat_outputs.med_stdev[idet] = 
-<a name="l00758"></a>00758             cpl_vector_get_stdev(medians[idet]);
-<a name="l00759"></a>00759         
-<a name="l00760"></a>00760         <span class="comment">/* See if flux gradient is large enough for a correct fit */</span>
-<a name="l00761"></a>00761         gradient=fabs(hawki_cal_flat_outputs.med_max[idet]/ 
-<a name="l00762"></a>00762                 hawki_cal_flat_outputs.med_min[idet]) ;
-<a name="l00763"></a>00763         <span class="keywordflow">if</span> (gradient < 4.0) {
-<a name="l00764"></a>00764             <span class="comment">/* cpl_msg_warning(__func__, "Low flux gradient: %g", gradient) ;*/</span>
-<a name="l00765"></a>00765         }
-<a name="l00766"></a>00766     }
-<a name="l00767"></a>00767     cpl_msg_indent_less() ;
-<a name="l00768"></a>00768     
-<a name="l00769"></a>00769     <span class="comment">/* Allocate for results */</span>
-<a name="l00770"></a>00770     results = cpl_malloc(4 * <span class="keyword">sizeof</span>(cpl_imagelist*)) ;
-<a name="l00771"></a>00771     results[0] = cpl_imagelist_new() ;
-<a name="l00772"></a>00772     results[1] = cpl_imagelist_new() ;
-<a name="l00773"></a>00773     results[2] = cpl_imagelist_new() ;
-<a name="l00774"></a>00774     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass)  results[3] = cpl_imagelist_new() ; 
-<a name="l00775"></a>00775     <span class="keywordflow">else</span>                                    results[3] = NULL ;
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777     cpl_msg_info(__func__, <span class="stringliteral">"Compute the flat"</span>) ;
-<a name="l00778"></a>00778     cpl_msg_indent_more() ;
-<a name="l00779"></a>00779     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS chips */</span>
-<a name="l00780"></a>00780     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l00781"></a>00781         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;
-<a name="l00782"></a>00782         cpl_msg_indent_more() ;
-<a name="l00783"></a>00783        
-<a name="l00784"></a>00784         <span class="comment">/* Frames selection */</span>
-<a name="l00785"></a>00785         cpl_msg_info(__func__, <span class="stringliteral">"Apply the frames selection"</span>);
-<a name="l00786"></a>00786         <span class="keywordflow">if</span> ((hawki_cal_flat_select(medians[idet], 
-<a name="l00787"></a>00787                                    stdevs[idet],
-<a name="l00788"></a>00788                                    hawki_cal_flat_config.select_auto,
-<a name="l00789"></a>00789                                    hawki_cal_flat_config.select_auto_max_bins,
-<a name="l00790"></a>00790                                    hawki_cal_flat_config.select_min_level[idet],
-<a name="l00791"></a>00791                                    hawki_cal_flat_config.select_max_level[idet],
-<a name="l00792"></a>00792                                    hawki_cal_flat_config.select_max_rms[idet],
-<a name="l00793"></a>00793                                    hawki_cal_flat_config.select_min_nframes,
-<a name="l00794"></a>00794                                    selected[idet])) == -1)
-<a name="l00795"></a>00795         {
-<a name="l00796"></a>00796             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply the frames selection"</span>) ;
-<a name="l00797"></a>00797             cpl_imagelist_delete(results[0]) ;
-<a name="l00798"></a>00798             cpl_imagelist_delete(results[1]) ;
-<a name="l00799"></a>00799             cpl_imagelist_delete(results[2]) ;
-<a name="l00800"></a>00800             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00801"></a>00801                 cpl_imagelist_delete(results[3]) ;
-<a name="l00802"></a>00802             cpl_free(results) ;
-<a name="l00803"></a>00803             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00804"></a>00804                 cpl_vector_delete(medians[k]) ;
-<a name="l00805"></a>00805             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00806"></a>00806                 cpl_vector_delete(stdevs[k]) ;
-<a name="l00807"></a>00807             <span class="keywordflow">return</span> NULL ;
-<a name="l00808"></a>00808         }
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810         <span class="comment">/* Apply the medians subselection */</span>
-<a name="l00811"></a>00811         sub_medians = hawki_cal_flat_extract_vector
-<a name="l00812"></a>00812             (medians[idet], selected[idet]) ;
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814         <span class="comment">/* Loop on the 4 quadrants */</span>
-<a name="l00815"></a>00815         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) {
-<a name="l00816"></a>00816             <span class="comment">/* Load input image chips */</span>
-<a name="l00817"></a>00817             <span class="keywordflow">if</span> ((in_quad = <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(flatframes, idet+1, j+1, 
-<a name="l00818"></a>00818                             CPL_TYPE_FLOAT))==NULL) {
-<a name="l00819"></a>00819                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the raw quadrants"</span>) ;
-<a name="l00820"></a>00820                 cpl_imagelist_delete(results[0]) ;
-<a name="l00821"></a>00821                 cpl_imagelist_delete(results[1]) ;
-<a name="l00822"></a>00822                 cpl_imagelist_delete(results[2]) ;
-<a name="l00823"></a>00823                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00824"></a>00824                     cpl_imagelist_delete(results[3]) ;
-<a name="l00825"></a>00825                 cpl_free(results) ;
-<a name="l00826"></a>00826                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00827"></a>00827                     cpl_vector_delete(medians[k]) ;
-<a name="l00828"></a>00828                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00829"></a>00829                     cpl_vector_delete(stdevs[k]) ;
-<a name="l00830"></a>00830                 cpl_vector_delete(sub_medians) ;
-<a name="l00831"></a>00831                 <span class="keywordflow">return</span> NULL ;
-<a name="l00832"></a>00832             }
-<a name="l00833"></a>00833        
-<a name="l00834"></a>00834             <span class="comment">/* Apply subselection of the frames */</span>
-<a name="l00835"></a>00835             cpl_imagelist_erase(in_quad, selected[idet]);
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837             <span class="comment">/* Apply dark correction to all planes if requested */</span>
-<a name="l00838"></a>00838             <span class="keywordflow">if</span> (dark_file) {
-<a name="l00839"></a>00839                 <span class="keywordflow">if</span> (j==0) cpl_msg_info(__func__, <span class="stringliteral">"Subtracting dark"</span>) ;
-<a name="l00840"></a>00840                 <span class="comment">/* Load dark */</span>
-<a name="l00841"></a>00841                 <span class="keywordflow">if</span> ((dark = <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(dark_file,
-<a name="l00842"></a>00842                                 idet+1, j+1, CPL_TYPE_FLOAT)) == NULL) {
-<a name="l00843"></a>00843                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the dark quadrants"</span>) ;
-<a name="l00844"></a>00844                     cpl_imagelist_delete(in_quad) ;
-<a name="l00845"></a>00845                     cpl_imagelist_delete(results[0]) ;
-<a name="l00846"></a>00846                     cpl_imagelist_delete(results[1]) ;
-<a name="l00847"></a>00847                     cpl_imagelist_delete(results[2]) ;
-<a name="l00848"></a>00848                     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00849"></a>00849                         cpl_imagelist_delete(results[3]) ;
-<a name="l00850"></a>00850                     cpl_free(results) ;
-<a name="l00851"></a>00851                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00852"></a>00852                         cpl_vector_delete(medians[k]) ;
-<a name="l00853"></a>00853                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00854"></a>00854                         cpl_vector_delete(stdevs[k]) ;
-<a name="l00855"></a>00855                     cpl_vector_delete(sub_medians) ;
-<a name="l00856"></a>00856                     <span class="keywordflow">return</span> NULL ;
-<a name="l00857"></a>00857                 }
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859                 <span class="comment">/* Multiply by the dit */</span>
-<a name="l00860"></a>00860                 <span class="keywordflow">if</span> ((plist=cpl_propertylist_load
-<a name="l00861"></a>00861                         (cpl_frame_get_filename
-<a name="l00862"></a>00862                          (cpl_frameset_get_first_const(flatframes)), 0)) == NULL) 
-<a name="l00863"></a>00863                 {
-<a name="l00864"></a>00864                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);
-<a name="l00865"></a>00865                     cpl_imagelist_delete(in_quad) ;
-<a name="l00866"></a>00866                     cpl_imagelist_delete(results[0]) ;
-<a name="l00867"></a>00867                     cpl_imagelist_delete(results[1]) ;
-<a name="l00868"></a>00868                     cpl_imagelist_delete(results[2]) ;
-<a name="l00869"></a>00869                     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00870"></a>00870                         cpl_imagelist_delete(results[3]) ;
-<a name="l00871"></a>00871                     cpl_free(results) ;
-<a name="l00872"></a>00872                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00873"></a>00873                         cpl_vector_delete(medians[k]) ;
-<a name="l00874"></a>00874                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00875"></a>00875                         cpl_vector_delete(stdevs[k]) ;
-<a name="l00876"></a>00876                     cpl_vector_delete(sub_medians) ;
-<a name="l00877"></a>00877                     cpl_image_delete(dark);
-<a name="l00878"></a>00878                     <span class="keywordflow">return</span> NULL ;
-<a name="l00879"></a>00879                 }
-<a name="l00880"></a>00880                 flat_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);
-<a name="l00881"></a>00881                 cpl_image_multiply_scalar(dark, flat_dit);
-<a name="l00882"></a>00882                 cpl_propertylist_delete(plist);
-<a name="l00883"></a>00883 
-<a name="l00884"></a>00884                 <span class="comment">/* Dark correction */</span>
-<a name="l00885"></a>00885                 cpl_imagelist_subtract_image(in_quad, dark) ;
-<a name="l00886"></a>00886                 cpl_image_delete(dark) ;
-<a name="l00887"></a>00887                 <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00888"></a>00888                     cpl_msg_warning(__func__,<span class="stringliteral">"Cannot subtract the dark frame"</span>);
-<a name="l00889"></a>00889                     cpl_error_reset() ;
-<a name="l00890"></a>00890                 }
-<a name="l00891"></a>00891             }
-<a name="l00892"></a>00892         
-<a name="l00893"></a>00893             <span class="comment">/* Fit slopes */</span>
-<a name="l00894"></a>00894             err_quad[j] = cpl_image_duplicate(cpl_imagelist_get(in_quad, 0)) ;
-<a name="l00895"></a>00895             res_quad[j] = cpl_fit_imagelist_polynomial(sub_medians, in_quad, 
-<a name="l00896"></a>00896                     0, 1, CPL_FALSE, CPL_TYPE_FLOAT, err_quad[j]) ;
-<a name="l00897"></a>00897             <span class="keywordflow">if</span> (res_quad[j] == NULL) {
-<a name="l00898"></a>00898                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot create twilight flat-field"</span>) ;
-<a name="l00899"></a>00899                 cpl_imagelist_delete(results[0]) ;
-<a name="l00900"></a>00900                 cpl_imagelist_delete(results[1]) ;
-<a name="l00901"></a>00901                 cpl_imagelist_delete(results[2]) ;
-<a name="l00902"></a>00902                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00903"></a>00903                     cpl_imagelist_delete(results[3]) ;
-<a name="l00904"></a>00904                 cpl_free(results) ;
-<a name="l00905"></a>00905                 cpl_imagelist_delete(in_quad) ;
-<a name="l00906"></a>00906                 <span class="keywordflow">for</span> (k=0 ; k<j ; k++) cpl_imagelist_delete(res_quad[k]) ;
-<a name="l00907"></a>00907                 <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(err_quad[k]) ;
-<a name="l00908"></a>00908                 <span class="keywordflow">for</span> (k=0 ; k<j ; k++) 
-<a name="l00909"></a>00909                     <span class="keywordflow">if</span> (badres_mask[k]) cpl_image_delete(badres_mask[k]) ;
-<a name="l00910"></a>00910                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00911"></a>00911                     cpl_vector_delete(medians[k]) ;
-<a name="l00912"></a>00912                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00913"></a>00913                     cpl_vector_delete(stdevs[k]) ;
-<a name="l00914"></a>00914                 cpl_vector_delete(sub_medians) ;
-<a name="l00915"></a>00915                 <span class="keywordflow">return</span> NULL ;
-<a name="l00916"></a>00916             }
-<a name="l00917"></a>00917 
-<a name="l00918"></a>00918             <span class="comment">/* Handle the pixels with a high error */</span>
-<a name="l00919"></a>00919             badres_mask[j] = NULL ;
-<a name="l00920"></a>00920             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) {
-<a name="l00921"></a>00921                 <span class="keywordflow">if</span> (j==0) cpl_msg_info(__func__, 
-<a name="l00922"></a>00922                         <span class="stringliteral">"Second pass to clean the outliers"</span>) ;
-<a name="l00923"></a>00923                 <span class="keywordflow">if</span> (hawki_cal_flat_clean_outliers(err_quad[j], res_quad[j],
-<a name="l00924"></a>00924                             in_quad, sub_medians, &(badres_mask[j])) == -1) {
-<a name="l00925"></a>00925                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot clean the outliers"</span>) ;
-<a name="l00926"></a>00926                     cpl_imagelist_delete(results[0]) ;
-<a name="l00927"></a>00927                     cpl_imagelist_delete(results[1]) ;
-<a name="l00928"></a>00928                     cpl_imagelist_delete(results[2]) ;
-<a name="l00929"></a>00929                     cpl_imagelist_delete(results[3]) ;
-<a name="l00930"></a>00930                     cpl_free(results) ;
-<a name="l00931"></a>00931                     cpl_imagelist_delete(in_quad) ;
-<a name="l00932"></a>00932                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_imagelist_delete(res_quad[k]) ;
-<a name="l00933"></a>00933                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(err_quad[k]) ;
-<a name="l00934"></a>00934                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(badres_mask[k]) ;
-<a name="l00935"></a>00935                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00936"></a>00936                         cpl_vector_delete(medians[k]) ;
-<a name="l00937"></a>00937                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00938"></a>00938                         cpl_vector_delete(stdevs[k]) ;
-<a name="l00939"></a>00939                     cpl_vector_delete(sub_medians) ;
-<a name="l00940"></a>00940                     cpl_msg_indent_less() ;
-<a name="l00941"></a>00941                     <span class="keywordflow">return</span> NULL ;
-<a name="l00942"></a>00942                 }
-<a name="l00943"></a>00943             }
-<a name="l00944"></a>00944             cpl_imagelist_delete(in_quad) ;
-<a name="l00945"></a>00945         }
-<a name="l00946"></a>00946         cpl_vector_delete(sub_medians) ;
-<a name="l00947"></a>00947             
-<a name="l00948"></a>00948         <span class="comment">/* Rebuild the quadrants and put in results */</span>
-<a name="l00949"></a>00949         <span class="comment">/* Rebuild RESULTS */</span>
-<a name="l00950"></a>00950         big_ima = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(
-<a name="l00951"></a>00951                 cpl_imagelist_get(res_quad[0],1), 
-<a name="l00952"></a>00952                 cpl_imagelist_get(res_quad[1],1), 
-<a name="l00953"></a>00953                 cpl_imagelist_get(res_quad[2],1), 
-<a name="l00954"></a>00954                 cpl_imagelist_get(res_quad[3],1)) ;
-<a name="l00955"></a>00955         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_imagelist_delete(res_quad[j]) ;
-<a name="l00956"></a>00956         cpl_imagelist_set(results[0], big_ima, idet) ;
-<a name="l00957"></a>00957         <span class="keywordflow">if</span> (big_ima == NULL) {
-<a name="l00958"></a>00958             cpl_msg_error(__func__, <span class="stringliteral">"Cannot rebuild the image"</span>) ;
-<a name="l00959"></a>00959             cpl_imagelist_delete(results[0]) ;
-<a name="l00960"></a>00960             cpl_imagelist_delete(results[1]) ;
-<a name="l00961"></a>00961             cpl_imagelist_delete(results[2]) ;
-<a name="l00962"></a>00962             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00963"></a>00963                 cpl_imagelist_delete(results[3]) ;
-<a name="l00964"></a>00964             cpl_free(results) ;
-<a name="l00965"></a>00965             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(err_quad[j]) ;
-<a name="l00966"></a>00966             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) 
-<a name="l00967"></a>00967                 <span class="keywordflow">if</span> (badres_mask[j]) cpl_image_delete(badres_mask[j]) ;
-<a name="l00968"></a>00968             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00969"></a>00969                 cpl_vector_delete(medians[k]) ;
-<a name="l00970"></a>00970             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00971"></a>00971                 cpl_vector_delete(stdevs[k]) ;
-<a name="l00972"></a>00972             <span class="keywordflow">return</span> NULL ;
-<a name="l00973"></a>00973         }
-<a name="l00974"></a>00974 
-<a name="l00975"></a>00975         <span class="comment">/* Rebuild ERROR */</span>
-<a name="l00976"></a>00976         big_ima = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(err_quad[0], err_quad[1], 
-<a name="l00977"></a>00977                 err_quad[2], err_quad[3]) ;
-<a name="l00978"></a>00978         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(err_quad[j]) ;
-<a name="l00979"></a>00979         <span class="keywordflow">if</span> (big_ima == NULL) {
-<a name="l00980"></a>00980             cpl_msg_error(__func__, <span class="stringliteral">"Cannot rebuild the image"</span>) ;
-<a name="l00981"></a>00981             cpl_imagelist_delete(results[0]) ;
-<a name="l00982"></a>00982             cpl_imagelist_delete(results[1]) ;
-<a name="l00983"></a>00983             cpl_imagelist_delete(results[2]) ;
-<a name="l00984"></a>00984             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l00985"></a>00985                 cpl_imagelist_delete(results[3]) ;
-<a name="l00986"></a>00986             cpl_free(results) ;
-<a name="l00987"></a>00987             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) 
-<a name="l00988"></a>00988                 <span class="keywordflow">if</span> (badres_mask[j]) cpl_image_delete(badres_mask[j]) ;
-<a name="l00989"></a>00989             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00990"></a>00990                 cpl_vector_delete(medians[k]) ;
-<a name="l00991"></a>00991             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l00992"></a>00992                 cpl_vector_delete(stdevs[k]) ;
-<a name="l00993"></a>00993             <span class="keywordflow">return</span> NULL ;
-<a name="l00994"></a>00994         }
-<a name="l00995"></a>00995         cpl_imagelist_set(results[1], big_ima, idet) ;
-<a name="l00996"></a>00996        
-<a name="l00997"></a>00997         <span class="comment">/* Rebuild BADRES_MASK */</span>
-<a name="l00998"></a>00998         big_badres = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(badres_mask[0], badres_mask[1], 
-<a name="l00999"></a>00999                 badres_mask[2], badres_mask[3]) ;
-<a name="l01000"></a>01000         <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) {
-<a name="l01001"></a>01001             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(badres_mask[j]) ;
-<a name="l01002"></a>01002             cpl_imagelist_set(results[3], big_badres, idet) ;
-<a name="l01003"></a>01003         }
-<a name="l01004"></a>01004 
-<a name="l01005"></a>01005         <span class="keywordflow">if</span> (hawki_cal_flat_config.normalise) {
-<a name="l01006"></a>01006             <span class="comment">/* Normalize gain */</span>
-<a name="l01007"></a>01007             cpl_msg_info(__func__, <span class="stringliteral">"Normalise the flat"</span>) ;
-<a name="l01008"></a>01008             flat_image = cpl_imagelist_get(results[0], idet) ;
-<a name="l01009"></a>01009             hawki_cal_flat_outputs.norm[idet] = 
-<a name="l01010"></a>01010                 cpl_image_get_median(flat_image) ;
-<a name="l01011"></a>01011             cpl_image_divide_scalar
-<a name="l01012"></a>01012                 (flat_image, hawki_cal_flat_outputs.norm[idet]);
-<a name="l01013"></a>01013             <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01014"></a>01014                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot normalise"</span>) ;
-<a name="l01015"></a>01015                 cpl_imagelist_delete(results[0]) ;
-<a name="l01016"></a>01016                 cpl_imagelist_delete(results[1]) ;
-<a name="l01017"></a>01017                 cpl_imagelist_delete(results[2]) ;
-<a name="l01018"></a>01018                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) 
-<a name="l01019"></a>01019                     cpl_imagelist_delete(results[3]) ;
-<a name="l01020"></a>01020                 cpl_free(results) ;
-<a name="l01021"></a>01021                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l01022"></a>01022                     cpl_vector_delete(medians[k]) ;
-<a name="l01023"></a>01023                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) 
-<a name="l01024"></a>01024                     cpl_vector_delete(stdevs[k]) ;
-<a name="l01025"></a>01025                 <span class="keywordflow">return</span> NULL ;
-<a name="l01026"></a>01026             }
-<a name="l01027"></a>01027         }
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029         <span class="comment">/* BPM from the flat */</span>
-<a name="l01030"></a>01030         cpl_msg_info(__func__, <span class="stringliteral">"Compute the BPM from the flat"</span>) ;
-<a name="l01031"></a>01031         bpmflat=<a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a>(cpl_imagelist_get(results[0],idet),
-<a name="l01032"></a>01032                 hawki_cal_flat_config.sigma_bpm,
-<a name="l01033"></a>01033                 hawki_cal_flat_config.lowval_bpm, 
-<a name="l01034"></a>01034                 hawki_cal_flat_config.highval_bpm);
-<a name="l01035"></a>01035         
-<a name="l01036"></a>01036         cpl_imagelist_set(results[2], bpmflat, idet) ;
-<a name="l01037"></a>01037         hawki_cal_flat_outputs.nb_badpix[idet]=
-<a name="l01038"></a>01038             (int)cpl_image_get_flux(bpmflat);
-<a name="l01039"></a>01039 
-<a name="l01040"></a>01040         cpl_msg_indent_less() ;
-<a name="l01041"></a>01041     }
-<a name="l01042"></a>01042     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) cpl_vector_delete(medians[k]) ;
-<a name="l01043"></a>01043     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) cpl_vector_delete(stdevs[k]) ;
-<a name="l01044"></a>01044     cpl_msg_indent_less() ;
-<a name="l01045"></a>01045 
-<a name="l01046"></a>01046     <span class="keywordflow">return</span> results ;
-<a name="l01047"></a>01047 }
-<a name="l01048"></a>01048 
-<a name="l01049"></a>01049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01059"></a>01059 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01060"></a>01060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_clean_outliers(
-<a name="l01061"></a>01061         cpl_image           *   error,
-<a name="l01062"></a>01062         cpl_imagelist       *   fit_res,
-<a name="l01063"></a>01063         cpl_imagelist       *   raw,
-<a name="l01064"></a>01064         cpl_vector          *   medians,
-<a name="l01065"></a>01065         cpl_image           **  recomp_mask)
-<a name="l01066"></a>01066 {
-<a name="l01067"></a>01067     cpl_mask        *   recompute ;
-<a name="l01068"></a>01068     cpl_binary      *   precompute ;
-<a name="l01069"></a>01069     <span class="keywordtype">double</span>              med, stdev, threshold1, threshold2 ;
-<a name="l01070"></a>01070     <span class="keywordtype">int</span>                 nx, ny, pos, nbad, nima, out, ind, pix ;
-<a name="l01071"></a>01071     cpl_image       *   cur_ima ;
-<a name="l01072"></a>01072     <span class="keywordtype">float</span>           *   pimaf ;
-<a name="l01073"></a>01073     <span class="keywordtype">double</span>              val, fit_val, a, b, max ;
-<a name="l01074"></a>01074     cpl_vector      *   z_pix ;
-<a name="l01075"></a>01075     <span class="keywordtype">double</span>          *   pz_pix ;
-<a name="l01076"></a>01076     cpl_image       *   onepix ;
-<a name="l01077"></a>01077     cpl_vector      *   med_purged ;
-<a name="l01078"></a>01078     cpl_imagelist   *   raw_purged ;
-<a name="l01079"></a>01079     cpl_imagelist   *   fit_one ;
-<a name="l01080"></a>01080     cpl_image       *   err_one ;
-<a name="l01081"></a>01081     <span class="keywordtype">int</span>                 i, j, k ;
-<a name="l01082"></a>01082 
-<a name="l01083"></a>01083     <span class="comment">/* Check entries */</span>
-<a name="l01084"></a>01084     <span class="keywordflow">if</span> (error == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01085"></a>01085     <span class="keywordflow">if</span> (fit_res == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01086"></a>01086     <span class="keywordflow">if</span> (raw == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01087"></a>01087 
-<a name="l01088"></a>01088     <span class="comment">/* Initialise */</span>
-<a name="l01089"></a>01089     <span class="keywordflow">if</span> (recomp_mask) *recomp_mask = NULL ;
-<a name="l01090"></a>01090 
-<a name="l01091"></a>01091     <span class="comment">/* Identify the places to recompute */</span>
-<a name="l01092"></a>01092     med = cpl_image_get_median_dev(error, &stdev) ;
-<a name="l01093"></a>01093     threshold1 = med - hawki_cal_flat_config.sigma_badres * stdev ;
-<a name="l01094"></a>01094     threshold2 = med + hawki_cal_flat_config.sigma_badres * stdev ;
-<a name="l01095"></a>01095     recompute = cpl_mask_threshold_image_create(error,threshold1,threshold2) ;
-<a name="l01096"></a>01096     cpl_mask_not(recompute) ;
-<a name="l01097"></a>01097 
-<a name="l01098"></a>01098     <span class="keywordflow">if</span> ((nbad=cpl_mask_count(recompute)) == 0) {
-<a name="l01099"></a>01099         <span class="keywordflow">if</span> (recomp_mask)    
-<a name="l01100"></a>01100             *recomp_mask = cpl_image_new_from_mask(recompute) ;
-<a name="l01101"></a>01101         cpl_mask_delete(recompute) ;
-<a name="l01102"></a>01102         <span class="keywordflow">return</span> 0 ;
-<a name="l01103"></a>01103     }
-<a name="l01104"></a>01104     nx = cpl_image_get_size_x(error) ;
-<a name="l01105"></a>01105     ny = cpl_image_get_size_y(error) ;
-<a name="l01106"></a>01106     nima = cpl_imagelist_get_size(raw) ;
-<a name="l01107"></a>01107 
-<a name="l01108"></a>01108     <span class="comment">/* Get access to the mask */</span>
-<a name="l01109"></a>01109     precompute = cpl_mask_get_data(recompute) ;
-<a name="l01110"></a>01110     <span class="keywordflow">for</span> (j=0 ; j<ny ; j++) {
-<a name="l01111"></a>01111         <span class="keywordflow">for</span> (i=0 ; i<nx ; i++) {
-<a name="l01112"></a>01112             pos = i + j*nx ;
-<a name="l01113"></a>01113             <span class="comment">/* The pixel has to be recomputed */</span>
-<a name="l01114"></a>01114             <span class="keywordflow">if</span> (precompute[pos] == CPL_BINARY_1) {
-<a name="l01115"></a>01115                 <span class="comment">/* Get the pix_val-fit in a vector */</span>
-<a name="l01116"></a>01116                 z_pix = cpl_vector_new(nima) ;
-<a name="l01117"></a>01117                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {
-<a name="l01118"></a>01118                     cur_ima = cpl_imagelist_get(fit_res, 0) ;
-<a name="l01119"></a>01119                     pimaf = cpl_image_get_data_float(cur_ima) ;
-<a name="l01120"></a>01120                     a = pimaf[pos] ;
-<a name="l01121"></a>01121                     cur_ima = cpl_imagelist_get(fit_res, 1) ;
-<a name="l01122"></a>01122                     pimaf = cpl_image_get_data_float(cur_ima) ;
-<a name="l01123"></a>01123                     b = pimaf[pos] ;
-<a name="l01124"></a>01124                     med = cpl_vector_get(medians, k) ;
-<a name="l01125"></a>01125                     fit_val = a + b * med ;
-<a name="l01126"></a>01126                     cur_ima = cpl_imagelist_get(raw, k) ;
-<a name="l01127"></a>01127                     pimaf = cpl_image_get_data_float(cur_ima) ;
-<a name="l01128"></a>01128                     cpl_vector_set(z_pix, k, (<span class="keywordtype">double</span>)(pimaf[pos]-fit_val)) ;
-<a name="l01129"></a>01129                 }
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131                 <span class="comment">/* Identify the outlier */</span>
-<a name="l01132"></a>01132                 out = -1 ;
-<a name="l01133"></a>01133                 max = -1.0 ;
-<a name="l01134"></a>01134                 pz_pix = cpl_vector_get_data(z_pix) ;
-<a name="l01135"></a>01135                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {
-<a name="l01136"></a>01136                     <span class="keywordflow">if</span> (fabs(pz_pix[k]) > max) {
-<a name="l01137"></a>01137                         max = fabs(pz_pix[k]) ;
-<a name="l01138"></a>01138                         out = k ;
-<a name="l01139"></a>01139                     }
-<a name="l01140"></a>01140                 }
-<a name="l01141"></a>01141                 cpl_vector_delete(z_pix) ;
-<a name="l01142"></a>01142 
-<a name="l01143"></a>01143                 <span class="comment">/* Create 1-pixel purged image list and the purged medians */</span>
-<a name="l01144"></a>01144                 med_purged = cpl_vector_new(nima-1) ;
-<a name="l01145"></a>01145                 raw_purged = cpl_imagelist_new() ;
-<a name="l01146"></a>01146                 ind = 0 ;
-<a name="l01147"></a>01147                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {
-<a name="l01148"></a>01148                     <span class="keywordflow">if</span> (k != out) {
-<a name="l01149"></a>01149                         <span class="comment">/* Fill raw_purged */</span>
-<a name="l01150"></a>01150                         cur_ima = cpl_imagelist_get(raw, k) ;
-<a name="l01151"></a>01151                         onepix=cpl_image_extract(cur_ima, i+1, j+1, i+1, j+1) ;
-<a name="l01152"></a>01152                         cpl_imagelist_set(raw_purged, onepix, ind) ;
-<a name="l01153"></a>01153                         <span class="comment">/* Fill med_purged */</span>
-<a name="l01154"></a>01154                         cpl_vector_set(med_purged, ind,
-<a name="l01155"></a>01155                                 cpl_vector_get(medians, k)) ;
-<a name="l01156"></a>01156                         ind ++;
-<a name="l01157"></a>01157                     }
-<a name="l01158"></a>01158                 }
-<a name="l01159"></a>01159 
-<a name="l01160"></a>01160                 <span class="comment">/* Perform the fit */</span>
-<a name="l01161"></a>01161                 err_one = cpl_image_duplicate(cpl_imagelist_get(raw_purged,0));
-<a name="l01162"></a>01162                 fit_one = cpl_fit_imagelist_polynomial(med_purged, raw_purged, 
-<a name="l01163"></a>01163                         0, 1, CPL_FALSE, CPL_TYPE_FLOAT, err_one) ;
-<a name="l01164"></a>01164                 <span class="keywordflow">if</span> (fit_one == NULL) {
-<a name="l01165"></a>01165                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit in second pass"</span>) ;
-<a name="l01166"></a>01166                     cpl_mask_delete(recompute) ;
-<a name="l01167"></a>01167                     cpl_vector_delete(med_purged) ;
-<a name="l01168"></a>01168                     cpl_imagelist_delete(raw_purged) ;
-<a name="l01169"></a>01169                     cpl_image_delete(err_one) ;
-<a name="l01170"></a>01170                     <span class="keywordflow">return</span> -1 ;
-<a name="l01171"></a>01171                 }
-<a name="l01172"></a>01172                 cpl_vector_delete(med_purged) ;
-<a name="l01173"></a>01173                 cpl_imagelist_delete(raw_purged) ;
-<a name="l01174"></a>01174 
-<a name="l01175"></a>01175                 <span class="comment">/* Write the result in the input */</span>
-<a name="l01176"></a>01176                 val = cpl_image_get(err_one, 1, 1, &pix) ;
-<a name="l01177"></a>01177                 cpl_image_set(error, i+1, j+1, val) ;
-<a name="l01178"></a>01178                 cpl_image_delete(err_one) ;
-<a name="l01179"></a>01179 
-<a name="l01180"></a>01180                 cur_ima = cpl_imagelist_get(fit_one, 0) ;
-<a name="l01181"></a>01181                 val = cpl_image_get(cur_ima, 1, 1, &pix) ;
-<a name="l01182"></a>01182                 cur_ima = cpl_imagelist_get(fit_res, 0) ;
-<a name="l01183"></a>01183                 cpl_image_set(cur_ima, i+1, j+1, val) ;
-<a name="l01184"></a>01184               
-<a name="l01185"></a>01185                 cur_ima = cpl_imagelist_get(fit_one, 1) ;
-<a name="l01186"></a>01186                 val = cpl_image_get(cur_ima, 1, 1, &pix) ;
-<a name="l01187"></a>01187                 cur_ima = cpl_imagelist_get(fit_res, 1) ;
-<a name="l01188"></a>01188                 cpl_image_set(cur_ima, i+1, j+1, val) ;
-<a name="l01189"></a>01189                 cpl_imagelist_delete(fit_one) ;
-<a name="l01190"></a>01190             }
-<a name="l01191"></a>01191         }
-<a name="l01192"></a>01192     }
-<a name="l01193"></a>01193     <span class="keywordflow">if</span> (recomp_mask)    
-<a name="l01194"></a>01194         *recomp_mask = cpl_image_new_from_mask(recompute) ;
-<a name="l01195"></a>01195     cpl_mask_delete(recompute) ;
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     <span class="comment">/* Return  */</span>
-<a name="l01198"></a>01198     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l01199"></a>01199     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l01200"></a>01200 }
-<a name="l01201"></a>01201 
-<a name="l01202"></a>01202 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01214"></a>01214 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01215"></a>01215 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_save
-<a name="l01216"></a>01216 (cpl_imagelist     ** flat,
-<a name="l01217"></a>01217  cpl_table         ** raw_flat_stats,
-<a name="l01218"></a>01218  cpl_table         ** raw_flat_odd_column_stats,
-<a name="l01219"></a>01219  cpl_table         ** raw_flat_even_column_stats,
-<a name="l01220"></a>01220  cpl_table         ** raw_flat_odd_row_stats,
-<a name="l01221"></a>01221  cpl_table         ** raw_flat_even_row_stats,
-<a name="l01222"></a>01222  cpl_vector        ** raw_selected,
-<a name="l01223"></a>01223  <span class="keywordtype">int</span>                  set_nb,
-<a name="l01224"></a>01224  <span class="keyword">const</span> cpl_frame   *  bpmdark,
-<a name="l01225"></a>01225  cpl_frameset      *  flat_frames,
-<a name="l01226"></a>01226  cpl_frameset      *  calib_frames,
-<a name="l01227"></a>01227  cpl_parameterlist *  parlist,
-<a name="l01228"></a>01228  cpl_frameset      *  set_tot)
-<a name="l01229"></a>01229 {
-<a name="l01230"></a>01230     cpl_propertylist    **  qclists ;
-<a name="l01231"></a>01231     cpl_imagelist       *   bpm ;
-<a name="l01232"></a>01232     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l01233"></a>01233     cpl_frameset        *   used_frames;
-<a name="l01234"></a>01234     <span class="keywordtype">char</span>                *   filename ;
-<a name="l01235"></a>01235     cpl_propertylist    *   inputlist ;
-<a name="l01236"></a>01236     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l01237"></a>01237     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_flat"</span> ;
-<a name="l01238"></a>01238     <span class="keywordtype">int</span>                     i ;
-<a name="l01239"></a>01239     <span class="keywordtype">int</span>                     iflat;
-<a name="l01240"></a>01240     <span class="keywordtype">int</span>                     nflat;
-<a name="l01241"></a>01241     <span class="keywordtype">int</span>                     nused;
-<a name="l01242"></a>01242     <span class="keywordtype">char</span>                    key_name[72];
-<a name="l01243"></a>01243 
-<a name="l01244"></a>01244     <span class="comment">/* Get the reference frame */</span>
-<a name="l01245"></a>01245     ref_frame = irplib_frameset_get_first_from_group(flat_frames, CPL_FRAME_GROUP_RAW) ;
-<a name="l01246"></a>01246 
-<a name="l01247"></a>01247     <span class="comment">/* Create the QC lists */</span>
-<a name="l01248"></a>01248     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01249"></a>01249     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l01250"></a>01250         qclists[i] = cpl_propertylist_new() ;
-<a name="l01251"></a>01251         
-<a name="l01252"></a>01252         <span class="comment">/* Add the raw flat selection keywords */</span>
-<a name="l01253"></a>01253         nflat = cpl_vector_get_size(raw_selected[i]);
-<a name="l01254"></a>01254         nused = 0;
-<a name="l01255"></a>01255         <span class="keywordflow">for</span>(iflat = 0; iflat < nflat; ++iflat)
-<a name="l01256"></a>01256         {
-<a name="l01257"></a>01257             snprintf(key_name, 72, <span class="stringliteral">"ESO QC RAW%02d USED"</span>, iflat + 1);
-<a name="l01258"></a>01258             cpl_propertylist_append_bool
-<a name="l01259"></a>01259                 (qclists[i], key_name, 
-<a name="l01260"></a>01260                 (cpl_vector_get(raw_selected[i], iflat) + 1) / 2);
-<a name="l01261"></a>01261             cpl_table_set_int
-<a name="l01262"></a>01262                 (raw_flat_stats[i],HAWKI_COL_STAT_USED, iflat,
-<a name="l01263"></a>01263                  cpl_vector_get(raw_selected[i], iflat));
-<a name="l01264"></a>01264             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l01265"></a>01265             {
-<a name="l01266"></a>01266                 cpl_table_set_int
-<a name="l01267"></a>01267                     (raw_flat_odd_column_stats[i],HAWKI_COL_STAT_USED, iflat,
-<a name="l01268"></a>01268                      cpl_vector_get(raw_selected[i], iflat));
-<a name="l01269"></a>01269                 cpl_table_set_int
-<a name="l01270"></a>01270                     (raw_flat_even_column_stats[i],HAWKI_COL_STAT_USED, iflat,
-<a name="l01271"></a>01271                      cpl_vector_get(raw_selected[i], iflat));
-<a name="l01272"></a>01272                 cpl_table_set_int
-<a name="l01273"></a>01273                     (raw_flat_odd_row_stats[i],HAWKI_COL_STAT_USED, iflat,
-<a name="l01274"></a>01274                      cpl_vector_get(raw_selected[i], iflat));
-<a name="l01275"></a>01275                 cpl_table_set_int
-<a name="l01276"></a>01276                     (raw_flat_even_row_stats[i],HAWKI_COL_STAT_USED, iflat,
-<a name="l01277"></a>01277                      cpl_vector_get(raw_selected[i], iflat));
-<a name="l01278"></a>01278             }
-<a name="l01279"></a>01279             <span class="keywordflow">if</span>(cpl_vector_get(raw_selected[i], iflat) == 1)
-<a name="l01280"></a>01280                 nused++;
-<a name="l01281"></a>01281         }
-<a name="l01282"></a>01282         
-<a name="l01283"></a>01283         <span class="comment">/* Add the master flat statistics keywords */</span>
-<a name="l01284"></a>01284         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC FLAT NBADPIX"</span>,
-<a name="l01285"></a>01285                                     hawki_cal_flat_outputs.nb_badpix[i]);
-<a name="l01286"></a>01286         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT NORM"</span>,
-<a name="l01287"></a>01287                                        hawki_cal_flat_outputs.norm[i]) ;
-<a name="l01288"></a>01288         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMEAN"</span>,
-<a name="l01289"></a>01289                                        hawki_cal_flat_outputs.med_avg[i]) ;
-<a name="l01290"></a>01290         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMED"</span>,
-<a name="l01291"></a>01291                                        hawki_cal_flat_outputs.med_med[i]) ;
-<a name="l01292"></a>01292         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDSTDEV"</span>,
-<a name="l01293"></a>01293                                        hawki_cal_flat_outputs.med_stdev[i]) ;
-<a name="l01294"></a>01294         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMIN"</span>,
-<a name="l01295"></a>01295                                        hawki_cal_flat_outputs.med_min[i]) ;
-<a name="l01296"></a>01296         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMAX"</span>,
-<a name="l01297"></a>01297                                        hawki_cal_flat_outputs.med_max[i]) ;
-<a name="l01298"></a>01298         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDRANG"</span>,
-<a name="l01299"></a>01299                                        hawki_cal_flat_outputs.med_max[i] -
-<a name="l01300"></a>01300                                        hawki_cal_flat_outputs.med_min[i]);
-<a name="l01301"></a>01301         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDNRANG"</span>,
-<a name="l01302"></a>01302                                        (hawki_cal_flat_outputs.med_max[i] -
-<a name="l01303"></a>01303                                         hawki_cal_flat_outputs.med_min[i]) /
-<a name="l01304"></a>01304                                         hawki_cal_flat_outputs.med_med[i]);
-<a name="l01305"></a>01305         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l01306"></a>01306                                     nused) ;
-<a name="l01307"></a>01307 
-<a name="l01308"></a>01308         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l01309"></a>01309         ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(
-<a name="l01310"></a>01310                 cpl_frame_get_filename(ref_frame), i+1);
-<a name="l01311"></a>01311         inputlist = cpl_propertylist_load_regexp(
-<a name="l01312"></a>01312                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l01313"></a>01313                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l01314"></a>01314         cpl_propertylist_append(qclists[i], inputlist) ;
-<a name="l01315"></a>01315 
-<a name="l01316"></a>01316         <span class="comment">/* Cleaning */</span>
-<a name="l01317"></a>01317         cpl_propertylist_delete(inputlist) ;
-<a name="l01318"></a>01318     }
-<a name="l01319"></a>01319     <span class="comment">/* Statistics of the raw images in the QC */</span>
-<a name="l01320"></a>01320     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_flat_stats, qclists);
-<a name="l01321"></a>01321 
-<a name="l01322"></a>01322     <span class="comment">/* Get the used frames */</span>
-<a name="l01323"></a>01323     used_frames = cpl_frameset_duplicate(flat_frames);
-<a name="l01324"></a>01324     <span class="keywordflow">for</span>(i = 0; i< cpl_frameset_get_size(calib_frames); ++i)
-<a name="l01325"></a>01325         cpl_frameset_insert(used_frames, 
-<a name="l01326"></a>01326                 cpl_frame_duplicate(cpl_frameset_get_frame(calib_frames, i)));
-<a name="l01327"></a>01327 
-<a name="l01328"></a>01328     <span class="comment">/* Write the flat image */</span>
-<a name="l01329"></a>01329     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_set%02d.fits"</span>, set_nb) ;
-<a name="l01330"></a>01330     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,
-<a name="l01331"></a>01331                          parlist,
-<a name="l01332"></a>01332                          used_frames,
-<a name="l01333"></a>01333                          flat[0],
-<a name="l01334"></a>01334                          recipe_name,
-<a name="l01335"></a>01335                          HAWKI_CALPRO_FLAT,
-<a name="l01336"></a>01336                          HAWKI_PROTYPE_FLAT, 
-<a name="l01337"></a>01337                          NULL,
-<a name="l01338"></a>01338                          (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l01339"></a>01339                          filename) ;
-<a name="l01340"></a>01340     cpl_free(filename) ;
-<a name="l01341"></a>01341     
-<a name="l01342"></a>01342     <span class="comment">/* Write the error map */</span>
-<a name="l01343"></a>01343     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_err_set%02d.fits"</span>, set_nb) ;
-<a name="l01344"></a>01344     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,
-<a name="l01345"></a>01345                          parlist,
-<a name="l01346"></a>01346                          used_frames,
-<a name="l01347"></a>01347                          flat[1],
-<a name="l01348"></a>01348                          recipe_name,
-<a name="l01349"></a>01349                          HAWKI_CALPRO_FLAT_ERRMAP,
-<a name="l01350"></a>01350                          HAWKI_PROTYPE_ERRMAP, 
-<a name="l01351"></a>01351                          NULL,
-<a name="l01352"></a>01352                          (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l01353"></a>01353                          filename) ;
-<a name="l01354"></a>01354     cpl_free(filename) ;
-<a name="l01355"></a>01355  
-<a name="l01356"></a>01356     <span class="comment">/* Write the Cold pixels map */</span>
-<a name="l01357"></a>01357     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_bpmflat_set%02d.fits"</span>, set_nb) ;
-<a name="l01358"></a>01358     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,
-<a name="l01359"></a>01359                          parlist,
-<a name="l01360"></a>01360                          used_frames,
-<a name="l01361"></a>01361                          flat[2],
-<a name="l01362"></a>01362                          recipe_name,
-<a name="l01363"></a>01363                          HAWKI_CALPRO_BPM_COLD,
-<a name="l01364"></a>01364                          HAWKI_PROTYPE_BPM,
-<a name="l01365"></a>01365                          NULL,
-<a name="l01366"></a>01366                          (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l01367"></a>01367                          filename) ;
-<a name="l01368"></a>01368     cpl_free(filename) ;
-<a name="l01369"></a>01369 
-<a name="l01370"></a>01370     <span class="keywordflow">if</span> (flat[3] != NULL) {
-<a name="l01371"></a>01371         <span class="comment">/* Write the recomputed map */</span>
-<a name="l01372"></a>01372         filename=cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_recomputed_set%02d.fits"</span>, set_nb) ;
-<a name="l01373"></a>01373         <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,
-<a name="l01374"></a>01374                              parlist,
-<a name="l01375"></a>01375                              used_frames,
-<a name="l01376"></a>01376                              flat[3],
-<a name="l01377"></a>01377                              recipe_name,
-<a name="l01378"></a>01378                              HAWKI_CALPRO_FLAT_RECOMPUTED,
-<a name="l01379"></a>01379                              HAWKI_PROTYPE_FLAT,
-<a name="l01380"></a>01380                              NULL,
-<a name="l01381"></a>01381                              (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l01382"></a>01382                              filename) ;
-<a name="l01383"></a>01383         cpl_free(filename) ;
-<a name="l01384"></a>01384     }
-<a name="l01385"></a>01385 
-<a name="l01386"></a>01386     <span class="comment">/* If the HOT pixel map is passed, merge with the COLD one */</span>
-<a name="l01387"></a>01387     <span class="keywordflow">if</span> (bpmdark != NULL) {
-<a name="l01388"></a>01388         <span class="keywordflow">if</span> ((bpm = hawki_cal_flat_merge_bpms(bpmdark, flat[2])) == NULL) {
-<a name="l01389"></a>01389             cpl_msg_error(__func__, <span class="stringliteral">"Cannot merge bad pixel maps"</span>) ;
-<a name="l01390"></a>01390         } <span class="keywordflow">else</span> {
-<a name="l01391"></a>01391             filename=cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_bpm_set%02d.fits"</span>, set_nb) ;
-<a name="l01392"></a>01392             <span class="comment">/* Get the used frames for statistics */</span>
-<a name="l01393"></a>01393             <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,
-<a name="l01394"></a>01394                                  parlist,
-<a name="l01395"></a>01395                                  used_frames,
-<a name="l01396"></a>01396                                  bpm,
-<a name="l01397"></a>01397                                  recipe_name,
-<a name="l01398"></a>01398                                  HAWKI_CALPRO_BPM,
-<a name="l01399"></a>01399                                  HAWKI_PROTYPE_BPM,
-<a name="l01400"></a>01400                                  NULL,
-<a name="l01401"></a>01401                                  (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l01402"></a>01402                                  filename) ;
-<a name="l01403"></a>01403             cpl_free(filename) ;
-<a name="l01404"></a>01404             cpl_imagelist_delete(bpm) ;
-<a name="l01405"></a>01405         }
-<a name="l01406"></a>01406     }
-<a name="l01407"></a>01407     cpl_frameset_delete(used_frames);
-<a name="l01408"></a>01408 
-<a name="l01409"></a>01409     <span class="comment">/* Get the used frames for statistics */</span>
-<a name="l01410"></a>01410     used_frames = cpl_frameset_duplicate(flat_frames);
-<a name="l01411"></a>01411     
-<a name="l01412"></a>01412     <span class="comment">/* Write the table with the statistics */</span>
-<a name="l01413"></a>01413     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_set%02d.fits"</span>, set_nb) ;
-<a name="l01414"></a>01414     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,
-<a name="l01415"></a>01415                       parlist,
-<a name="l01416"></a>01416                       used_frames,
-<a name="l01417"></a>01417                       (<span class="keyword">const</span> cpl_table **)raw_flat_stats,
-<a name="l01418"></a>01418                       recipe_name,
-<a name="l01419"></a>01419                       HAWKI_CALPRO_FLAT_STATS,
-<a name="l01420"></a>01420                       HAWKI_PROTYPE_FLAT_STATS,
-<a name="l01421"></a>01421                       NULL,
-<a name="l01422"></a>01422                       (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01423"></a>01423                       filename) ;
-<a name="l01424"></a>01424     cpl_free(filename) ;
-<a name="l01425"></a>01425     
-<a name="l01426"></a>01426     <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)
-<a name="l01427"></a>01427     {
-<a name="l01428"></a>01428         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_ec_set%02d.fits"</span>, set_nb);
-<a name="l01429"></a>01429         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,
-<a name="l01430"></a>01430                           parlist,
-<a name="l01431"></a>01431                           used_frames,
-<a name="l01432"></a>01432                           (<span class="keyword">const</span> cpl_table **)raw_flat_even_column_stats,
-<a name="l01433"></a>01433                           recipe_name,
-<a name="l01434"></a>01434                           HAWKI_CALPRO_FLAT_STATS_EVEN_COL,
-<a name="l01435"></a>01435                           HAWKI_PROTYPE_FLAT_STATS_EVEN_COL,
-<a name="l01436"></a>01436                           NULL,
-<a name="l01437"></a>01437                           (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01438"></a>01438                           filename) ;
-<a name="l01439"></a>01439         cpl_free(filename) ;
-<a name="l01440"></a>01440         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_oc_set%02d.fits"</span>, set_nb);
-<a name="l01441"></a>01441         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,
-<a name="l01442"></a>01442                           parlist,
-<a name="l01443"></a>01443                           used_frames,
-<a name="l01444"></a>01444                           (<span class="keyword">const</span> cpl_table **)raw_flat_odd_column_stats,
-<a name="l01445"></a>01445                           recipe_name,
-<a name="l01446"></a>01446                           HAWKI_CALPRO_FLAT_STATS_ODD_COL,
-<a name="l01447"></a>01447                           HAWKI_PROTYPE_FLAT_STATS_ODD_COL,
-<a name="l01448"></a>01448                           NULL,
-<a name="l01449"></a>01449                           (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01450"></a>01450                           filename) ;
-<a name="l01451"></a>01451         cpl_free(filename) ;
-<a name="l01452"></a>01452         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_er_set%02d.fits"</span>, set_nb);
-<a name="l01453"></a>01453         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,
-<a name="l01454"></a>01454                           parlist,
-<a name="l01455"></a>01455                           used_frames,
-<a name="l01456"></a>01456                           (<span class="keyword">const</span> cpl_table **)raw_flat_even_row_stats,
-<a name="l01457"></a>01457                           recipe_name,
-<a name="l01458"></a>01458                           HAWKI_CALPRO_FLAT_STATS_EVEN_ROW,
-<a name="l01459"></a>01459                           HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW,
-<a name="l01460"></a>01460                           NULL,
-<a name="l01461"></a>01461                           (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01462"></a>01462                           filename) ;
-<a name="l01463"></a>01463         cpl_free(filename) ;
-<a name="l01464"></a>01464         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_or_set%02d.fits"</span>, set_nb);
-<a name="l01465"></a>01465         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,
-<a name="l01466"></a>01466                           parlist,
-<a name="l01467"></a>01467                           used_frames,
-<a name="l01468"></a>01468                           (<span class="keyword">const</span> cpl_table **)raw_flat_odd_row_stats,
-<a name="l01469"></a>01469                           recipe_name,
-<a name="l01470"></a>01470                           HAWKI_CALPRO_FLAT_STATS_ODD_ROW,
-<a name="l01471"></a>01471                           HAWKI_PROTYPE_FLAT_STATS_ODD_ROW,
-<a name="l01472"></a>01472                           NULL,
-<a name="l01473"></a>01473                           (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l01474"></a>01474                           filename) ;
-<a name="l01475"></a>01475         cpl_free(filename) ;
-<a name="l01476"></a>01476     }
-<a name="l01477"></a>01477     cpl_frameset_delete(used_frames);
-<a name="l01478"></a>01478         
-<a name="l01479"></a>01479     <span class="comment">/* Free and return */</span>
-<a name="l01480"></a>01480     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l01481"></a>01481         cpl_propertylist_delete(qclists[i]) ;
-<a name="l01482"></a>01482     }
-<a name="l01483"></a>01483     cpl_free(qclists) ;
-<a name="l01484"></a>01484     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l01485"></a>01485     <span class="keywordflow">return</span>  0;
-<a name="l01486"></a>01486 }
-<a name="l01487"></a>01487 
-<a name="l01488"></a>01488 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01495"></a>01495 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01496"></a>01496 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_compare(
-<a name="l01497"></a>01497         <span class="keyword">const</span> cpl_frame *   frame1,
-<a name="l01498"></a>01498         <span class="keyword">const</span> cpl_frame *   frame2)
-<a name="l01499"></a>01499 {
-<a name="l01500"></a>01500     <span class="keywordtype">int</span>                     comparison ;
-<a name="l01501"></a>01501     cpl_propertylist    *   plist1 ;
-<a name="l01502"></a>01502     cpl_propertylist    *   plist2 ;
-<a name="l01503"></a>01503     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval1,
-<a name="l01504"></a>01504                         *   sval2 ;
-<a name="l01505"></a>01505     <span class="keywordtype">double</span>                  dval1, dval2 ;
-<a name="l01506"></a>01506 
-<a name="l01507"></a>01507     
-<a name="l01508"></a>01508     <span class="comment">/* Test entries */</span>
-<a name="l01509"></a>01509     <span class="keywordflow">if</span> (frame1==NULL || frame2==NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01510"></a>01510 
-<a name="l01511"></a>01511     <span class="comment">/* Get property lists */</span>
-<a name="l01512"></a>01512     <span class="keywordflow">if</span> ((plist1=cpl_propertylist_load(cpl_frame_get_filename(frame1),
-<a name="l01513"></a>01513                     0)) == NULL) {
-<a name="l01514"></a>01514         cpl_msg_error(__func__, <span class="stringliteral">"getting header from reference frame"</span>);
-<a name="l01515"></a>01515         <span class="keywordflow">return</span> -1 ;
-<a name="l01516"></a>01516     }
-<a name="l01517"></a>01517     <span class="keywordflow">if</span> ((plist2=cpl_propertylist_load(cpl_frame_get_filename(frame2),
-<a name="l01518"></a>01518                     0)) == NULL) {
-<a name="l01519"></a>01519         cpl_msg_error(__func__, <span class="stringliteral">"getting header from reference frame"</span>);
-<a name="l01520"></a>01520         cpl_propertylist_delete(plist1) ;
-<a name="l01521"></a>01521         <span class="keywordflow">return</span> -1 ;
-<a name="l01522"></a>01522     }
-<a name="l01523"></a>01523 
-<a name="l01524"></a>01524     <span class="comment">/* Test status */</span>
-<a name="l01525"></a>01525     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01526"></a>01526         cpl_propertylist_delete(plist1) ;
-<a name="l01527"></a>01527         cpl_propertylist_delete(plist2) ;
-<a name="l01528"></a>01528         <span class="keywordflow">return</span> -1 ;
-<a name="l01529"></a>01529     }
-<a name="l01530"></a>01530 
-<a name="l01531"></a>01531     comparison = 1 ;
-<a name="l01532"></a>01532 
-<a name="l01533"></a>01533     <span class="comment">/* Compare filters */</span>
-<a name="l01534"></a>01534     sval1 = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist1) ;
-<a name="l01535"></a>01535     sval2 = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist2) ;
-<a name="l01536"></a>01536     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01537"></a>01537         cpl_msg_error(__func__, <span class="stringliteral">"cannot get the filter"</span>);
-<a name="l01538"></a>01538         cpl_propertylist_delete(plist1) ;
-<a name="l01539"></a>01539         cpl_propertylist_delete(plist2) ;
-<a name="l01540"></a>01540         <span class="keywordflow">return</span> -1 ;
-<a name="l01541"></a>01541     }
-<a name="l01542"></a>01542     <span class="keywordflow">if</span> (strcmp(sval1, sval2)) comparison = 0 ;
-<a name="l01543"></a>01543 
-<a name="l01544"></a>01544     <span class="comment">/* Compare DITs */</span>
-<a name="l01545"></a>01545     dval1 = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist1) ;
-<a name="l01546"></a>01546     dval2 = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist2) ;
-<a name="l01547"></a>01547     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01548"></a>01548         cpl_msg_error(__func__, <span class="stringliteral">"cannot get the DIT"</span>);
-<a name="l01549"></a>01549         cpl_propertylist_delete(plist1) ;
-<a name="l01550"></a>01550         cpl_propertylist_delete(plist2) ;
-<a name="l01551"></a>01551         <span class="keywordflow">return</span> -1 ;
-<a name="l01552"></a>01552     }
-<a name="l01553"></a>01553     <span class="keywordflow">if</span> (fabs(dval1-dval2) > 1e-4) comparison = 0 ;
-<a name="l01554"></a>01554 
-<a name="l01555"></a>01555     cpl_propertylist_delete(plist1) ;
-<a name="l01556"></a>01556     cpl_propertylist_delete(plist2) ;
-<a name="l01557"></a>01557     <span class="keywordflow">return</span> comparison ;
-<a name="l01558"></a>01558 }
-<a name="l01559"></a>01559 
-<a name="l01560"></a>01560 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01567"></a>01567 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01568"></a>01568 <span class="keyword">static</span> cpl_imagelist * hawki_cal_flat_merge_bpms
-<a name="l01569"></a>01569 (<span class="keyword">const</span> cpl_frame *   bpm_orig,
-<a name="l01570"></a>01570  cpl_imagelist   *   bpm_to_merge)
-<a name="l01571"></a>01571 {
-<a name="l01572"></a>01572     cpl_imagelist   *   merged ;
-<a name="l01573"></a>01573     cpl_imagelist   *   bpm_orig_im;
-<a name="l01574"></a>01574     cpl_image       *   tmp ;
-<a name="l01575"></a>01575     <span class="keywordtype">int</span>                 i ;
-<a name="l01576"></a>01576 
-<a name="l01577"></a>01577     <span class="comment">/* Test entries */</span>
-<a name="l01578"></a>01578     <span class="keywordflow">if</span> (bpm_orig==NULL || bpm_to_merge ==NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l01579"></a>01579 
-<a name="l01580"></a>01580     <span class="comment">/* Create merged */</span>
-<a name="l01581"></a>01581     merged = cpl_imagelist_new() ;
-<a name="l01582"></a>01582 
-<a name="l01583"></a>01583     <span class="comment">/* Load the bpm_file */</span>
-<a name="l01584"></a>01584     bpm_orig_im = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm_orig, CPL_TYPE_INT);
-<a name="l01585"></a>01585     <span class="keywordflow">if</span>(bpm_orig_im == NULL)
-<a name="l01586"></a>01586     {
-<a name="l01587"></a>01587         cpl_msg_error(__func__, <span class="stringliteral">"Cannot read existing bpm %s"</span>,
-<a name="l01588"></a>01588                       cpl_frame_get_filename(bpm_orig));
-<a name="l01589"></a>01589         cpl_imagelist_delete(merged);
-<a name="l01590"></a>01590         <span class="keywordflow">return</span> NULL;
-<a name="l01591"></a>01591     }
-<a name="l01592"></a>01592 
-<a name="l01593"></a>01593     <span class="comment">/* Loop on the chips */</span>
-<a name="l01594"></a>01594     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l01595"></a>01595 
-<a name="l01596"></a>01596         <span class="comment">/* Merge */</span>
-<a name="l01597"></a>01597         tmp = cpl_image_add_create(cpl_imagelist_get(bpm_orig_im, i),
-<a name="l01598"></a>01598                                    cpl_imagelist_get(bpm_to_merge, i));
-<a name="l01599"></a>01599         cpl_image_multiply(cpl_imagelist_get(bpm_orig_im, i),
-<a name="l01600"></a>01600                            cpl_imagelist_get(bpm_to_merge, i));
-<a name="l01601"></a>01601         cpl_image_subtract(tmp, cpl_imagelist_get(bpm_orig_im, i)) ;
-<a name="l01602"></a>01602 
-<a name="l01603"></a>01603         <span class="comment">/* Store */</span>
-<a name="l01604"></a>01604         cpl_imagelist_set(merged, tmp, i) ;
-<a name="l01605"></a>01605     }
-<a name="l01606"></a>01606 
-<a name="l01607"></a>01607     <span class="comment">/* Clean-up and return */</span>
-<a name="l01608"></a>01608     cpl_imagelist_delete(bpm_orig_im);
-<a name="l01609"></a>01609     <span class="keywordflow">return</span> merged ;
-<a name="l01610"></a>01610 }
-<a name="l01611"></a>01611 
-<a name="l01612"></a>01612 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01623"></a>01623 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01624"></a>01624 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_select
-<a name="l01625"></a>01625 (cpl_vector  *   meds,
-<a name="l01626"></a>01626  cpl_vector  *   rms,
-<a name="l01627"></a>01627  <span class="keywordtype">int</span>             auto_flag,
-<a name="l01628"></a>01628  <span class="keywordtype">int</span>             auto_max_bins,
-<a name="l01629"></a>01629  <span class="keywordtype">double</span>          min_level,
-<a name="l01630"></a>01630  <span class="keywordtype">double</span>          max_level,
-<a name="l01631"></a>01631  <span class="keywordtype">double</span>          max_rms,
-<a name="l01632"></a>01632  <span class="keywordtype">int</span>             min_nframes,
-<a name="l01633"></a>01633  cpl_vector  *   selection)
-<a name="l01634"></a>01634 {
-<a name="l01635"></a>01635     <span class="keywordtype">double</span>      *   pselection ;
-<a name="l01636"></a>01636     <span class="keywordtype">double</span>      *   pmeds ;
-<a name="l01637"></a>01637     <span class="keywordtype">double</span>      *   prms ;
-<a name="l01638"></a>01638     <span class="keywordtype">int</span>             nvals ;
-<a name="l01639"></a>01639     <span class="keywordtype">int</span>             nsel ;
-<a name="l01640"></a>01640     <span class="keywordtype">double</span>          first_val, last_val, bin_val, dist, dist_min;
-<a name="l01641"></a>01641     <span class="keywordtype">double</span>          bin_low_val;
-<a name="l01642"></a>01642     <span class="keywordtype">double</span>          bin_up_val;
-<a name="l01643"></a>01643     <span class="keywordtype">int</span>             nbins, ind_closest ;
-<a name="l01644"></a>01644     <span class="keywordtype">int</span>             ibin;
-<a name="l01645"></a>01645     <span class="keywordtype">int</span>             ival;
-<a name="l01646"></a>01646     
-<a name="l01647"></a>01647     <span class="comment">/* Test entries */</span>
-<a name="l01648"></a>01648     <span class="keywordflow">if</span> (meds == NULL) <span class="keywordflow">return</span> -1;
-<a name="l01649"></a>01649     <span class="keywordflow">if</span> (rms == NULL) <span class="keywordflow">return</span> -1;
-<a name="l01650"></a>01650     <span class="keywordflow">if</span> (selection == NULL) <span class="keywordflow">return</span> -1;
-<a name="l01651"></a>01651     <span class="keywordflow">if</span>(cpl_vector_get_size(meds) != cpl_vector_get_size(selection))
-<a name="l01652"></a>01652     {
-<a name="l01653"></a>01653         cpl_msg_error(__func__, 
-<a name="l01654"></a>01654                       <span class="stringliteral">"The meds and selection vectors have not the same size"</span>);
-<a name="l01655"></a>01655         <span class="keywordflow">return</span> -1;
-<a name="l01656"></a>01656     }
-<a name="l01657"></a>01657 
-<a name="l01658"></a>01658     <span class="comment">/* Initialise. All the frames are selected by default */</span>
-<a name="l01659"></a>01659     nvals = cpl_vector_get_size(meds);
-<a name="l01660"></a>01660     pmeds = cpl_vector_get_data(meds);
-<a name="l01661"></a>01661     prms = cpl_vector_get_data(rms);
-<a name="l01662"></a>01662     cpl_vector_fill(selection, 1.0);  
-<a name="l01663"></a>01663 
-<a name="l01664"></a>01664     <span class="comment">/* Pointer to selection */</span>
-<a name="l01665"></a>01665     pselection = cpl_vector_get_data(selection) ;
-<a name="l01666"></a>01666 
-<a name="l01667"></a>01667     <span class="comment">/* First select based on minimum level, if applies */</span>
-<a name="l01668"></a>01668     <span class="keywordflow">if</span> (min_level >= 0.0)
-<a name="l01669"></a>01669     {
-<a name="l01670"></a>01670         <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) 
-<a name="l01671"></a>01671         {
-<a name="l01672"></a>01672             <span class="keywordflow">if</span> (pmeds[ival] < min_level)
-<a name="l01673"></a>01673                 pselection[ival] = -1.0 ;
-<a name="l01674"></a>01674         }
-<a name="l01675"></a>01675     }
-<a name="l01676"></a>01676 
-<a name="l01677"></a>01677     <span class="comment">/* Second select based on maximum level, if applies */</span>
-<a name="l01678"></a>01678     <span class="keywordflow">if</span> (max_level >= 0.0)
-<a name="l01679"></a>01679     {
-<a name="l01680"></a>01680         <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) 
-<a name="l01681"></a>01681         {
-<a name="l01682"></a>01682             <span class="keywordflow">if</span> (pmeds[ival] > max_level)
-<a name="l01683"></a>01683                 pselection[ival] = -1.0 ;
-<a name="l01684"></a>01684         }
-<a name="l01685"></a>01685     }
-<a name="l01686"></a>01686 
-<a name="l01687"></a>01687     <span class="comment">/* Third select based on rms maximum level, if applies */</span>
-<a name="l01688"></a>01688     <span class="keywordflow">if</span> (max_rms >= 0.0)
-<a name="l01689"></a>01689     {
-<a name="l01690"></a>01690         <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) 
-<a name="l01691"></a>01691         {
-<a name="l01692"></a>01692             <span class="keywordflow">if</span> (prms[ival] > max_rms)
-<a name="l01693"></a>01693                 pselection[ival] = -1.0 ;
-<a name="l01694"></a>01694         }
-<a name="l01695"></a>01695     }
-<a name="l01696"></a>01696 
-<a name="l01697"></a>01697     <span class="comment">/* Apply the histogram selection */</span>
-<a name="l01698"></a>01698     <span class="keywordflow">if</span> (auto_flag)
-<a name="l01699"></a>01699     {
-<a name="l01700"></a>01700         <span class="comment">/* Automatic  */</span>
-<a name="l01701"></a>01701         cpl_vector * auto_selection;
-<a name="l01702"></a>01702         auto_selection = cpl_vector_new(nvals);
-<a name="l01703"></a>01703         cpl_vector_fill(auto_selection, -1.0);
-<a name="l01704"></a>01704         cpl_msg_info(__func__, <span class="stringliteral">"Automatic dynamic range selection"</span>);
-<a name="l01705"></a>01705         first_val = <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a>(meds, selection);
-<a name="l01706"></a>01706         last_val = <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a>(meds, selection);
-<a name="l01707"></a>01707 
-<a name="l01708"></a>01708         nbins = nvals ;
-<a name="l01709"></a>01709         <span class="keywordflow">if</span> (auto_max_bins > 0 && auto_max_bins < nvals) nbins = auto_max_bins;
-<a name="l01710"></a>01710         <span class="keywordflow">for</span> (ibin=0 ; ibin<nbins ; ibin++) 
-<a name="l01711"></a>01711         {
-<a name="l01712"></a>01712             <span class="keywordflow">if</span>(ibin == 0)
-<a name="l01713"></a>01713                 bin_val = first_val + (last_val-first_val)*(ibin+1)/nbins ;
-<a name="l01714"></a>01714             <span class="keywordflow">else</span> <span class="keywordflow">if</span>(ibin == nbins - 1)
-<a name="l01715"></a>01715                 bin_val = first_val + (last_val-first_val)*(ibin)/nbins ;
-<a name="l01716"></a>01716             <span class="keywordflow">else</span>
-<a name="l01717"></a>01717                 bin_val = first_val + (last_val-first_val)*(ibin+0.5)/nbins ;
-<a name="l01718"></a>01718             bin_low_val = first_val + (last_val-first_val)*(ibin)/nbins ;
-<a name="l01719"></a>01719             bin_up_val  = first_val + (last_val-first_val)*(ibin+1)/nbins ;
-<a name="l01720"></a>01720 
-<a name="l01721"></a>01721             <span class="comment">/* Select the closest */</span>
-<a name="l01722"></a>01722             dist_min = fabs(pmeds[0] - bin_val) ;
-<a name="l01723"></a>01723             ind_closest = -1;
-<a name="l01724"></a>01724             <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) 
-<a name="l01725"></a>01725             {
-<a name="l01726"></a>01726                 dist = fabs(pmeds[ival] - bin_val) ;
-<a name="l01727"></a>01727                 <span class="keywordflow">if</span> (dist < dist_min && pselection[ival] != -1) 
-<a name="l01728"></a>01728                 {
-<a name="l01729"></a>01729                     dist_min = dist;
-<a name="l01730"></a>01730                     ind_closest = ival;
-<a name="l01731"></a>01731                 }
-<a name="l01732"></a>01732             }
-<a name="l01733"></a>01733             <span class="keywordflow">if</span>(ind_closest != -1)
-<a name="l01734"></a>01734                 cpl_vector_set(auto_selection, ind_closest, 1.0);
-<a name="l01735"></a>01735         }
-<a name="l01736"></a>01736         <span class="comment">/* Use the auto_selection */</span>
-<a name="l01737"></a>01737         cpl_vector_copy(selection, auto_selection);
-<a name="l01738"></a>01738         cpl_vector_delete(auto_selection);
-<a name="l01739"></a>01739     }
-<a name="l01740"></a>01740     
-<a name="l01741"></a>01741     <span class="comment">/* Print and count the selected frames */</span>
-<a name="l01742"></a>01742     nsel = 0;
-<a name="l01743"></a>01743     cpl_msg_indent_more();
-<a name="l01744"></a>01744     <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) 
-<a name="l01745"></a>01745     {
-<a name="l01746"></a>01746         <span class="keywordflow">if</span>(pselection[ival] != -1)
-<a name="l01747"></a>01747         {
-<a name="l01748"></a>01748             cpl_msg_info(__func__, <span class="stringliteral">"Selected frame %d"</span>, ival+1) ;
-<a name="l01749"></a>01749             nsel++;
-<a name="l01750"></a>01750         }
-<a name="l01751"></a>01751     }
-<a name="l01752"></a>01752     cpl_msg_indent_less();
-<a name="l01753"></a>01753     
-<a name="l01754"></a>01754     <span class="comment">/* Check the number of selected against min_nframes */</span>
-<a name="l01755"></a>01755     <span class="keywordflow">if</span> (nsel == 0) {
-<a name="l01756"></a>01756         cpl_msg_error(__func__, <span class="stringliteral">"No frame selected. Check selection criteria"</span>);
-<a name="l01757"></a>01757         <span class="keywordflow">return</span> -1;
-<a name="l01758"></a>01758     }
-<a name="l01759"></a>01759     <span class="keywordflow">if</span> (min_nframes >= 0) {
-<a name="l01760"></a>01760         <span class="keywordflow">if</span> (nsel < min_nframes) {
-<a name="l01761"></a>01761             cpl_msg_error(__func__, <span class="stringliteral">"Not enough selected frames (%d < %d)"</span>,
-<a name="l01762"></a>01762                 nsel, min_nframes) ;
-<a name="l01763"></a>01763             <span class="keywordflow">return</span> -1;
-<a name="l01764"></a>01764         }
-<a name="l01765"></a>01765     }
-<a name="l01766"></a>01766     
-<a name="l01767"></a>01767     <span class="keywordflow">return</span> 0;
-<a name="l01768"></a>01768 }
-<a name="l01769"></a>01769  
-<a name="l01770"></a>01770 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01777"></a>01777 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01778"></a>01778 <span class="keyword">static</span> cpl_vector * hawki_cal_flat_extract_vector(
-<a name="l01779"></a>01779         cpl_vector  *   in,
-<a name="l01780"></a>01780         cpl_vector  *   selection)
-<a name="l01781"></a>01781 {
-<a name="l01782"></a>01782     <span class="keywordtype">int</span>             nvals ;
-<a name="l01783"></a>01783     cpl_vector  *   selected ;
-<a name="l01784"></a>01784     <span class="keywordtype">double</span>      *   pin ;
-<a name="l01785"></a>01785     <span class="keywordtype">double</span>      *   pselection ;
-<a name="l01786"></a>01786     <span class="keywordtype">double</span>      *   pselected ;
-<a name="l01787"></a>01787     <span class="keywordtype">int</span>             nselected ;
-<a name="l01788"></a>01788     <span class="keywordtype">int</span>             i ;
-<a name="l01789"></a>01789     
-<a name="l01790"></a>01790     <span class="comment">/* Test entries */</span>
-<a name="l01791"></a>01791     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l01792"></a>01792     <span class="keywordflow">if</span> (selection == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l01793"></a>01793 
-<a name="l01794"></a>01794     <span class="comment">/* Initialise */</span>
-<a name="l01795"></a>01795     nvals = cpl_vector_get_size(in) ;
-<a name="l01796"></a>01796     nselected = 0 ;
-<a name="l01797"></a>01797     pin = cpl_vector_get_data(in) ;
-<a name="l01798"></a>01798     pselection = cpl_vector_get_data(selection) ;
-<a name="l01799"></a>01799 
-<a name="l01800"></a>01800     <span class="comment">/* Test entries */</span>
-<a name="l01801"></a>01801     <span class="keywordflow">if</span> (nvals != cpl_vector_get_size(selection)) <span class="keywordflow">return</span> NULL ; 
-<a name="l01802"></a>01802 
-<a name="l01803"></a>01803     <span class="comment">/* Count the selected values */</span>
-<a name="l01804"></a>01804     <span class="keywordflow">for</span> (i=0 ; i<nvals ; i++) {
-<a name="l01805"></a>01805         <span class="keywordflow">if</span> (pselection[i] > 0.0) nselected++ ;
-<a name="l01806"></a>01806     } 
-<a name="l01807"></a>01807     <span class="keywordflow">if</span> (nselected == 0) <span class="keywordflow">return</span> NULL ;
-<a name="l01808"></a>01808 
-<a name="l01809"></a>01809     <span class="comment">/* Create the selected vector */</span>
-<a name="l01810"></a>01810     selected = cpl_vector_new(nselected) ;
-<a name="l01811"></a>01811     pselected = cpl_vector_get_data(selected) ;
-<a name="l01812"></a>01812 
-<a name="l01813"></a>01813     nselected = 0 ;
-<a name="l01814"></a>01814     <span class="keywordflow">for</span> (i=0 ; i<nvals ; i++) {
-<a name="l01815"></a>01815         <span class="keywordflow">if</span> (pselection[i] > 0.0) {
-<a name="l01816"></a>01816             pselected[nselected] = pin[i] ;
-<a name="l01817"></a>01817             nselected++ ;
-<a name="l01818"></a>01818         }
-<a name="l01819"></a>01819     } 
-<a name="l01820"></a>01820     <span class="keywordflow">return</span> selected ;
-<a name="l01821"></a>01821 }
-<a name="l01822"></a>01822 
-<a name="l01823"></a>01823 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_retrieve_input_param
-<a name="l01824"></a>01824 (cpl_parameterlist  *  parlist)
-<a name="l01825"></a>01825 {
-<a name="l01826"></a>01826     <span class="keyword">const</span> <span class="keywordtype">char</span>      * sval;
-<a name="l01827"></a>01827     cpl_parameter   * par;
-<a name="l01828"></a>01828     <span class="keywordtype">int</span>               idet;
-<a name="l01829"></a>01829     
-<a name="l01830"></a>01830     <span class="comment">/* Initialise */</span>
-<a name="l01831"></a>01831     par = NULL ;
-<a name="l01832"></a>01832     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01833"></a>01833         hawki_cal_flat_outputs.nb_badpix[idet] = -1 ;
-<a name="l01834"></a>01834         hawki_cal_flat_outputs.med_stdev[idet] = -1.0 ;
-<a name="l01835"></a>01835         hawki_cal_flat_outputs.med_avg[idet] = -1.0 ;
-<a name="l01836"></a>01836         hawki_cal_flat_outputs.med_med[idet] = -1.0 ;
-<a name="l01837"></a>01837         hawki_cal_flat_outputs.med_min[idet] = -1.0 ;
-<a name="l01838"></a>01838         hawki_cal_flat_outputs.med_max[idet] = -1.0 ;
-<a name="l01839"></a>01839     }
-<a name="l01840"></a>01840 
-<a name="l01841"></a>01841     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l01842"></a>01842     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.zone"</span>) ;
-<a name="l01843"></a>01843     sval = cpl_parameter_get_string(par) ;
-<a name="l01844"></a>01844     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,
-<a name="l01845"></a>01845                     &hawki_cal_flat_config.llx,
-<a name="l01846"></a>01846                     &hawki_cal_flat_config.lly,
-<a name="l01847"></a>01847                     &hawki_cal_flat_config.urx,
-<a name="l01848"></a>01848                     &hawki_cal_flat_config.ury)!=4) 
-<a name="l01849"></a>01849     {
-<a name="l01850"></a>01850         <span class="keywordflow">return</span> -1 ;
-<a name="l01851"></a>01851     }
-<a name="l01852"></a>01852     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.sigma_badres"</span>) ;
-<a name="l01853"></a>01853     hawki_cal_flat_config.sigma_badres = cpl_parameter_get_double(par) ;
-<a name="l01854"></a>01854     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.sigma_bpm"</span>) ;
-<a name="l01855"></a>01855     hawki_cal_flat_config.sigma_bpm = cpl_parameter_get_double(par) ;
-<a name="l01856"></a>01856     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.lowval_bpm"</span>) ;
-<a name="l01857"></a>01857     hawki_cal_flat_config.lowval_bpm = cpl_parameter_get_double(par) ;
-<a name="l01858"></a>01858     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.highval_bpm"</span>) ;
-<a name="l01859"></a>01859     hawki_cal_flat_config.highval_bpm = cpl_parameter_get_double(par) ;
-<a name="l01860"></a>01860     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.normalise"</span>) ;
-<a name="l01861"></a>01861     hawki_cal_flat_config.normalise = cpl_parameter_get_bool(par) ;
-<a name="l01862"></a>01862     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.second_pass"</span>) ;
-<a name="l01863"></a>01863     hawki_cal_flat_config.second_pass = cpl_parameter_get_bool(par) ;
-<a name="l01864"></a>01864     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.select_auto"</span>) ;
-<a name="l01865"></a>01865     hawki_cal_flat_config.select_auto = cpl_parameter_get_bool(par) ;
-<a name="l01866"></a>01866     par = cpl_parameterlist_find(parlist, 
-<a name="l01867"></a>01867             <span class="stringliteral">"hawki.hawki_cal_flat.select_auto_max_bins"</span>) ;
-<a name="l01868"></a>01868     hawki_cal_flat_config.select_auto_max_bins = cpl_parameter_get_int(par);
-<a name="l01869"></a>01869     par = cpl_parameterlist_find(parlist, 
-<a name="l01870"></a>01870             <span class="stringliteral">"hawki.hawki_cal_flat.select_min_level"</span>) ;
-<a name="l01871"></a>01871     sval = cpl_parameter_get_string(par);
-<a name="l01872"></a>01872     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,
-<a name="l01873"></a>01873                &hawki_cal_flat_config.select_min_level[0],
-<a name="l01874"></a>01874                &hawki_cal_flat_config.select_min_level[1],
-<a name="l01875"></a>01875                &hawki_cal_flat_config.select_min_level[2],
-<a name="l01876"></a>01876                &hawki_cal_flat_config.select_min_level[3])!=4)
-<a name="l01877"></a>01877     {
-<a name="l01878"></a>01878         <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_min_level[0])!=1)
-<a name="l01879"></a>01879         {
-<a name="l01880"></a>01880             <span class="keywordflow">return</span> -1;
-<a name="l01881"></a>01881         }
-<a name="l01882"></a>01882         <span class="keywordflow">else</span>
-<a name="l01883"></a>01883         {
-<a name="l01884"></a>01884             hawki_cal_flat_config.select_min_level[1] = 
-<a name="l01885"></a>01885                 hawki_cal_flat_config.select_min_level[0];
-<a name="l01886"></a>01886             hawki_cal_flat_config.select_min_level[2] = 
-<a name="l01887"></a>01887                 hawki_cal_flat_config.select_min_level[0];
-<a name="l01888"></a>01888             hawki_cal_flat_config.select_min_level[3] = 
-<a name="l01889"></a>01889                 hawki_cal_flat_config.select_min_level[0];
-<a name="l01890"></a>01890         }
-<a name="l01891"></a>01891     }
-<a name="l01892"></a>01892     par = cpl_parameterlist_find(parlist, 
-<a name="l01893"></a>01893             <span class="stringliteral">"hawki.hawki_cal_flat.select_max_level"</span>) ;
-<a name="l01894"></a>01894     sval = cpl_parameter_get_string(par);
-<a name="l01895"></a>01895     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,
-<a name="l01896"></a>01896                &hawki_cal_flat_config.select_max_level[0],
-<a name="l01897"></a>01897                &hawki_cal_flat_config.select_max_level[1],
-<a name="l01898"></a>01898                &hawki_cal_flat_config.select_max_level[2],
-<a name="l01899"></a>01899                &hawki_cal_flat_config.select_max_level[3])!=4)
-<a name="l01900"></a>01900     {
-<a name="l01901"></a>01901         <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_max_level[0])!=1)
-<a name="l01902"></a>01902         {
-<a name="l01903"></a>01903             <span class="keywordflow">return</span> -1;
-<a name="l01904"></a>01904         }
-<a name="l01905"></a>01905         <span class="keywordflow">else</span>
-<a name="l01906"></a>01906         {
-<a name="l01907"></a>01907             hawki_cal_flat_config.select_max_level[1] = 
-<a name="l01908"></a>01908                 hawki_cal_flat_config.select_max_level[0];
-<a name="l01909"></a>01909             hawki_cal_flat_config.select_max_level[2] = 
-<a name="l01910"></a>01910                 hawki_cal_flat_config.select_max_level[0];
-<a name="l01911"></a>01911             hawki_cal_flat_config.select_max_level[3] = 
-<a name="l01912"></a>01912                 hawki_cal_flat_config.select_max_level[0];
-<a name="l01913"></a>01913         }
-<a name="l01914"></a>01914     }
-<a name="l01915"></a>01915     par = cpl_parameterlist_find(parlist, 
-<a name="l01916"></a>01916             <span class="stringliteral">"hawki.hawki_cal_flat.select_max_rms"</span>) ;
-<a name="l01917"></a>01917     sval = cpl_parameter_get_string(par);
-<a name="l01918"></a>01918     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,
-<a name="l01919"></a>01919                hawki_cal_flat_config.select_max_rms,
-<a name="l01920"></a>01920                hawki_cal_flat_config.select_max_rms+1,
-<a name="l01921"></a>01921                hawki_cal_flat_config.select_max_rms+2,
-<a name="l01922"></a>01922                hawki_cal_flat_config.select_max_rms+3)!=4)
-<a name="l01923"></a>01923     {
-<a name="l01924"></a>01924         <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_max_rms[0])!=1)
-<a name="l01925"></a>01925         {
-<a name="l01926"></a>01926             <span class="keywordflow">return</span> -1;
-<a name="l01927"></a>01927         }
-<a name="l01928"></a>01928         <span class="keywordflow">else</span>
-<a name="l01929"></a>01929         {
-<a name="l01930"></a>01930             hawki_cal_flat_config.select_max_rms[1] = 
-<a name="l01931"></a>01931                 hawki_cal_flat_config.select_max_rms[0];
-<a name="l01932"></a>01932             hawki_cal_flat_config.select_max_rms[2] = 
-<a name="l01933"></a>01933                 hawki_cal_flat_config.select_max_rms[0];
-<a name="l01934"></a>01934             hawki_cal_flat_config.select_max_rms[3] = 
-<a name="l01935"></a>01935                 hawki_cal_flat_config.select_max_rms[0];
-<a name="l01936"></a>01936         }
-<a name="l01937"></a>01937     }
-<a name="l01938"></a>01938     par = cpl_parameterlist_find(parlist, 
-<a name="l01939"></a>01939             <span class="stringliteral">"hawki.hawki_cal_flat.select_min_nframes"</span>) ;
-<a name="l01940"></a>01940     hawki_cal_flat_config.select_min_nframes = cpl_parameter_get_int(par) ;
-<a name="l01941"></a>01941     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.extra_stats"</span>) ;
-<a name="l01942"></a>01942     hawki_cal_flat_config.extra_stats = cpl_parameter_get_bool(par) ;
-<a name="l01943"></a>01943 
-<a name="l01944"></a>01944     <span class="keywordflow">if</span>(hawki_cal_flat_config.select_auto_max_bins != -1 &&
-<a name="l01945"></a>01945             !hawki_cal_flat_config.select_auto)
-<a name="l01946"></a>01946     {
-<a name="l01947"></a>01947             cpl_msg_error(__func__,<span class="stringliteral">"Max bins is only allowed with select_auto"</span>);
-<a name="l01948"></a>01948             <span class="keywordflow">return</span> -1;
-<a name="l01949"></a>01949     }
-<a name="l01950"></a>01950         
-<a name="l01951"></a>01951     <span class="keywordflow">return</span> 0;
-<a name="l01952"></a>01952 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_flat.c,v 1.25 2012/01/11 15:02:18 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/01/11 15:02:18 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.25 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <string.h></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 "irplib_utils.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_dfs.h"</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="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> <span class="keywordtype">int</span> hawki_cal_flat_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat(cpl_parameterlist *, cpl_frameset *) ;</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> <span class="keywordtype">int</span> hawki_cal_flat_retrieve_input_param</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> cpl_imagelist ** hawki_cal_flat_reduce(</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>         cpl_frameset    *   flatframes,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_file,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>         cpl_table       **  raw_flat_stats,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>         cpl_table       **  raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>         cpl_table       **  raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>         cpl_table       **  raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>         cpl_table       **  raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>         cpl_vector      **  selected); </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_clean_outliers(cpl_image *, cpl_imagelist *,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>         cpl_imagelist *, cpl_vector *, cpl_image **) ;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_save</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (cpl_imagelist     ** flat,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  cpl_table         ** raw_flat_stats,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_table         ** raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_table         ** raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_table         ** raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  cpl_table         ** raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_vector        ** raw_selected,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keywordtype">int</span>                  set_nb,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keyword">const</span> cpl_frame   *  bpmdark,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  cpl_frameset      *  flatframes,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_frameset      *  calibframes,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_parameterlist *  parlist,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_frameset      *  set_tot);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_compare(<span class="keyword">const</span> cpl_frame *, <span class="keyword">const</span> cpl_frame *) ;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keyword">static</span> cpl_imagelist * hawki_cal_flat_merge_bpms</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> (<span class="keyword">const</span> cpl_frame *   bpm_orig,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  cpl_imagelist   *   bpm_to_add);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_select</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> (cpl_vector  *   meds,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  cpl_vector  *   rms,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  <span class="keywordtype">int</span>             auto_flag,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  <span class="keywordtype">int</span>             auto_max_bins,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>  <span class="keywordtype">double</span>          min_level,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>  <span class="keywordtype">double</span>          max_level,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  <span class="keywordtype">double</span>          max_rms,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  <span class="keywordtype">int</span>             min_nframes,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  cpl_vector  *   selection);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keyword">static</span> cpl_vector * hawki_cal_flat_extract_vector(cpl_vector *,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         cpl_vector *) ;</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keyword">static</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="comment">/* Inputs */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordtype">int</span>         llx ;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordtype">int</span>         lly ;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="keywordtype">int</span>         urx ;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordtype">int</span>         ury ;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="keywordtype">int</span>         normalise ;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordtype">int</span>         second_pass ;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="keywordtype">double</span>      sigma_badres ;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordtype">double</span>      sigma_bpm ;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="keywordtype">double</span>      lowval_bpm ;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="keywordtype">double</span>      highval_bpm ;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordtype">int</span>         select_auto ;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="keywordtype">int</span>         select_auto_max_bins;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keywordtype">double</span>      select_min_level[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordtype">double</span>      select_max_level[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordtype">double</span>      select_max_rms[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordtype">int</span>         select_min_nframes ;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keywordtype">int</span>         extra_stats;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> } hawki_cal_flat_config ;</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="keyword">struct </span>{</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="comment">/* Outputs */</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="keywordtype">int</span>         nb_badpix[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="keywordtype">double</span>      norm[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="keywordtype">double</span>      med_stdev[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordtype">double</span>      med_avg[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordtype">double</span>      med_med[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordtype">double</span>      med_min[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordtype">double</span>      med_max[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> } hawki_cal_flat_outputs;</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="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_flat_description[] = </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="stringliteral">"hawki_cal_flat -- HAWKĪI imaging flat-field creation from twillight images.\n"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_FLAT_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="stringliteral">"Optional inputs are:\n"</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="stringliteral">"bpmdark-file.fits "</span>HAWKI_CALPRO_BPM_HOT<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="stringliteral">"dark_err-file.fits "</span>HAWKI_CALPRO_DARK_ERR<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="stringliteral">"hawki_cal_flat_setxx.fits ("</span>HAWKI_CALPRO_FLAT<span class="stringliteral">"): Master flat for filter xx\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="stringliteral">"hawki_cal_flat_err_setxx.fits ("</span>HAWKI_CALPRO_FLAT_ERRMAP<span class="stringliteral">"): Master flat residuals\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="stringliteral">"hawki_cal_flat_bpmflat_setxx.fits ("</span>HAWKI_CALPRO_BPM_COLD<span class="stringliteral">"): BPM from the flat\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="stringliteral">"hawki_cal_flat_stats_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS<span class="stringliteral">"): Stats of the individual flats\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="stringliteral">"Optionally it also creates:\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="stringliteral">"hawki_cal_flat_bpm_setxx.fits ("</span>HAWKI_CALPRO_BPM<span class="stringliteral">"): Bad pixel mask combining bpm from dark and flat\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="stringliteral">"hawki_cal_flat_stats_ec_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_EVEN_COL<span class="stringliteral">"): Stats of the individual flats for even columns\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="stringliteral">"hawki_cal_flat_stats_oc_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_ODD_COL<span class="stringliteral">"): Stats of the individual flats for odd columns\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="stringliteral">"hawki_cal_flat_stats_er_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_EVEN_ROW<span class="stringliteral">"): Stats of the individual flats for even rows\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="stringliteral">"hawki_cal_flat_stats_or_setxx.fits ("</span>HAWKI_CALPRO_FLAT_STATS_ODD_ROW<span class="stringliteral">"): Stats of the individual flats for odd rows\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="stringliteral">"or 1 otherwise"</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> </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">                                Functions code</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                     <span class="stringliteral">"hawki_cal_flat"</span>,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                     <span class="stringliteral">"Twillight flat recipe"</span>,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                     hawki_cal_flat_description,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                     hawki_cal_flat_create,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                     hawki_cal_flat_exec,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                     hawki_cal_flat_destroy) ;</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_pluginlist_append(list, plugin) ;</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> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_create(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>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</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>     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     recipe->parameters = cpl_parameterlist_new() ;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="comment">/* --zone */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.zone"</span>,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                 <span class="stringliteral">"Stats zone"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 <span class="stringliteral">"hawki.hawki_cal_flat"</span>,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 <span class="stringliteral">"1,1,2048,2048"</span>) ;</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">"zone"</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">/* --normalise */</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.normalise"</span>,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to apply the normalisation"</span>,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, FALSE) ;</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">"normalise"</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">/* --second_pass */</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.second_pass"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to apply a second pass computation"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, TRUE) ;</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">"second_pass"</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">/* --sigma_badres */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.sigma_badres"</span>,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for detection of bad flat results"</span>,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 1.0) ;</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">"sigma_badres"</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">/* --sigma_bpm */</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.sigma_bpm"</span>,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"sigma for detection of bad pixels"</span>,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10.0) ;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_bpm"</span>) ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --lowval_bpm */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.lowval_bpm"</span>,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"values of the flat below this will be included "</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             <span class="stringliteral">"in the bpm. In units of final flat (normalised if normalise is on)"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, .1) ;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"lowval_bpm"</span>) ;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --highval_bpm */</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.highval_bpm"</span>,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"values of the flat above this will be included "</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>             <span class="stringliteral">"in the bpm. In units of final flat (normalized if normalise is on)"</span>,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10.0) ;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"highval_bpm"</span>) ;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --select_auto */</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_auto"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to automatically select the good input frames"</span>,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, TRUE);</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">"select_auto"</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">/* --select_auto_max_bins */</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_auto_max_bins"</span>,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>             CPL_TYPE_INT, <span class="stringliteral">"Maximum number of frames requested"</span>,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 10) ;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_auto_max_bins"</span>);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --select_min_level */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_min_level"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             CPL_TYPE_STRING, <span class="stringliteral">"Minimum ADU level for frames selection"</span>,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"-1.0"</span>) ;</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">"select_min_level"</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">/* --select_max_level */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_max_level"</span>,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>             CPL_TYPE_STRING, <span class="stringliteral">"Maximum ADU level for frames selection"</span>,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"25000"</span>);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_max_level"</span>);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_parameterlist_append(recipe->parameters, p);</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="comment">/* --select_max_rms */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_max_rms"</span>,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             CPL_TYPE_STRING, <span class="stringliteral">"Maximum RMS for frames selection"</span>,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, <span class="stringliteral">"4000"</span>);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_max_rms"</span>);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     cpl_parameterlist_append(recipe->parameters, p);</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">/* --select_min_nframes */</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.select_min_nframes"</span>,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             CPL_TYPE_INT, <span class="stringliteral">"Minimum number of frames requested"</span>,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, 3);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"select_min_nframes"</span>) ;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --extra_stats */</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_flat.extra_stats"</span>,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>             CPL_TYPE_BOOL, <span class="stringliteral">"Request for even/odd column/rows statistics"</span>,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>             <span class="stringliteral">"hawki.hawki_cal_flat"</span>, FALSE) ;</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">"extra_stats"</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">/* Return */</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</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>     <span class="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_cal_flat(recipe->parameters, recipe->frames) ;</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="l00375"></a><span class="lineno">  375</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">return</span> 0 ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat(</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         cpl_frameset        *   framelist)</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_size        *   labels ;</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_size            nlabels ;</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_frameset    *   flatframes ;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <span class="keywordtype">int</span>                 nflats;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark ;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_err;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keyword">const</span> cpl_frame *   bpmdark ;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     cpl_imagelist   **  twflat ;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_table       **  raw_flat_stats;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_table       **  raw_flat_odd_column_stats = NULL;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_table       **  raw_flat_even_column_stats = NULL;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_table       **  raw_flat_odd_row_stats = NULL;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_table       **  raw_flat_even_row_stats = NULL;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_vector      **  raw_selected;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_size            i;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordtype">int</span>                 j ;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keywordflow">if</span>(hawki_cal_flat_retrieve_input_param(parlist))</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_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keywordflow">return</span> -1;</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>     </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         <span class="keywordflow">return</span> -1;</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordflow">if</span> ((flatframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                     HAWKI_CAL_FLAT_RAW)) == NULL) {</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find flat frames in the input list (%s)"</span>,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                       HAWKI_CAL_FLAT_RAW);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve calibration frames */</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     bpmdark = cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM_HOT);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     dark = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     dark_err = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK_ERR);</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="comment">/* Labelise all input flat frames */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     labels = cpl_frameset_labelise(flatframes, hawki_cal_flat_compare, </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                 &nlabels);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordflow">if</span> (labels == NULL) {</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot labelise input frames"</span>) ;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         cpl_frameset_delete(flatframes);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Extract sets and reduce each of them */</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">for</span> (i=0 ; i<nlabels ; i++) </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_frameset    *   this_filter_flats;</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="comment">/* Reduce data set nb i */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         cpl_msg_info(__func__, <span class="stringliteral">"Reduce data set no %d out of %d"</span>, i+1, nlabels);</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>         this_filter_flats = cpl_frameset_extract(flatframes, labels, i) ;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         nflats = cpl_frameset_get_size(this_filter_flats);</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">/* Allocate and initialize statistics */</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         raw_flat_stats = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         raw_selected = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_vector*));</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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>             raw_selected[j] = cpl_vector_new(nflats);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             raw_flat_stats[j] = cpl_table_new(nflats);</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">/* Initialize the statistics table */</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_stats);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)</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>             raw_flat_odd_column_stats = </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>             raw_flat_even_column_stats = </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>             raw_flat_odd_row_stats = </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>             raw_flat_even_row_stats = </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                 cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>             <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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>                 raw_flat_odd_column_stats[j] = cpl_table_new(nflats);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                 raw_flat_even_column_stats[j] = cpl_table_new(nflats);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                 raw_flat_odd_row_stats[j] = cpl_table_new(nflats);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                 raw_flat_even_row_stats[j] = cpl_table_new(nflats);</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">/* Initialize the statistics table */</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_odd_column_stats);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_even_column_stats);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_odd_row_stats);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_flat_even_row_stats);</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>         <span class="comment">/* Reduce */</span></div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         <span class="keywordflow">if</span> ((twflat = hawki_cal_flat_reduce</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                 (this_filter_flats, </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>                  dark,</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                  raw_flat_stats,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                  raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                  raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                  raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                  raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                  raw_selected)) == NULL) </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">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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>                 cpl_table_delete(raw_flat_stats[j]);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                 cpl_vector_delete(raw_selected[j]);</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_free(raw_flat_stats);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             cpl_free(raw_selected);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)</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">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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_table_delete(raw_flat_odd_column_stats[j]);</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                     cpl_table_delete(raw_flat_even_column_stats[j]);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                     cpl_table_delete(raw_flat_odd_row_stats[j]);</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                     cpl_table_delete(raw_flat_even_row_stats[j]);</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_free(raw_flat_odd_column_stats);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                 cpl_free(raw_flat_even_column_stats);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                 cpl_free(raw_flat_odd_row_stats);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                 cpl_free(raw_flat_even_row_stats);</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>             cpl_frameset_delete(this_filter_flats);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>             cpl_frameset_delete(flatframes);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>             cpl_free(labels);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce set nb %d"</span>, i+1) ;</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>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             <span class="comment">/* Save the products */</span></div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             cpl_frameset    *   calib_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>             cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             calib_frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             <span class="keywordflow">if</span>(bpmdark)</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                 cpl_frameset_insert(calib_frames, cpl_frame_duplicate(bpmdark));</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             <span class="keywordflow">if</span>(dark)</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>                 cpl_frameset_insert(calib_frames,</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>                         cpl_frame_duplicate(cpl_frameset_find_const(framelist, </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                                 HAWKI_CALPRO_DARK)));</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>             <span class="keywordflow">if</span>(dark_err)</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>                 cpl_frameset_insert(calib_frames,</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>                         cpl_frame_duplicate(cpl_frameset_find_const(framelist, </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>                                 HAWKI_CALPRO_DARK_ERR)));</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             hawki_cal_flat_save</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                 (twflat, raw_flat_stats, </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                  raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                  raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>                  raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                  raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                  raw_selected,</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                  i+1, bpmdark, this_filter_flats, calib_frames, </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                  parlist, framelist);</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>             cpl_imagelist_delete(twflat[0]);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>             cpl_imagelist_delete(twflat[1]);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             cpl_imagelist_delete(twflat[2]);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass)</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                 cpl_imagelist_delete(twflat[3]);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             cpl_free(twflat);</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>             <span class="keywordflow">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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_table_delete(raw_flat_stats[j]);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                 cpl_vector_delete(raw_selected[j]);</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_free(raw_flat_stats);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>             cpl_free(raw_selected);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)</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">for</span> (j=0 ; j<HAWKI_NB_DETECTORS ; j++)</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_table_delete(raw_flat_odd_column_stats[j]);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>                     cpl_table_delete(raw_flat_even_column_stats[j]);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>                     cpl_table_delete(raw_flat_odd_row_stats[j]);</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>                     cpl_table_delete(raw_flat_even_row_stats[j]);</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_free(raw_flat_odd_column_stats);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>                 cpl_free(raw_flat_even_column_stats);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                 cpl_free(raw_flat_odd_row_stats);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                 cpl_free(raw_flat_even_row_stats);</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>             cpl_frameset_delete(calib_frames);            </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_msg_indent_less();</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         cpl_frameset_delete(this_filter_flats);</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="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         cpl_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>                                  <span class="stringliteral">"Check permisions or disk space"</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>     </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     cpl_frameset_delete(flatframes);</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_free(labels); </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">/* Return */</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0;</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="l00609"></a><span class="lineno">  609</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> cpl_imagelist ** hawki_cal_flat_reduce(</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         cpl_frameset    *   flatframes,</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark_file,</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         cpl_table       **  raw_flat_stats,</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         cpl_table       **  raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         cpl_table       **  raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         cpl_table       **  raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         cpl_table       **  raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         cpl_vector      **  selected) </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">int</span>                     nima ;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_image           *   ima_cur ;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_image           *   big_ima ;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_image           *   big_badres ;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     cpl_vector          *   medians[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     cpl_vector          *   stdevs[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_vector          *   sub_medians ;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_imagelist       *   in_quad ;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     cpl_imagelist       **  results ;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     cpl_imagelist       *   res_quad[4] ;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     cpl_image           *   err_quad[4] ;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     cpl_image           *   badres_mask[4] ;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     cpl_image           *   flat_image ;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     cpl_image           *   dark ;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     cpl_propertylist    *   plist;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keywordtype">double</span>                  gradient ;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keywordtype">double</span>                  flat_dit;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     cpl_image           *   bpmflat;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordtype">int</span>                     j, k ;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordtype">int</span>                     idet;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keywordflow">if</span> (flatframes == NULL) <span class="keywordflow">return</span> NULL ;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     nima = cpl_frameset_get_size(flatframes) ;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keywordflow">if</span> (nima < 3) {</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         cpl_msg_error(__func__, <span class="stringliteral">"Not enough frames (%d)"</span>, nima) ;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordflow">return</span> 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="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         hawki_cal_flat_outputs.norm[idet] = 1.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>     <span class="comment">/* Compute statistics */</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     cpl_msg_info(__func__, <span class="stringliteral">"Compute statistics"</span>) ;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS chips */</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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>         <span class="comment">/* Compute some stats on input images */</span></div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>         cpl_msg_info(__func__, <span class="stringliteral">"image      min        max        med     rms"</span>) ;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</span>) ;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>         medians[idet] = cpl_vector_new(nima);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         stdevs[idet] = cpl_vector_new(nima);</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>         <span class="keywordflow">for</span> (j=0 ; j<nima ; j++)</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="comment">/* Load the image */</span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>             ima_cur = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(flatframes, j, idet+1, CPL_TYPE_FLOAT) ;</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">/* Compute the stats */</span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                 (raw_flat_stats,</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                  ima_cur,</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>                  hawki_cal_flat_config.llx,</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                  hawki_cal_flat_config.lly,</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                  hawki_cal_flat_config.urx,</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>                  hawki_cal_flat_config.ury,</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                  idet,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                  j) !=0 )</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>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute stats on image %d"</span>,j+1);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>                 cpl_image_delete(ima_cur);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>                 <span class="keywordflow">return</span> 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>             </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)</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>(hawki_image_stats_odd_even_column_row_fill_from_image</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                         (raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                          raw_flat_even_column_stats,</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                          raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                          raw_flat_even_row_stats,</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>                          ima_cur,</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                          idet,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                          j) !=0 )</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>                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute extra stats"</span>);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>                     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>                     cpl_image_delete(ima_cur);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                     <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                     <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                     <span class="keywordflow">return</span> NULL ;</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>             cpl_vector_set(medians[idet], j, cpl_table_get_double</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>                            (raw_flat_stats[idet],HAWKI_COL_STAT_MED,j,NULL )) ;</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>             cpl_vector_set(stdevs[idet], j, cpl_table_get_double</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                            (raw_flat_stats[idet],HAWKI_COL_STAT_RMS,j,NULL )) ;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>             cpl_msg_info(__func__, <span class="stringliteral">"%02d   %10.2f %10.2f %10.2f %10.2f"</span>,</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                     j+1,</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                     cpl_table_get_double(raw_flat_stats[idet],</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>                                          HAWKI_COL_STAT_MIN,j,NULL ),</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                     cpl_table_get_double(raw_flat_stats[idet],</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                                          HAWKI_COL_STAT_MAX,j,NULL ),</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>                     cpl_table_get_double(raw_flat_stats[idet],</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                                          HAWKI_COL_STAT_MED,j,NULL ),</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>                     cpl_table_get_double(raw_flat_stats[idet],</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>                                          HAWKI_COL_STAT_RMS,j,NULL ));</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>             <span class="keywordflow">if</span> (cpl_table_get_double</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>                     (raw_flat_stats[idet],HAWKI_COL_STAT_MED,j,NULL ) < 1e-6) </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_msg_error(__func__, <span class="stringliteral">"image %d has negative flux: aborting"</span>, </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                         j+1) ;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>                 <span class="keywordflow">for</span> (k=0 ; k<=idet ; k++) cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>                 <span class="keywordflow">return</span> NULL ;</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>             cpl_image_delete(ima_cur);</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>         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</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="comment">/* Compute min max stdev and mean of the medians */</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         hawki_cal_flat_outputs.med_min[idet]   = </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>             cpl_vector_get_min(medians[idet]);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         hawki_cal_flat_outputs.med_max[idet]   = </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>             cpl_vector_get_max(medians[idet]);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         hawki_cal_flat_outputs.med_avg[idet]   = </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>             cpl_vector_get_mean(medians[idet]);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>         hawki_cal_flat_outputs.med_med[idet]   =</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>             cpl_vector_get_median_const(medians[idet]);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         hawki_cal_flat_outputs.med_stdev[idet] = </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>             cpl_vector_get_stdev(medians[idet]);</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="comment">/* See if flux gradient is large enough for a correct fit */</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         gradient=fabs(hawki_cal_flat_outputs.med_max[idet]/ </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                 hawki_cal_flat_outputs.med_min[idet]) ;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         <span class="keywordflow">if</span> (gradient < 4.0) {</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>             <span class="comment">/* cpl_msg_warning(__func__, "Low flux gradient: %g", gradient) ;*/</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>     }</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     cpl_msg_indent_less() ;</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">/* Allocate for results */</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     results = cpl_malloc(4 * <span class="keyword">sizeof</span>(cpl_imagelist*)) ;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     results[0] = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     results[1] = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     results[2] = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass)  results[3] = cpl_imagelist_new() ; </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <span class="keywordflow">else</span>                                    results[3] = 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_msg_info(__func__, <span class="stringliteral">"Compute the flat"</span>) ;</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS chips */</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         cpl_msg_indent_more() ;</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="comment">/* Frames selection */</span></div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         cpl_msg_info(__func__, <span class="stringliteral">"Apply the frames selection"</span>);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         <span class="keywordflow">if</span> ((hawki_cal_flat_select(medians[idet], </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                                    stdevs[idet],</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>                                    hawki_cal_flat_config.select_auto,</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>                                    hawki_cal_flat_config.select_auto_max_bins,</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>                                    hawki_cal_flat_config.select_min_level[idet],</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>                                    hawki_cal_flat_config.select_max_level[idet],</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                                    hawki_cal_flat_config.select_max_rms[idet],</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>                                    hawki_cal_flat_config.select_min_nframes,</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                                    selected[idet])) == -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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply the frames selection"</span>) ;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>             cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>             cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>             cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>                 cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             cpl_free(results) ;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>                 cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>                 cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>             <span class="keywordflow">return</span> NULL ;</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">/* Apply the medians subselection */</span></div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         sub_medians = hawki_cal_flat_extract_vector</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>             (medians[idet], selected[idet]) ;</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">/* Loop on the 4 quadrants */</span></div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) {</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>             <span class="comment">/* Load input image chips */</span></div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             <span class="keywordflow">if</span> ((in_quad = <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(flatframes, idet+1, j+1, </div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                             CPL_TYPE_FLOAT))==NULL) {</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the raw quadrants"</span>) ;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                 cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                 cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>                 cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>                     cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>                 cpl_free(results) ;</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>                     cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                     cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>                 cpl_vector_delete(sub_medians) ;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>                 <span class="keywordflow">return</span> 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">/* Apply subselection of the frames */</span></div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>             cpl_imagelist_erase(in_quad, selected[idet]);</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="comment">/* Apply dark correction to all planes if requested */</span></div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             <span class="keywordflow">if</span> (dark_file) {</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>                 <span class="keywordflow">if</span> (j==0) cpl_msg_info(__func__, <span class="stringliteral">"Subtracting dark"</span>) ;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>                 <span class="comment">/* Load dark */</span></div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>                 <span class="keywordflow">if</span> ((dark = <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(dark_file,</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>                                 idet+1, j+1, CPL_TYPE_FLOAT)) == NULL) {</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the dark quadrants"</span>) ;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>                     cpl_imagelist_delete(in_quad) ;</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>                     cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>                     cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>                     cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>                     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>                         cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>                     cpl_free(results) ;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>                         cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>                         cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>                     cpl_vector_delete(sub_medians) ;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                     <span class="keywordflow">return</span> NULL ;</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="comment">/* Multiply by the dit */</span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>                 <span class="keywordflow">if</span> ((plist=cpl_propertylist_load</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>                         (cpl_frame_get_filename</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>                          (cpl_frameset_get_first_const(flatframes)), 0)) == NULL) </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>                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>                     cpl_imagelist_delete(in_quad) ;</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>                     cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>                     cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>                     cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                     <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                         cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>                     cpl_free(results) ;</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                         cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>                         cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                     cpl_vector_delete(sub_medians) ;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                     cpl_image_delete(dark);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>                     <span class="keywordflow">return</span> 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>                 flat_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                 cpl_image_multiply_scalar(dark, flat_dit);</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                 cpl_propertylist_delete(plist);</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">/* Dark correction */</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                 cpl_imagelist_subtract_image(in_quad, dark) ;</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>                 cpl_image_delete(dark) ;</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>                 <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                     cpl_msg_warning(__func__,<span class="stringliteral">"Cannot subtract the dark frame"</span>);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>                     cpl_error_reset() ;</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>         </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             <span class="comment">/* Fit slopes */</span></div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             err_quad[j] = cpl_image_duplicate(cpl_imagelist_get(in_quad, 0)) ;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>             res_quad[j] = cpl_fit_imagelist_polynomial(sub_medians, in_quad, </div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>                     0, 1, CPL_FALSE, CPL_TYPE_FLOAT, err_quad[j]) ;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             <span class="keywordflow">if</span> (res_quad[j] == NULL) {</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot create twilight flat-field"</span>) ;</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>                 cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>                 cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>                 cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                     cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>                 cpl_free(results) ;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>                 cpl_imagelist_delete(in_quad) ;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>                 <span class="keywordflow">for</span> (k=0 ; k<j ; k++) cpl_imagelist_delete(res_quad[k]) ;</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                 <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(err_quad[k]) ;</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>                 <span class="keywordflow">for</span> (k=0 ; k<j ; k++) </div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>                     <span class="keywordflow">if</span> (badres_mask[k]) cpl_image_delete(badres_mask[k]) ;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>                     cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>                     cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>                 cpl_vector_delete(sub_medians) ;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>                 <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>             <span class="comment">/* Handle the pixels with a high error */</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>             badres_mask[j] = NULL ;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) {</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>                 <span class="keywordflow">if</span> (j==0) cpl_msg_info(__func__, </div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>                         <span class="stringliteral">"Second pass to clean the outliers"</span>) ;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>                 <span class="keywordflow">if</span> (hawki_cal_flat_clean_outliers(err_quad[j], res_quad[j],</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>                             in_quad, sub_medians, &(badres_mask[j])) == -1) {</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot clean the outliers"</span>) ;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>                     cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>                     cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>                     cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>                     cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>                     cpl_free(results) ;</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>                     cpl_imagelist_delete(in_quad) ;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_imagelist_delete(res_quad[k]) ;</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(err_quad[k]) ;</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>                     <span class="keywordflow">for</span> (k=0 ; k<=j ; k++) cpl_image_delete(badres_mask[k]) ;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>                         cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>                     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>                         cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>                     cpl_vector_delete(sub_medians) ;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>                     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>                     <span class="keywordflow">return</span> NULL ;</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>             cpl_imagelist_delete(in_quad) ;</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_vector_delete(sub_medians) ;</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="comment">/* Rebuild the quadrants and put in results */</span></div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         <span class="comment">/* Rebuild RESULTS */</span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         big_ima = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>                 cpl_imagelist_get(res_quad[0],1), </div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>                 cpl_imagelist_get(res_quad[1],1), </div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>                 cpl_imagelist_get(res_quad[2],1), </div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>                 cpl_imagelist_get(res_quad[3],1)) ;</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_imagelist_delete(res_quad[j]) ;</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         cpl_imagelist_set(results[0], big_ima, idet) ;</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>         <span class="keywordflow">if</span> (big_ima == NULL) {</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot rebuild the image"</span>) ;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>             cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>                 cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>             cpl_free(results) ;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(err_quad[j]) ;</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) </div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>                 <span class="keywordflow">if</span> (badres_mask[j]) cpl_image_delete(badres_mask[j]) ;</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>                 cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>                 cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         <span class="comment">/* Rebuild ERROR */</span></div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>         big_ima = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(err_quad[0], err_quad[1], </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>                 err_quad[2], err_quad[3]) ;</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>         <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(err_quad[j]) ;</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>         <span class="keywordflow">if</span> (big_ima == NULL) {</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot rebuild the image"</span>) ;</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>             cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>             cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>             cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>             <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                 cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>             cpl_free(results) ;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) </div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>                 <span class="keywordflow">if</span> (badres_mask[j]) cpl_image_delete(badres_mask[j]) ;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>                 cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>             <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>                 cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>             <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>         }</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>         cpl_imagelist_set(results[1], big_ima, idet) ;</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="comment">/* Rebuild BADRES_MASK */</span></div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>         big_badres = <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(badres_mask[0], badres_mask[1], </div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>                 badres_mask[2], badres_mask[3]) ;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>         <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) {</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>             <span class="keywordflow">for</span> (j=0 ; j<4 ; j++) cpl_image_delete(badres_mask[j]) ;</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>             cpl_imagelist_set(results[3], big_badres, idet) ;</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>         <span class="keywordflow">if</span> (hawki_cal_flat_config.normalise) {</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>             <span class="comment">/* Normalize gain */</span></div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>             cpl_msg_info(__func__, <span class="stringliteral">"Normalise the flat"</span>) ;</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>             flat_image = cpl_imagelist_get(results[0], idet) ;</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>             hawki_cal_flat_outputs.norm[idet] = </div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                 cpl_image_get_median(flat_image) ;</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>             cpl_image_divide_scalar</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>                 (flat_image, hawki_cal_flat_outputs.norm[idet]);</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>             <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot normalise"</span>) ;</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>                 cpl_imagelist_delete(results[0]) ;</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>                 cpl_imagelist_delete(results[1]) ;</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>                 cpl_imagelist_delete(results[2]) ;</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>                 <span class="keywordflow">if</span> (hawki_cal_flat_config.second_pass) </div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>                     cpl_imagelist_delete(results[3]) ;</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>                 cpl_free(results) ;</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>                     cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>                 <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>                     cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>                 <span class="keywordflow">return</span> NULL ;</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>         }</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">/* BPM from the flat */</span></div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>         cpl_msg_info(__func__, <span class="stringliteral">"Compute the BPM from the flat"</span>) ;</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         bpmflat=<a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a>(cpl_imagelist_get(results[0],idet),</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>                 hawki_cal_flat_config.sigma_bpm,</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>                 hawki_cal_flat_config.lowval_bpm, </div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>                 hawki_cal_flat_config.highval_bpm);</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>         </div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         cpl_imagelist_set(results[2], bpmflat, idet) ;</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>         hawki_cal_flat_outputs.nb_badpix[idet]=</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>             (int)cpl_image_get_flux(bpmflat);</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>         cpl_msg_indent_less() ;</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">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) cpl_vector_delete(medians[k]) ;</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     <span class="keywordflow">for</span> (k=0 ; k<HAWKI_NB_DETECTORS ; k++) cpl_vector_delete(stdevs[k]) ;</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>     cpl_msg_indent_less() ;</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">return</span> results ;</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="l01059"></a><span class="lineno"> 1059</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_clean_outliers(</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>         cpl_image           *   error,</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         cpl_imagelist       *   fit_res,</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>         cpl_imagelist       *   raw,</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>         cpl_vector          *   medians,</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>         cpl_image           **  recomp_mask)</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>     cpl_mask        *   recompute ;</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>     cpl_binary      *   precompute ;</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>     <span class="keywordtype">double</span>              med, stdev, threshold1, threshold2 ;</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>     <span class="keywordtype">int</span>                 nx, ny, pos, nbad, nima, out, ind, pix ;</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>     cpl_image       *   cur_ima ;</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>     <span class="keywordtype">float</span>           *   pimaf ;</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>     <span class="keywordtype">double</span>              val, fit_val, a, b, max ;</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     cpl_vector      *   z_pix ;</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>     <span class="keywordtype">double</span>          *   pz_pix ;</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>     cpl_image       *   onepix ;</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     cpl_vector      *   med_purged ;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     cpl_imagelist   *   raw_purged ;</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>     cpl_imagelist   *   fit_one ;</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     cpl_image       *   err_one ;</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>     <span class="keywordtype">int</span>                 i, j, k ;</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="comment">/* Check entries */</span></div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>     <span class="keywordflow">if</span> (error == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>     <span class="keywordflow">if</span> (fit_res == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>     <span class="keywordflow">if</span> (raw == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>     <span class="keywordflow">if</span> (recomp_mask) *recomp_mask = 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>     <span class="comment">/* Identify the places to recompute */</span></div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>     med = cpl_image_get_median_dev(error, &stdev) ;</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>     threshold1 = med - hawki_cal_flat_config.sigma_badres * stdev ;</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     threshold2 = med + hawki_cal_flat_config.sigma_badres * stdev ;</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     recompute = cpl_mask_threshold_image_create(error,threshold1,threshold2) ;</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>     cpl_mask_not(recompute) ;</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> ((nbad=cpl_mask_count(recompute)) == 0) {</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>         <span class="keywordflow">if</span> (recomp_mask)    </div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>             *recomp_mask = cpl_image_new_from_mask(recompute) ;</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>         cpl_mask_delete(recompute) ;</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>         <span class="keywordflow">return</span> 0 ;</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>     nx = cpl_image_get_size_x(error) ;</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>     ny = cpl_image_get_size_y(error) ;</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>     nima = cpl_imagelist_get_size(raw) ;</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="comment">/* Get access to the mask */</span></div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>     precompute = cpl_mask_get_data(recompute) ;</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>     <span class="keywordflow">for</span> (j=0 ; j<ny ; j++) {</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>         <span class="keywordflow">for</span> (i=0 ; i<nx ; i++) {</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>             pos = i + j*nx ;</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             <span class="comment">/* The pixel has to be recomputed */</span></div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>             <span class="keywordflow">if</span> (precompute[pos] == CPL_BINARY_1) {</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                 <span class="comment">/* Get the pix_val-fit in a vector */</span></div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                 z_pix = cpl_vector_new(nima) ;</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>                     cur_ima = cpl_imagelist_get(fit_res, 0) ;</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                     pimaf = cpl_image_get_data_float(cur_ima) ;</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>                     a = pimaf[pos] ;</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>                     cur_ima = cpl_imagelist_get(fit_res, 1) ;</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>                     pimaf = cpl_image_get_data_float(cur_ima) ;</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>                     b = pimaf[pos] ;</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>                     med = cpl_vector_get(medians, k) ;</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>                     fit_val = a + b * med ;</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>                     cur_ima = cpl_imagelist_get(raw, k) ;</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>                     pimaf = cpl_image_get_data_float(cur_ima) ;</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>                     cpl_vector_set(z_pix, k, (<span class="keywordtype">double</span>)(pimaf[pos]-fit_val)) ;</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="comment">/* Identify the outlier */</span></div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                 out = -1 ;</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>                 max = -1.0 ;</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>                 pz_pix = cpl_vector_get_data(z_pix) ;</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>                     <span class="keywordflow">if</span> (fabs(pz_pix[k]) > max) {</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>                         max = fabs(pz_pix[k]) ;</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                         out = k ;</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>                 cpl_vector_delete(z_pix) ;</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">/* Create 1-pixel purged image list and the purged medians */</span></div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>                 med_purged = cpl_vector_new(nima-1) ;</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>                 raw_purged = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>                 ind = 0 ;</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>                 <span class="keywordflow">for</span> (k=0 ; k<nima ; k++) {</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>                     <span class="keywordflow">if</span> (k != out) {</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>                         <span class="comment">/* Fill raw_purged */</span></div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>                         cur_ima = cpl_imagelist_get(raw, k) ;</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>                         onepix=cpl_image_extract(cur_ima, i+1, j+1, i+1, j+1) ;</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>                         cpl_imagelist_set(raw_purged, onepix, ind) ;</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>                         <span class="comment">/* Fill med_purged */</span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>                         cpl_vector_set(med_purged, ind,</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>                                 cpl_vector_get(medians, k)) ;</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>                         ind ++;</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>                 }</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>                 <span class="comment">/* Perform the fit */</span></div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>                 err_one = cpl_image_duplicate(cpl_imagelist_get(raw_purged,0));</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>                 fit_one = cpl_fit_imagelist_polynomial(med_purged, raw_purged, </div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>                         0, 1, CPL_FALSE, CPL_TYPE_FLOAT, err_one) ;</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>                 <span class="keywordflow">if</span> (fit_one == NULL) {</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>                     cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit in second pass"</span>) ;</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>                     cpl_mask_delete(recompute) ;</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>                     cpl_vector_delete(med_purged) ;</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>                     cpl_imagelist_delete(raw_purged) ;</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>                     cpl_image_delete(err_one) ;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>                     <span class="keywordflow">return</span> -1 ;</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_vector_delete(med_purged) ;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>                 cpl_imagelist_delete(raw_purged) ;</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">/* Write the result in the input */</span></div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>                 val = cpl_image_get(err_one, 1, 1, &pix) ;</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>                 cpl_image_set(error, i+1, j+1, val) ;</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>                 cpl_image_delete(err_one) ;</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>                 cur_ima = cpl_imagelist_get(fit_one, 0) ;</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                 val = cpl_image_get(cur_ima, 1, 1, &pix) ;</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>                 cur_ima = cpl_imagelist_get(fit_res, 0) ;</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                 cpl_image_set(cur_ima, i+1, j+1, val) ;</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>                 cur_ima = cpl_imagelist_get(fit_one, 1) ;</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>                 val = cpl_image_get(cur_ima, 1, 1, &pix) ;</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                 cur_ima = cpl_imagelist_get(fit_res, 1) ;</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>                 cpl_image_set(cur_ima, i+1, j+1, val) ;</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>                 cpl_imagelist_delete(fit_one) ;</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>         }</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> (recomp_mask)    </div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>         *recomp_mask = cpl_image_new_from_mask(recompute) ;</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>     cpl_mask_delete(recompute) ;</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="comment">/* Return  */</span></div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_save</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span> (cpl_imagelist     ** flat,</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>  cpl_table         ** raw_flat_stats,</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>  cpl_table         ** raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>  cpl_table         ** raw_flat_even_column_stats,</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>  cpl_table         ** raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>  cpl_table         ** raw_flat_even_row_stats,</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>  cpl_vector        ** raw_selected,</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>  <span class="keywordtype">int</span>                  set_nb,</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>  <span class="keyword">const</span> cpl_frame   *  bpmdark,</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>  cpl_frameset      *  flat_frames,</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>  cpl_frameset      *  calib_frames,</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>  cpl_parameterlist *  parlist,</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>  cpl_frameset      *  set_tot)</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>     cpl_propertylist    **  qclists ;</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>     cpl_imagelist       *   bpm ;</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>     <span class="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     cpl_frameset        *   used_frames;</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     <span class="keywordtype">char</span>                *   filename ;</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_flat"</span> ;</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>     <span class="keywordtype">int</span>                     i ;</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     <span class="keywordtype">int</span>                     iflat;</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>     <span class="keywordtype">int</span>                     nflat;</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     <span class="keywordtype">int</span>                     nused;</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>     <span class="keywordtype">char</span>                    key_name[72];</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>     <span class="comment">/* Get the reference frame */</span></div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>     ref_frame = irplib_frameset_get_first_from_group(flat_frames, CPL_FRAME_GROUP_RAW) ;</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="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         qclists[i] = cpl_propertylist_new() ;</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">/* Add the raw flat selection keywords */</span></div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>         nflat = cpl_vector_get_size(raw_selected[i]);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>         nused = 0;</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>         <span class="keywordflow">for</span>(iflat = 0; iflat < nflat; ++iflat)</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>             snprintf(key_name, 72, <span class="stringliteral">"ESO QC RAW%02d USED"</span>, iflat + 1);</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>             cpl_propertylist_append_bool</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>                 (qclists[i], key_name, </div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>                 (cpl_vector_get(raw_selected[i], iflat) + 1) / 2);</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>             cpl_table_set_int</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>                 (raw_flat_stats[i],HAWKI_COL_STAT_USED, iflat,</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>                  cpl_vector_get(raw_selected[i], iflat));</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>             <span class="keywordflow">if</span>(hawki_cal_flat_config.extra_stats)</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>             {</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>                 cpl_table_set_int</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>                     (raw_flat_odd_column_stats[i],HAWKI_COL_STAT_USED, iflat,</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>                      cpl_vector_get(raw_selected[i], iflat));</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>                 cpl_table_set_int</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>                     (raw_flat_even_column_stats[i],HAWKI_COL_STAT_USED, iflat,</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>                      cpl_vector_get(raw_selected[i], iflat));</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>                 cpl_table_set_int</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>                     (raw_flat_odd_row_stats[i],HAWKI_COL_STAT_USED, iflat,</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                      cpl_vector_get(raw_selected[i], iflat));</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>                 cpl_table_set_int</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                     (raw_flat_even_row_stats[i],HAWKI_COL_STAT_USED, iflat,</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>                      cpl_vector_get(raw_selected[i], iflat));</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>(cpl_vector_get(raw_selected[i], iflat) == 1)</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>                 nused++;</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="comment">/* Add the master flat statistics keywords */</span></div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC FLAT NBADPIX"</span>,</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>                                     hawki_cal_flat_outputs.nb_badpix[i]);</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT NORM"</span>,</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>                                        hawki_cal_flat_outputs.norm[i]) ;</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMEAN"</span>,</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>                                        hawki_cal_flat_outputs.med_avg[i]) ;</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMED"</span>,</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                                        hawki_cal_flat_outputs.med_med[i]) ;</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDSTDEV"</span>,</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>                                        hawki_cal_flat_outputs.med_stdev[i]) ;</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMIN"</span>,</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>                                        hawki_cal_flat_outputs.med_min[i]) ;</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDMAX"</span>,</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>                                        hawki_cal_flat_outputs.med_max[i]) ;</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDRANG"</span>,</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>                                        hawki_cal_flat_outputs.med_max[i] -</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>                                        hawki_cal_flat_outputs.med_min[i]);</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC FLAT MEDNRANG"</span>,</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>                                        (hawki_cal_flat_outputs.med_max[i] -</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>                                         hawki_cal_flat_outputs.med_min[i]) /</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>                                         hawki_cal_flat_outputs.med_med[i]);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>         cpl_propertylist_append_int(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>                                     nused) ;</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">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>         ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>                 cpl_frame_get_filename(ref_frame), i+1);</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>         cpl_propertylist_append(qclists[i], inputlist) ;</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>         <span class="comment">/* Cleaning */</span></div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>         cpl_propertylist_delete(inputlist) ;</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">/* Statistics of the raw images in the QC */</span></div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_flat_stats, qclists);</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="comment">/* Get the used frames */</span></div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     used_frames = cpl_frameset_duplicate(flat_frames);</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>     <span class="keywordflow">for</span>(i = 0; i< cpl_frameset_get_size(calib_frames); ++i)</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>         cpl_frameset_insert(used_frames, </div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>                 cpl_frame_duplicate(cpl_frameset_get_frame(calib_frames, i)));</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="comment">/* Write the flat image */</span></div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>                          parlist,</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>                          used_frames,</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>                          flat[0],</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>                          recipe_name,</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>                          HAWKI_CALPRO_FLAT,</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>                          HAWKI_PROTYPE_FLAT, </div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>                          NULL,</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                          (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                          filename) ;</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>     cpl_free(filename) ;</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>     <span class="comment">/* Write the error map */</span></div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_err_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>                          parlist,</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>                          used_frames,</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>                          flat[1],</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>                          recipe_name,</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>                          HAWKI_CALPRO_FLAT_ERRMAP,</div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>                          HAWKI_PROTYPE_ERRMAP, </div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>                          NULL,</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                          (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                          filename) ;</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>     cpl_free(filename) ;</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="comment">/* Write the Cold pixels map */</span></div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_bpmflat_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>                          parlist,</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>                          used_frames,</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>                          flat[2],</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>                          recipe_name,</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>                          HAWKI_CALPRO_BPM_COLD,</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>                          HAWKI_PROTYPE_BPM,</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>                          NULL,</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>                          (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>                          filename) ;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     cpl_free(filename) ;</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> (flat[3] != NULL) {</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         <span class="comment">/* Write the recomputed map */</span></div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         filename=cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_recomputed_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>         <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>                              parlist,</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                              used_frames,</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>                              flat[3],</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>                              recipe_name,</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>                              HAWKI_CALPRO_FLAT_RECOMPUTED,</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>                              HAWKI_PROTYPE_FLAT,</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>                              NULL,</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>                              (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>                              filename) ;</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         cpl_free(filename) ;</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="comment">/* If the HOT pixel map is passed, merge with the COLD one */</span></div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>     <span class="keywordflow">if</span> (bpmdark != NULL) {</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>         <span class="keywordflow">if</span> ((bpm = hawki_cal_flat_merge_bpms(bpmdark, flat[2])) == NULL) {</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot merge bad pixel maps"</span>) ;</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>             filename=cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_bpm_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>             <span class="comment">/* Get the used frames for statistics */</span></div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>             <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(set_tot,</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                                  parlist,</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>                                  used_frames,</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>                                  bpm,</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>                                  recipe_name,</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>                                  HAWKI_CALPRO_BPM,</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                                  HAWKI_PROTYPE_BPM,</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                                  NULL,</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>                                  (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>                                  filename) ;</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>             cpl_free(filename) ;</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>             cpl_imagelist_delete(bpm) ;</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>     cpl_frameset_delete(used_frames);</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="comment">/* Get the used frames for statistics */</span></div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>     used_frames = cpl_frameset_duplicate(flat_frames);</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="comment">/* Write the table with the statistics */</span></div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>     filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_set%02d.fits"</span>, set_nb) ;</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>                       parlist,</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                       used_frames,</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>                       (<span class="keyword">const</span> cpl_table **)raw_flat_stats,</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>                       recipe_name,</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>                       HAWKI_CALPRO_FLAT_STATS,</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                       HAWKI_PROTYPE_FLAT_STATS,</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                       NULL,</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>                       (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>                       filename) ;</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>     cpl_free(filename) ;</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>(hawki_cal_flat_config.extra_stats)</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>         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_ec_set%02d.fits"</span>, set_nb);</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>                           parlist,</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>                           used_frames,</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>                           (<span class="keyword">const</span> cpl_table **)raw_flat_even_column_stats,</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>                           recipe_name,</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>                           HAWKI_CALPRO_FLAT_STATS_EVEN_COL,</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>                           HAWKI_PROTYPE_FLAT_STATS_EVEN_COL,</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>                           NULL,</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>                           (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>                           filename) ;</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>         cpl_free(filename) ;</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_oc_set%02d.fits"</span>, set_nb);</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                           parlist,</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>                           used_frames,</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                           (<span class="keyword">const</span> cpl_table **)raw_flat_odd_column_stats,</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                           recipe_name,</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>                           HAWKI_CALPRO_FLAT_STATS_ODD_COL,</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>                           HAWKI_PROTYPE_FLAT_STATS_ODD_COL,</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                           NULL,</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                           (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                           filename) ;</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>         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_er_set%02d.fits"</span>, set_nb);</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>                           parlist,</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>                           used_frames,</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>                           (<span class="keyword">const</span> cpl_table **)raw_flat_even_row_stats,</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>                           recipe_name,</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>                           HAWKI_CALPRO_FLAT_STATS_EVEN_ROW,</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>                           HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW,</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                           NULL,</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>                           (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                           filename) ;</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>         cpl_free(filename) ;</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>         filename = cpl_sprintf(<span class="stringliteral">"hawki_cal_flat_stats_or_set%02d.fits"</span>, set_nb);</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(set_tot,</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                           parlist,</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>                           used_frames,</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>                           (<span class="keyword">const</span> cpl_table **)raw_flat_odd_row_stats,</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>                           recipe_name,</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>                           HAWKI_CALPRO_FLAT_STATS_ODD_ROW,</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>                           HAWKI_PROTYPE_FLAT_STATS_ODD_ROW,</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>                           NULL,</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>                           (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>                           filename) ;</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>         cpl_free(filename) ;</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>     cpl_frameset_delete(used_frames);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>         cpl_propertylist_delete(qclists[i]) ;</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>     cpl_free(qclists) ;</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>     <span class="keywordflow">return</span>  0;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_compare(</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>         <span class="keyword">const</span> cpl_frame *   frame1,</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>         <span class="keyword">const</span> cpl_frame *   frame2)</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="keywordtype">int</span>                     comparison ;</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>     cpl_propertylist    *   plist1 ;</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>     cpl_propertylist    *   plist2 ;</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval1,</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>                         *   sval2 ;</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>     <span class="keywordtype">double</span>                  dval1, dval2 ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>     <span class="keywordflow">if</span> (frame1==NULL || frame2==NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Get property lists */</span></div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>     <span class="keywordflow">if</span> ((plist1=cpl_propertylist_load(cpl_frame_get_filename(frame1),</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>                     0)) == NULL) {</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>         cpl_msg_error(__func__, <span class="stringliteral">"getting header from reference frame"</span>);</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>         <span class="keywordflow">return</span> -1 ;</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> ((plist2=cpl_propertylist_load(cpl_frame_get_filename(frame2),</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>                     0)) == NULL) {</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>         cpl_msg_error(__func__, <span class="stringliteral">"getting header from reference frame"</span>);</div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>         cpl_propertylist_delete(plist1) ;</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Test status */</span></div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>         cpl_propertylist_delete(plist1) ;</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>         cpl_propertylist_delete(plist2) ;</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>         <span class="keywordflow">return</span> -1 ;</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> </div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     comparison = 1 ;</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">/* Compare filters */</span></div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>     sval1 = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist1) ;</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     sval2 = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist2) ;</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>         cpl_msg_error(__func__, <span class="stringliteral">"cannot get the filter"</span>);</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>         cpl_propertylist_delete(plist1) ;</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>         cpl_propertylist_delete(plist2) ;</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="keywordflow">if</span> (strcmp(sval1, sval2)) comparison = 0 ;</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">/* Compare DITs */</span></div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>     dval1 = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist1) ;</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>     dval2 = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist2) ;</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>         cpl_msg_error(__func__, <span class="stringliteral">"cannot get the DIT"</span>);</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>         cpl_propertylist_delete(plist1) ;</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>         cpl_propertylist_delete(plist2) ;</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>         <span class="keywordflow">return</span> -1 ;</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="keywordflow">if</span> (fabs(dval1-dval2) > 1e-4) comparison = 0 ;</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>     cpl_propertylist_delete(plist1) ;</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>     cpl_propertylist_delete(plist2) ;</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>     <span class="keywordflow">return</span> comparison ;</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> </div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_imagelist * hawki_cal_flat_merge_bpms</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span> (<span class="keyword">const</span> cpl_frame *   bpm_orig,</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>  cpl_imagelist   *   bpm_to_merge)</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>     cpl_imagelist   *   merged ;</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>     cpl_imagelist   *   bpm_orig_im;</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>     cpl_image       *   tmp ;</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>     <span class="keywordtype">int</span>                 i ;</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span> </div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>     <span class="keywordflow">if</span> (bpm_orig==NULL || bpm_to_merge ==NULL) <span class="keywordflow">return</span> NULL ;</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">/* Create merged */</span></div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     merged = cpl_imagelist_new() ;</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="comment">/* Load the bpm_file */</span></div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>     bpm_orig_im = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm_orig, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>     <span class="keywordflow">if</span>(bpm_orig_im == NULL)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot read existing bpm %s"</span>,</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>                       cpl_frame_get_filename(bpm_orig));</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>         cpl_imagelist_delete(merged);</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>         <span class="keywordflow">return</span> NULL;</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>     <span class="comment">/* Loop on the chips */</span></div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</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="comment">/* Merge */</span></div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>         tmp = cpl_image_add_create(cpl_imagelist_get(bpm_orig_im, i),</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>                                    cpl_imagelist_get(bpm_to_merge, i));</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>         cpl_image_multiply(cpl_imagelist_get(bpm_orig_im, i),</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                            cpl_imagelist_get(bpm_to_merge, i));</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>         cpl_image_subtract(tmp, cpl_imagelist_get(bpm_orig_im, i)) ;</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="comment">/* Store */</span></div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>         cpl_imagelist_set(merged, tmp, i) ;</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="comment">/* Clean-up and return */</span></div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>     cpl_imagelist_delete(bpm_orig_im);</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>     <span class="keywordflow">return</span> merged ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_select</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> (cpl_vector  *   meds,</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>  cpl_vector  *   rms,</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>  <span class="keywordtype">int</span>             auto_flag,</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>  <span class="keywordtype">int</span>             auto_max_bins,</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>  <span class="keywordtype">double</span>          min_level,</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>  <span class="keywordtype">double</span>          max_level,</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>  <span class="keywordtype">double</span>          max_rms,</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>  <span class="keywordtype">int</span>             min_nframes,</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>  cpl_vector  *   selection)</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="keywordtype">double</span>      *   pselection ;</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>     <span class="keywordtype">double</span>      *   pmeds ;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>     <span class="keywordtype">double</span>      *   prms ;</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>     <span class="keywordtype">int</span>             nvals ;</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>     <span class="keywordtype">int</span>             nsel ;</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>     <span class="keywordtype">double</span>          first_val, last_val, bin_val, dist, dist_min;</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>     <span class="keywordtype">double</span>          bin_low_val;</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>     <span class="keywordtype">double</span>          bin_up_val;</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>     <span class="keywordtype">int</span>             nbins, ind_closest ;</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>     <span class="keywordtype">int</span>             ibin;</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>     <span class="keywordtype">int</span>             ival;</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>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>     <span class="keywordflow">if</span> (meds == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>     <span class="keywordflow">if</span> (rms == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>     <span class="keywordflow">if</span> (selection == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>     <span class="keywordflow">if</span>(cpl_vector_get_size(meds) != cpl_vector_get_size(selection))</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>         cpl_msg_error(__func__, </div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                       <span class="stringliteral">"The meds and selection vectors have not the same size"</span>);</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>         <span class="keywordflow">return</span> -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> </div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>     <span class="comment">/* Initialise. All the frames are selected by default */</span></div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>     nvals = cpl_vector_get_size(meds);</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>     pmeds = cpl_vector_get_data(meds);</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>     prms = cpl_vector_get_data(rms);</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>     cpl_vector_fill(selection, 1.0);  </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>     <span class="comment">/* Pointer to selection */</span></div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>     pselection = cpl_vector_get_data(selection) ;</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="comment">/* First select based on minimum level, if applies */</span></div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>     <span class="keywordflow">if</span> (min_level >= 0.0)</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">for</span> (ival=0 ; ival<nvals ; ival++) </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="keywordflow">if</span> (pmeds[ival] < min_level)</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>                 pselection[ival] = -1.0 ;</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>     }</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="comment">/* Second select based on maximum level, if applies */</span></div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>     <span class="keywordflow">if</span> (max_level >= 0.0)</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="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) </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">if</span> (pmeds[ival] > max_level)</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>                 pselection[ival] = -1.0 ;</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> </div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>     <span class="comment">/* Third select based on rms maximum level, if applies */</span></div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>     <span class="keywordflow">if</span> (max_rms >= 0.0)</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>         <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) </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">if</span> (prms[ival] > max_rms)</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>                 pselection[ival] = -1.0 ;</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>     }</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">/* Apply the histogram selection */</span></div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>     <span class="keywordflow">if</span> (auto_flag)</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="comment">/* Automatic  */</span></div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>         cpl_vector * auto_selection;</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>         auto_selection = cpl_vector_new(nvals);</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>         cpl_vector_fill(auto_selection, -1.0);</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>         cpl_msg_info(__func__, <span class="stringliteral">"Automatic dynamic range selection"</span>);</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>         first_val = <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a>(meds, selection);</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>         last_val = <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a>(meds, selection);</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>         nbins = nvals ;</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>         <span class="keywordflow">if</span> (auto_max_bins > 0 && auto_max_bins < nvals) nbins = auto_max_bins;</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>         <span class="keywordflow">for</span> (ibin=0 ; ibin<nbins ; ibin++) </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>(ibin == 0)</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>                 bin_val = first_val + (last_val-first_val)*(ibin+1)/nbins ;</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span>(ibin == nbins - 1)</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>                 bin_val = first_val + (last_val-first_val)*(ibin)/nbins ;</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>                 bin_val = first_val + (last_val-first_val)*(ibin+0.5)/nbins ;</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>             bin_low_val = first_val + (last_val-first_val)*(ibin)/nbins ;</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>             bin_up_val  = first_val + (last_val-first_val)*(ibin+1)/nbins ;</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>             <span class="comment">/* Select the closest */</span></div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>             dist_min = fabs(pmeds[0] - bin_val) ;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>             ind_closest = -1;</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>             <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) </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>                 dist = fabs(pmeds[ival] - bin_val) ;</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>                 <span class="keywordflow">if</span> (dist < dist_min && pselection[ival] != -1) </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>                     dist_min = dist;</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>                     ind_closest = ival;</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>             <span class="keywordflow">if</span>(ind_closest != -1)</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>                 cpl_vector_set(auto_selection, ind_closest, 1.0);</div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>         }</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>         <span class="comment">/* Use the auto_selection */</span></div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>         cpl_vector_copy(selection, auto_selection);</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>         cpl_vector_delete(auto_selection);</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>     </div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>     <span class="comment">/* Print and count the selected frames */</span></div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>     nsel = 0;</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>     <span class="keywordflow">for</span> (ival=0 ; ival<nvals ; ival++) </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>(pselection[ival] != -1)</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>             cpl_msg_info(__func__, <span class="stringliteral">"Selected frame %d"</span>, ival+1) ;</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>             nsel++;</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>     }</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>     cpl_msg_indent_less();</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="comment">/* Check the number of selected against min_nframes */</span></div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>     <span class="keywordflow">if</span> (nsel == 0) {</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>         cpl_msg_error(__func__, <span class="stringliteral">"No frame selected. Check selection criteria"</span>);</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>         <span class="keywordflow">return</span> -1;</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> (min_nframes >= 0) {</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>         <span class="keywordflow">if</span> (nsel < min_nframes) {</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>             cpl_msg_error(__func__, <span class="stringliteral">"Not enough selected frames (%d < %d)"</span>,</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>                 nsel, min_nframes) ;</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>             <span class="keywordflow">return</span> -1;</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>     }</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>     <span class="keywordflow">return</span> 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>  </div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_vector * hawki_cal_flat_extract_vector(</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>         cpl_vector  *   in,</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>         cpl_vector  *   selection)</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>     <span class="keywordtype">int</span>             nvals ;</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>     cpl_vector  *   selected ;</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>     <span class="keywordtype">double</span>      *   pin ;</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>     <span class="keywordtype">double</span>      *   pselection ;</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>     <span class="keywordtype">double</span>      *   pselected ;</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>     <span class="keywordtype">int</span>             nselected ;</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>     <span class="keywordtype">int</span>             i ;</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>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>     <span class="keywordflow">if</span> (selection == NULL) <span class="keywordflow">return</span> 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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>     nvals = cpl_vector_get_size(in) ;</div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>     nselected = 0 ;</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>     pin = cpl_vector_get_data(in) ;</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>     pselection = cpl_vector_get_data(selection) ;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>     <span class="keywordflow">if</span> (nvals != cpl_vector_get_size(selection)) <span class="keywordflow">return</span> 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>     <span class="comment">/* Count the selected values */</span></div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>     <span class="keywordflow">for</span> (i=0 ; i<nvals ; i++) {</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>         <span class="keywordflow">if</span> (pselection[i] > 0.0) nselected++ ;</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="keywordflow">if</span> (nselected == 0) <span class="keywordflow">return</span> NULL ;</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="comment">/* Create the selected vector */</span></div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>     selected = cpl_vector_new(nselected) ;</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>     pselected = cpl_vector_get_data(selected) ;</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>     nselected = 0 ;</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>     <span class="keywordflow">for</span> (i=0 ; i<nvals ; i++) {</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>         <span class="keywordflow">if</span> (pselection[i] > 0.0) {</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>             pselected[nselected] = pin[i] ;</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>             nselected++ ;</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>     } </div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>     <span class="keywordflow">return</span> selected ;</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_flat_retrieve_input_param</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span> (cpl_parameterlist  *  parlist)</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="keyword">const</span> <span class="keywordtype">char</span>      * sval;</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>     cpl_parameter   * par;</div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>     <span class="keywordtype">int</span>               idet;</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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>     par = NULL ;</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>         hawki_cal_flat_outputs.nb_badpix[idet] = -1 ;</div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>         hawki_cal_flat_outputs.med_stdev[idet] = -1.0 ;</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>         hawki_cal_flat_outputs.med_avg[idet] = -1.0 ;</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>         hawki_cal_flat_outputs.med_med[idet] = -1.0 ;</div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>         hawki_cal_flat_outputs.med_min[idet] = -1.0 ;</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>         hawki_cal_flat_outputs.med_max[idet] = -1.0 ;</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> </div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>     <span class="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.zone"</span>) ;</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>     sval = cpl_parameter_get_string(par) ;</div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,</div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>                     &hawki_cal_flat_config.llx,</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>                     &hawki_cal_flat_config.lly,</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>                     &hawki_cal_flat_config.urx,</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>                     &hawki_cal_flat_config.ury)!=4) </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>         <span class="keywordflow">return</span> -1 ;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.sigma_badres"</span>) ;</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     hawki_cal_flat_config.sigma_badres = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.sigma_bpm"</span>) ;</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     hawki_cal_flat_config.sigma_bpm = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.lowval_bpm"</span>) ;</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     hawki_cal_flat_config.lowval_bpm = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.highval_bpm"</span>) ;</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>     hawki_cal_flat_config.highval_bpm = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.normalise"</span>) ;</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     hawki_cal_flat_config.normalise = cpl_parameter_get_bool(par) ;</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.second_pass"</span>) ;</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     hawki_cal_flat_config.second_pass = cpl_parameter_get_bool(par) ;</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.select_auto"</span>) ;</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     hawki_cal_flat_config.select_auto = cpl_parameter_get_bool(par) ;</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>             <span class="stringliteral">"hawki.hawki_cal_flat.select_auto_max_bins"</span>) ;</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     hawki_cal_flat_config.select_auto_max_bins = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>             <span class="stringliteral">"hawki.hawki_cal_flat.select_min_level"</span>) ;</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>                &hawki_cal_flat_config.select_min_level[0],</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>                &hawki_cal_flat_config.select_min_level[1],</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>                &hawki_cal_flat_config.select_min_level[2],</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>                &hawki_cal_flat_config.select_min_level[3])!=4)</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="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_min_level[0])!=1)</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">return</span> -1;</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>         <span class="keywordflow">else</span></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>             hawki_cal_flat_config.select_min_level[1] = </div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>                 hawki_cal_flat_config.select_min_level[0];</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>             hawki_cal_flat_config.select_min_level[2] = </div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>                 hawki_cal_flat_config.select_min_level[0];</div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>             hawki_cal_flat_config.select_min_level[3] = </div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>                 hawki_cal_flat_config.select_min_level[0];</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>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>             <span class="stringliteral">"hawki.hawki_cal_flat.select_max_level"</span>) ;</div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>                &hawki_cal_flat_config.select_max_level[0],</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>                &hawki_cal_flat_config.select_max_level[1],</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>                &hawki_cal_flat_config.select_max_level[2],</div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>                &hawki_cal_flat_config.select_max_level[3])!=4)</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> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_max_level[0])!=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>             <span class="keywordflow">return</span> -1;</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">else</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>             hawki_cal_flat_config.select_max_level[1] = </div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>                 hawki_cal_flat_config.select_max_level[0];</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>             hawki_cal_flat_config.select_max_level[2] = </div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>                 hawki_cal_flat_config.select_max_level[0];</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>             hawki_cal_flat_config.select_max_level[3] = </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>                 hawki_cal_flat_config.select_max_level[0];</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>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>             <span class="stringliteral">"hawki.hawki_cal_flat.select_max_rms"</span>) ;</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>                hawki_cal_flat_config.select_max_rms,</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>                hawki_cal_flat_config.select_max_rms+1,</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                hawki_cal_flat_config.select_max_rms+2,</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>                hawki_cal_flat_config.select_max_rms+3)!=4)</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>         <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%f"</span>, &hawki_cal_flat_config.select_max_rms[0])!=1)</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">return</span> -1;</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">else</span></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>             hawki_cal_flat_config.select_max_rms[1] = </div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                 hawki_cal_flat_config.select_max_rms[0];</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>             hawki_cal_flat_config.select_max_rms[2] = </div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>                 hawki_cal_flat_config.select_max_rms[0];</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>             hawki_cal_flat_config.select_max_rms[3] = </div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>                 hawki_cal_flat_config.select_max_rms[0];</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>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>             <span class="stringliteral">"hawki.hawki_cal_flat.select_min_nframes"</span>) ;</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>     hawki_cal_flat_config.select_min_nframes = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_flat.extra_stats"</span>) ;</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>     hawki_cal_flat_config.extra_stats = cpl_parameter_get_bool(par) ;</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>     <span class="keywordflow">if</span>(hawki_cal_flat_config.select_auto_max_bins != -1 &&</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>             !hawki_cal_flat_config.select_auto)</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>             cpl_msg_error(__func__,<span class="stringliteral">"Max bins is only allowed with select_auto"</span>);</div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>             <span class="keywordflow">return</span> -1;</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>         </div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</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/hawki__cal__illum_8c_source.html b/html/hawki__cal__illum_8c_source.html
index f1d2eb3..e60511b 100644
--- a/html/hawki__cal__illum_8c_source.html
+++ b/html/hawki__cal__illum_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_illum.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,805 +40,806 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_illum.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_illum.c,v 1.8 2010/06/04 09:45: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/06/04 09:45:43 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_strehl.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00048"></a>00048 
-<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> <span class="keywordtype">int</span> hawki_cal_illum_create(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_exec(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_destroy(cpl_plugin *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_save(<span class="keyword">const</span> cpl_image **, <span class="keyword">const</span> cpl_table **, 
-<a name="l00058"></a>00058         cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00059"></a>00059 <span class="keyword">static</span> cpl_image * hawki_cal_illum_compute(cpl_frameset *, <span class="keywordtype">int</span>, 
-<a name="l00060"></a>00060         <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, cpl_table **) ;
-<a name="l00061"></a>00061 <span class="keyword">static</span> cpl_vector * hawki_cal_illum_phot(cpl_imagelist *, cpl_bivector *, 
-<a name="l00062"></a>00062         <span class="keywordtype">int</span> *) ;
-<a name="l00063"></a>00063 <span class="keyword">static</span> cpl_bivector * hawki_cal_illum_find_pos(cpl_imagelist *, 
-<a name="l00064"></a>00064         cpl_bivector *, <span class="keywordtype">int</span>) ;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00067"></a>00067 <span class="comment">                            Static variables</span>
-<a name="l00068"></a>00068 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00071"></a>00071     <span class="comment">/* Inputs */</span>
-<a name="l00072"></a>00072     <span class="keywordtype">int</span>         subtract ;
-<a name="l00073"></a>00073     <span class="keywordtype">int</span>         degree ;
-<a name="l00074"></a>00074     <span class="keywordtype">int</span>         s_hx ;
-<a name="l00075"></a>00075     <span class="keywordtype">int</span>         s_hy ;
-<a name="l00076"></a>00076     <span class="keywordtype">double</span>      star_r ;
-<a name="l00077"></a>00077     <span class="keywordtype">double</span>      bg_r1 ;
-<a name="l00078"></a>00078     <span class="keywordtype">double</span>      bg_r2 ;
-<a name="l00079"></a>00079 } hawki_cal_illum_config ;
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_illum_description[] =
-<a name="l00082"></a>00082 <span class="stringliteral">"hawki_cal_illum -- Illumination recipe\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_ILLUM_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</span> ;
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00089"></a>00089 <span class="comment">                                Functions code</span>
-<a name="l00090"></a>00090 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00101"></a>00101 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00102"></a>00102 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00103"></a>00103 {
-<a name="l00104"></a>00104     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe ) ;
-<a name="l00105"></a>00105     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     cpl_plugin_init(plugin,
-<a name="l00108"></a>00108                     CPL_PLUGIN_API,
-<a name="l00109"></a>00109                     HAWKI_BINARY_VERSION,
-<a name="l00110"></a>00110                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00111"></a>00111                     <span class="stringliteral">"hawki_cal_illum"</span>,
-<a name="l00112"></a>00112                     <span class="stringliteral">"Illumination recipe"</span>,
-<a name="l00113"></a>00113                     hawki_cal_illum_description,
-<a name="l00114"></a>00114                     <span class="stringliteral">"Yves Jung"</span>,
-<a name="l00115"></a>00115                     PACKAGE_BUGREPORT,  
-<a name="l00116"></a>00116                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00117"></a>00117                     hawki_cal_illum_create,
-<a name="l00118"></a>00118                     hawki_cal_illum_exec,
-<a name="l00119"></a>00119                     hawki_cal_illum_destroy) ;
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121     cpl_pluginlist_append(list, plugin) ;
-<a name="l00122"></a>00122     
-<a name="l00123"></a>00123     <span class="keywordflow">return</span> 0;
-<a name="l00124"></a>00124 }
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00134"></a>00134 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_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     <span class="comment">/* Check that the plugin is part of a valid recipe */</span>
-<a name="l00141"></a>00141     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00142"></a>00142         recipe = (cpl_recipe *)plugin ;
-<a name="l00143"></a>00143     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00146"></a>00146     recipe->parameters = cpl_parameterlist_new() ; 
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00149"></a>00149     <span class="comment">/* --subtract */</span>
-<a name="l00150"></a>00150     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.subtract"</span>,
-<a name="l00151"></a>00151             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to subtract the next images"</span>,
-<a name="l00152"></a>00152             <span class="stringliteral">"hawki.hawki_cal_illum"</span>, TRUE) ;
-<a name="l00153"></a>00153     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"subtract"</span>) ;
-<a name="l00154"></a>00154     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00155"></a>00155     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00156"></a>00156     <span class="comment">/* --degree */</span>
-<a name="l00157"></a>00157     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.degree"</span>,
-<a name="l00158"></a>00158             CPL_TYPE_INT, <span class="stringliteral">"Polynomial degree for the fit"</span>,
-<a name="l00159"></a>00159             <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 3) ;
-<a name="l00160"></a>00160     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"degree"</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        <span class="comment">/* --star_r */</span>
-<a name="l00164"></a>00164     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.star_r"</span>, CPL_TYPE_DOUBLE,
-<a name="l00165"></a>00165             <span class="stringliteral">"the star radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;
-<a name="l00166"></a>00166     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"star_r"</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     <span class="comment">/* --bg_r1 */</span>
-<a name="l00170"></a>00170     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.bg_r1"</span>, CPL_TYPE_DOUBLE,
-<a name="l00171"></a>00171             <span class="stringliteral">"the internal background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;
-<a name="l00172"></a>00172     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r1"</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     <span class="comment">/* --bg_r2 */</span>
-<a name="l00176"></a>00176     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.bg_r2"</span>, CPL_TYPE_DOUBLE,
-<a name="l00177"></a>00177             <span class="stringliteral">"the external background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;
-<a name="l00178"></a>00178     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r2"</span>) ;
-<a name="l00179"></a>00179     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00180"></a>00180     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00181"></a>00181     <span class="comment">/* --s_hx */</span>
-<a name="l00182"></a>00182     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.s_hx"</span>, CPL_TYPE_INT,
-<a name="l00183"></a>00183             <span class="stringliteral">"Half size of the seach box in x"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 50) ;
-<a name="l00184"></a>00184     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"s_hx"</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     <span class="comment">/* --s_hy */</span>
-<a name="l00188"></a>00188     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.s_hy"</span>, CPL_TYPE_INT,
-<a name="l00189"></a>00189             <span class="stringliteral">"Half size of the seach box in y"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 50) ;
-<a name="l00190"></a>00190     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"s_hy"</span>) ;
-<a name="l00191"></a>00191     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00192"></a>00192     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00193"></a>00193  
-<a name="l00194"></a>00194     <span class="comment">/* Return */</span>
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> 0;
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00204"></a>00204 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00205"></a>00205 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_exec(cpl_plugin * plugin)
-<a name="l00206"></a>00206 {
-<a name="l00207"></a>00207     cpl_recipe  *   recipe ;
-<a name="l00208"></a>00208     
-<a name="l00209"></a>00209     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00210"></a>00210     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00211"></a>00211         recipe = (cpl_recipe *)plugin ;
-<a name="l00212"></a>00212     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     <span class="comment">/* Issue a banner */</span>
-<a name="l00215"></a>00215     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="keywordflow">return</span> hawki_cal_illum(recipe->parameters, recipe->frames) ;
-<a name="l00218"></a>00218 }
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00226"></a>00226 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00227"></a>00227 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_destroy(cpl_plugin * plugin)
-<a name="l00228"></a>00228 {
-<a name="l00229"></a>00229     cpl_recipe  *   recipe ;
-<a name="l00230"></a>00230     
-<a name="l00231"></a>00231     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00232"></a>00232     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00233"></a>00233         recipe = (cpl_recipe *)plugin ;
-<a name="l00234"></a>00234     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00235"></a>00235 
-<a name="l00236"></a>00236     cpl_parameterlist_delete(recipe->parameters) ; 
-<a name="l00237"></a>00237     <span class="keywordflow">return</span> 0 ;
-<a name="l00238"></a>00238 }
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00247"></a>00247 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00248"></a>00248 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum(
-<a name="l00249"></a>00249         cpl_parameterlist   *   parlist, 
-<a name="l00250"></a>00250         cpl_frameset        *   frameset)
-<a name="l00251"></a>00251 {
-<a name="l00252"></a>00252     cpl_parameter       *   par ;
-<a name="l00253"></a>00253     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   flat ;
-<a name="l00254"></a>00254     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   bpm ;
-<a name="l00255"></a>00255     cpl_frameset        *   rawframes ;
-<a name="l00256"></a>00256     cpl_frameset        *   cur_frames ;
-<a name="l00257"></a>00257     <span class="keywordtype">int</span>                 *   labels ;
-<a name="l00258"></a>00258     cpl_image           *   illum[HAWKI_NB_DETECTORS] ;
-<a name="l00259"></a>00259     cpl_table           *   flux[HAWKI_NB_DETECTORS] ;
-<a name="l00260"></a>00260     <span class="keywordtype">int</span>                     i ;
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     <span class="comment">/* Initialise */</span>
-<a name="l00263"></a>00263     rawframes = NULL ;
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00266"></a>00266     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.subtract"</span>) ;
-<a name="l00267"></a>00267     hawki_cal_illum_config.subtract = cpl_parameter_get_bool(par) ;
-<a name="l00268"></a>00268     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.degree"</span>) ;
-<a name="l00269"></a>00269     hawki_cal_illum_config.degree = cpl_parameter_get_int(par) ;
-<a name="l00270"></a>00270     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.s_hx"</span>) ;
-<a name="l00271"></a>00271     hawki_cal_illum_config.s_hx = cpl_parameter_get_int(par) ;
-<a name="l00272"></a>00272     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.s_hy"</span>) ;
-<a name="l00273"></a>00273     hawki_cal_illum_config.s_hy = cpl_parameter_get_int(par) ;
-<a name="l00274"></a>00274     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.star_r"</span>) ;
-<a name="l00275"></a>00275     hawki_cal_illum_config.star_r = cpl_parameter_get_double(par) ;
-<a name="l00276"></a>00276     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.bg_r1"</span>) ;
-<a name="l00277"></a>00277     hawki_cal_illum_config.bg_r1 = cpl_parameter_get_double(par) ;
-<a name="l00278"></a>00278     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.bg_r2"</span>) ;
-<a name="l00279"></a>00279     hawki_cal_illum_config.bg_r2 = cpl_parameter_get_double(par) ;
-<a name="l00280"></a>00280  
-<a name="l00281"></a>00281     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00282"></a>00282     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00283"></a>00283         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00284"></a>00284         <span class="keywordflow">return</span> -1 ;
-<a name="l00285"></a>00285     }
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="comment">/* Retrieve calibration data */</span>
-<a name="l00288"></a>00288     flat = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(frameset, HAWKI_CALPRO_FLAT) ;
-<a name="l00289"></a>00289     bpm = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(frameset, HAWKI_CALPRO_BPM) ;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00292"></a>00292     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, 
-<a name="l00293"></a>00293                     HAWKI_CAL_ILLUM_RAW)) == NULL) {
-<a name="l00294"></a>00294         cpl_msg_error(__func__, <span class="stringliteral">"No raw frame in input"</span>) ;
-<a name="l00295"></a>00295         <span class="keywordflow">return</span> -1 ;
-<a name="l00296"></a>00296     }
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     <span class="comment">/* Labelise frames */</span>
-<a name="l00299"></a>00299     cpl_msg_info(__func__, <span class="stringliteral">"Labelise the frames"</span>) ;
-<a name="l00300"></a>00300     <span class="keywordflow">if</span> ((labels = <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a>(rawframes)) == NULL) {
-<a name="l00301"></a>00301         cpl_msg_error(__func__, <span class="stringliteral">"Cannot labelise"</span>) ;
-<a name="l00302"></a>00302         cpl_frameset_delete(rawframes) ;
-<a name="l00303"></a>00303         <span class="keywordflow">return</span> -1 ;
-<a name="l00304"></a>00304     }
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     <span class="comment">/* Loop on the chips */</span>
-<a name="l00307"></a>00307     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00308"></a>00308         cpl_msg_info(__func__, <span class="stringliteral">"Reduce chip nb %d"</span>, i+1) ;
-<a name="l00309"></a>00309         
-<a name="l00310"></a>00310         <span class="comment">/* Initialise */</span>
-<a name="l00311"></a>00311         illum[i] = NULL ;
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313         <span class="comment">/* Get the frames for which the star is in chip number i+1 */</span>
-<a name="l00314"></a>00314         <span class="keywordflow">if</span> ((cur_frames = cpl_frameset_extract(rawframes, labels,
-<a name="l00315"></a>00315                         i+1)) == NULL) {
-<a name="l00316"></a>00316             cpl_msg_warning(__func__, <span class="stringliteral">"No frames for chip nb %d"</span>, i+1) ;
-<a name="l00317"></a>00317             <span class="comment">/* Create the flux table */</span>
-<a name="l00318"></a>00318             flux[i] = cpl_table_new(1) ;
-<a name="l00319"></a>00319             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSX, CPL_TYPE_DOUBLE);
-<a name="l00320"></a>00320             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSY, CPL_TYPE_DOUBLE);
-<a name="l00321"></a>00321             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_FLUX, CPL_TYPE_DOUBLE);
-<a name="l00322"></a>00322         } <span class="keywordflow">else</span> {
-<a name="l00323"></a>00323             <span class="comment">/* Create the flux table */</span>
-<a name="l00324"></a>00324             flux[i] = cpl_table_new(cpl_frameset_get_size(cur_frames)) ;
-<a name="l00325"></a>00325             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSX, CPL_TYPE_DOUBLE);
-<a name="l00326"></a>00326             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSY, CPL_TYPE_DOUBLE);
-<a name="l00327"></a>00327             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_FLUX, CPL_TYPE_DOUBLE);
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329             <span class="comment">/* Get the illumination */</span>
-<a name="l00330"></a>00330             <span class="keywordflow">if</span> ((illum[i] = hawki_cal_illum_compute(cur_frames, i+1, 
-<a name="l00331"></a>00331                             bpm, flat, &(flux[i]))) == NULL) {
-<a name="l00332"></a>00332                 cpl_msg_warning(__func__, <span class="stringliteral">"Cannot compute for chip %d"</span>, i+1) ;
-<a name="l00333"></a>00333                 cpl_error_reset() ;
-<a name="l00334"></a>00334             }
-<a name="l00335"></a>00335             cpl_frameset_delete(cur_frames) ;
-<a name="l00336"></a>00336         }
-<a name="l00337"></a>00337     }
-<a name="l00338"></a>00338     cpl_frameset_delete(rawframes) ;
-<a name="l00339"></a>00339     cpl_free(labels) ;
-<a name="l00340"></a>00340     
-<a name="l00341"></a>00341     <span class="comment">/* Save the product */</span>
-<a name="l00342"></a>00342     cpl_msg_info(__func__, <span class="stringliteral">"Save the product"</span>) ;
-<a name="l00343"></a>00343     cpl_msg_indent_more() ;
-<a name="l00344"></a>00344     <span class="keywordflow">if</span> (hawki_cal_illum_save((<span class="keyword">const</span> cpl_image **)illum, 
-<a name="l00345"></a>00345                 (<span class="keyword">const</span> cpl_table **)flux, parlist, frameset)) {
-<a name="l00346"></a>00346         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the product"</span>) ;
-<a name="l00347"></a>00347         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_table_delete(flux[i]) ;
-<a name="l00348"></a>00348         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(illum[i]) ;
-<a name="l00349"></a>00349         cpl_msg_indent_less() ;
-<a name="l00350"></a>00350         <span class="keywordflow">return</span> -1 ;
-<a name="l00351"></a>00351     }
-<a name="l00352"></a>00352     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_table_delete(flux[i]) ;
-<a name="l00353"></a>00353     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(illum[i]) ;
-<a name="l00354"></a>00354     cpl_msg_indent_less() ;
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="comment">/* Return */</span>
-<a name="l00357"></a>00357     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l00358"></a>00358     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00359"></a>00359 }
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00371"></a>00371 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00372"></a>00372 <span class="keyword">static</span> cpl_image * hawki_cal_illum_compute(
-<a name="l00373"></a>00373         cpl_frameset    *   raw,
-<a name="l00374"></a>00374         <span class="keywordtype">int</span>                 chip,
-<a name="l00375"></a>00375         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,
-<a name="l00376"></a>00376         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,
-<a name="l00377"></a>00377         cpl_table       **  fl)
-<a name="l00378"></a>00378 {
-<a name="l00379"></a>00379     cpl_bivector    *   offsets ;
-<a name="l00380"></a>00380     cpl_imagelist   *   in ;
-<a name="l00381"></a>00381     cpl_image       *   ima1 ;
-<a name="l00382"></a>00382     cpl_image       *   ima2 ;
-<a name="l00383"></a>00383     cpl_bivector    *   positions ;
-<a name="l00384"></a>00384     cpl_bivector    *   purged_pos ;
-<a name="l00385"></a>00385     <span class="keywordtype">double</span>          *   positions_x,
-<a name="l00386"></a>00386                     *   positions_y,
-<a name="l00387"></a>00387                     *   purged_pos_x,
-<a name="l00388"></a>00388                     *   purged_pos_y ;
-<a name="l00389"></a>00389     cpl_vector      *   flux ;
-<a name="l00390"></a>00390     cpl_vector      *   purged_flux ;
-<a name="l00391"></a>00391     cpl_polynomial  *   poly ;
-<a name="l00392"></a>00392     cpl_image       *   poly_ima ;
-<a name="l00393"></a>00393     <span class="keywordtype">int</span>                 nval, nx, ny ;
-<a name="l00394"></a>00394     <span class="keywordtype">double</span>              val ;
-<a name="l00395"></a>00395     <span class="keywordtype">int</span>                 ival ;
-<a name="l00396"></a>00396     <span class="keywordtype">int</span>                 i, j ;
-<a name="l00397"></a>00397     
-<a name="l00398"></a>00398     <span class="comment">/* Check entries */</span>
-<a name="l00399"></a>00399     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00400"></a>00400     <span class="keywordflow">if</span> (raw == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00401"></a>00401     <span class="keywordflow">if</span> (fl == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00402"></a>00402          
-<a name="l00403"></a>00403     <span class="comment">/* Get the offsets from the raw frames */</span>
-<a name="l00404"></a>00404     cpl_msg_info(__func__, <span class="stringliteral">"Get the offsets from the files headers"</span>) ;
-<a name="l00405"></a>00405     cpl_msg_indent_more() ;
-<a name="l00406"></a>00406     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(raw)) == NULL) {
-<a name="l00407"></a>00407         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the offsets"</span>) ;
-<a name="l00408"></a>00408         cpl_msg_indent_less() ;
-<a name="l00409"></a>00409         <span class="keywordflow">return</span> NULL ;
-<a name="l00410"></a>00410     }
-<a name="l00411"></a>00411     cpl_msg_indent_less() ;
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     <span class="comment">/* Load the input data */</span>
-<a name="l00414"></a>00414     cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;
-<a name="l00415"></a>00415     cpl_msg_indent_more() ;
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw, chip, CPL_TYPE_FLOAT)) == NULL) {
-<a name="l00417"></a>00417         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load input data"</span>) ;
-<a name="l00418"></a>00418         cpl_bivector_delete(offsets) ;
-<a name="l00419"></a>00419         cpl_msg_indent_less() ;
-<a name="l00420"></a>00420         <span class="keywordflow">return</span> NULL ;
-<a name="l00421"></a>00421     }
-<a name="l00422"></a>00422     cpl_msg_indent_less() ;
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     <span class="comment">/* Apply the calibrations */</span>
-<a name="l00425"></a>00425     <span class="keywordflow">if</span> (flat || bpm) {
-<a name="l00426"></a>00426         cpl_msg_indent_more() ;
-<a name="l00427"></a>00427         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a>(in, flat, bpm) == -1) {
-<a name="l00428"></a>00428             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply calibrations"</span>) ;
-<a name="l00429"></a>00429             cpl_bivector_delete(offsets) ;
-<a name="l00430"></a>00430             cpl_imagelist_delete(in) ;
-<a name="l00431"></a>00431             cpl_msg_indent_less() ;
-<a name="l00432"></a>00432             <span class="keywordflow">return</span> NULL ;
-<a name="l00433"></a>00433         }
-<a name="l00434"></a>00434         cpl_msg_indent_less() ;
-<a name="l00435"></a>00435     }
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     <span class="comment">/* Subtract the consecutive frames */</span>
-<a name="l00438"></a>00438     <span class="keywordflow">if</span> (hawki_cal_illum_config.subtract) {
-<a name="l00439"></a>00439         cpl_msg_info(__func__, <span class="stringliteral">"Subtract the next images"</span>) ;
-<a name="l00440"></a>00440         ima1 = cpl_image_duplicate(cpl_imagelist_get(in, 0)) ;
-<a name="l00441"></a>00441         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(in) ; i++) {
-<a name="l00442"></a>00442             <span class="keywordflow">if</span> (i==cpl_imagelist_get_size(in)-1) {
-<a name="l00443"></a>00443                 ima2 = ima1 ;
-<a name="l00444"></a>00444             } <span class="keywordflow">else</span> {
-<a name="l00445"></a>00445                 ima2 = cpl_imagelist_get(in, i+1) ;
-<a name="l00446"></a>00446             }
-<a name="l00447"></a>00447             cpl_image_subtract(cpl_imagelist_get(in, i), ima2) ;
-<a name="l00448"></a>00448         }
-<a name="l00449"></a>00449         cpl_image_delete(ima1) ;
-<a name="l00450"></a>00450     }
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     <span class="comment">/* Find the positions */</span>
-<a name="l00453"></a>00453     cpl_msg_info(__func__, <span class="stringliteral">"Find the positions"</span>) ;
-<a name="l00454"></a>00454     cpl_msg_indent_more() ;
-<a name="l00455"></a>00455     <span class="keywordflow">if</span> ((positions=hawki_cal_illum_find_pos(in, offsets, chip)) == NULL) {
-<a name="l00456"></a>00456         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the positions"</span>) ;
-<a name="l00457"></a>00457         cpl_imagelist_delete(in) ;
-<a name="l00458"></a>00458         cpl_bivector_delete(offsets) ;
-<a name="l00459"></a>00459         cpl_msg_indent_less() ;
-<a name="l00460"></a>00460         <span class="keywordflow">return</span> NULL ;
-<a name="l00461"></a>00461     }
-<a name="l00462"></a>00462     cpl_bivector_delete(offsets) ;
-<a name="l00463"></a>00463     cpl_msg_indent_less() ;
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     <span class="comment">/* Compute the photometry */</span>
-<a name="l00466"></a>00466     cpl_msg_info(__func__, <span class="stringliteral">"Compute the photometry"</span>) ;
-<a name="l00467"></a>00467     cpl_msg_indent_more() ;
-<a name="l00468"></a>00468     <span class="keywordflow">if</span> ((flux=hawki_cal_illum_phot(in, positions, &nval)) == NULL) {
-<a name="l00469"></a>00469         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the positions"</span>) ;
-<a name="l00470"></a>00470         cpl_imagelist_delete(in) ;
-<a name="l00471"></a>00471         cpl_bivector_delete(positions) ;
-<a name="l00472"></a>00472         cpl_msg_indent_less() ;
-<a name="l00473"></a>00473         <span class="keywordflow">return</span> NULL ;
-<a name="l00474"></a>00474     }
-<a name="l00475"></a>00475     nx = cpl_image_get_size_x(cpl_imagelist_get(in, 0)) ;
-<a name="l00476"></a>00476     ny = cpl_image_get_size_y(cpl_imagelist_get(in, 0)) ;
-<a name="l00477"></a>00477     cpl_imagelist_delete(in) ;
-<a name="l00478"></a>00478     cpl_msg_indent_less() ;
-<a name="l00479"></a>00479     <span class="keywordflow">if</span> (nval < 1) {
-<a name="l00480"></a>00480         cpl_msg_error(__func__, <span class="stringliteral">"No flux computed"</span>) ;
-<a name="l00481"></a>00481         cpl_bivector_delete(positions) ;
-<a name="l00482"></a>00482         cpl_vector_delete(flux) ;
-<a name="l00483"></a>00483         <span class="keywordflow">return</span> NULL ;
-<a name="l00484"></a>00484     }
-<a name="l00485"></a>00485     
-<a name="l00486"></a>00486     <span class="comment">/* Purge positions */</span>
-<a name="l00487"></a>00487     purged_pos = cpl_bivector_new(nval) ;
-<a name="l00488"></a>00488     purged_pos_x = cpl_bivector_get_x_data(purged_pos) ;
-<a name="l00489"></a>00489     purged_pos_y = cpl_bivector_get_y_data(purged_pos) ;
-<a name="l00490"></a>00490     positions_x = cpl_bivector_get_x_data(positions) ;
-<a name="l00491"></a>00491     positions_y = cpl_bivector_get_y_data(positions) ;
-<a name="l00492"></a>00492     purged_flux = cpl_vector_new(nval) ;
-<a name="l00493"></a>00493     j = 0 ;
-<a name="l00494"></a>00494     <span class="keywordflow">for</span> (i=0 ; i<cpl_vector_get_size(flux) ; i++) {
-<a name="l00495"></a>00495         <span class="keywordflow">if</span> (fabs(cpl_vector_get(flux, i)) > 0) {
-<a name="l00496"></a>00496             purged_pos_x[j] = positions_x[i] ;
-<a name="l00497"></a>00497             purged_pos_y[j] = positions_y[i] ;
-<a name="l00498"></a>00498             cpl_vector_set(purged_flux, j, cpl_vector_get(flux, i)) ;
-<a name="l00499"></a>00499             j++ ;
-<a name="l00500"></a>00500         }
-<a name="l00501"></a>00501     }
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503     <span class="comment">/* Fill the flux table */</span>
-<a name="l00504"></a>00504     <span class="keywordflow">for</span> (i=0 ; i<cpl_vector_get_size(flux) ; i++) {
-<a name="l00505"></a>00505         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_POSX, i, positions_x[i]) ;
-<a name="l00506"></a>00506         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_POSY, i, positions_y[i]) ;
-<a name="l00507"></a>00507         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_FLUX, i, 
-<a name="l00508"></a>00508                 cpl_vector_get(flux, i)) ;
-<a name="l00509"></a>00509     }
-<a name="l00510"></a>00510     cpl_bivector_delete(positions) ;
-<a name="l00511"></a>00511     cpl_vector_delete(flux) ;
-<a name="l00512"></a>00512     
-<a name="l00513"></a>00513     <span class="comment">/* Fit the polynomial */</span>
-<a name="l00514"></a>00514     cpl_msg_info(__func__, <span class="stringliteral">"Compute the polynomial"</span>) ;
-<a name="l00515"></a>00515     <span class="keywordflow">if</span> ((poly = cpl_polynomial_fit_2d_create(purged_pos, purged_flux,
-<a name="l00516"></a>00516             hawki_cal_illum_config.degree, NULL)) == NULL) {
-<a name="l00517"></a>00517         cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit the polynomial"</span>) ;
-<a name="l00518"></a>00518         cpl_bivector_delete(purged_pos) ;
-<a name="l00519"></a>00519         cpl_vector_delete(purged_flux) ;
-<a name="l00520"></a>00520         <span class="keywordflow">return</span> NULL ;
-<a name="l00521"></a>00521     }
-<a name="l00522"></a>00522     cpl_bivector_delete(purged_pos) ;
-<a name="l00523"></a>00523     cpl_vector_delete(purged_flux) ;
-<a name="l00524"></a>00524    
-<a name="l00525"></a>00525     <span class="comment">/* Create the polynomial image */</span>
-<a name="l00526"></a>00526     poly_ima = cpl_image_new(nx, ny, CPL_TYPE_FLOAT) ;
-<a name="l00527"></a>00527     cpl_image_fill_polynomial(poly_ima, poly, 1.0, 1.0, 1.0, 1.0) ;
-<a name="l00528"></a>00528     cpl_polynomial_delete(poly) ;
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     <span class="comment">/* Normalise the image */</span>
-<a name="l00531"></a>00531     val = cpl_image_get(poly_ima, 1024, 1024, &ival) ;
-<a name="l00532"></a>00532     cpl_image_divide_scalar(poly_ima, val) ;
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="keywordflow">return</span> poly_ima ;
-<a name="l00535"></a>00535 }
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00545"></a>00545 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00546"></a>00546 <span class="keyword">static</span> cpl_vector * hawki_cal_illum_phot(
-<a name="l00547"></a>00547         cpl_imagelist   *   ilist,
-<a name="l00548"></a>00548         cpl_bivector    *   positions,
-<a name="l00549"></a>00549         <span class="keywordtype">int</span>             *   nvalid)
-<a name="l00550"></a>00550 {
-<a name="l00551"></a>00551     cpl_vector          *   flux ;
-<a name="l00552"></a>00552     cpl_image           *   cur_ima ;
-<a name="l00553"></a>00553     <span class="keywordtype">double</span>              *   pos_x ;
-<a name="l00554"></a>00554     <span class="keywordtype">double</span>              *   pos_y ;
-<a name="l00555"></a>00555     <span class="keywordtype">int</span>                     ni ;
-<a name="l00556"></a>00556     <span class="keywordtype">int</span>                     nok ;
-<a name="l00557"></a>00557     <span class="keywordtype">double</span>                  bg, fl ;
-<a name="l00558"></a>00558     cpl_bivector        *   iqe_res ;
-<a name="l00559"></a>00559     <span class="keywordtype">double</span>                  fwhm_x, fwhm_y, r, r1, r2 ;
-<a name="l00560"></a>00560     <span class="keywordtype">int</span>                     i ;
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="comment">/* Test entries */</span>
-<a name="l00563"></a>00563     <span class="keywordflow">if</span> (ilist == NULL || positions == NULL || nvalid == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00564"></a>00564     ni = cpl_imagelist_get_size(ilist) ;
-<a name="l00565"></a>00565     pos_x = cpl_bivector_get_x_data(positions) ;
-<a name="l00566"></a>00566     pos_y = cpl_bivector_get_y_data(positions) ;
-<a name="l00567"></a>00567     nok = 0 ;
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569     <span class="comment">/* Create the flux vector */</span>
-<a name="l00570"></a>00570     flux = cpl_vector_new(ni) ;
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572     <span class="comment">/* Loop on the frames */</span>
-<a name="l00573"></a>00573     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {
-<a name="l00574"></a>00574         cur_ima = cpl_imagelist_get(ilist, i) ;
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576         <span class="comment">/* FWHM_X / FWHM_Y */</span>
-<a name="l00577"></a>00577         <span class="keywordflow">if</span> ((iqe_res = cpl_image_iqe(cur_ima,
-<a name="l00578"></a>00578                         (<span class="keywordtype">int</span>)(pos_x[i]-10.0), (<span class="keywordtype">int</span>)(pos_y[i]-10.0),
-<a name="l00579"></a>00579                         (<span class="keywordtype">int</span>)(pos_x[i]+10.0), (<span class="keywordtype">int</span>)(pos_y[i]+10.0))) == NULL) {
-<a name="l00580"></a>00580             cpl_msg_debug(__func__,<span class="stringliteral">"Cannot get FWHM for image %d"</span>, i+1);
-<a name="l00581"></a>00581             fwhm_x = fwhm_y = -1.0 ;
-<a name="l00582"></a>00582             cpl_error_reset() ;
-<a name="l00583"></a>00583         } <span class="keywordflow">else</span> {
-<a name="l00584"></a>00584             fwhm_x = cpl_vector_get(cpl_bivector_get_x(iqe_res), 2) ;
-<a name="l00585"></a>00585             fwhm_y = cpl_vector_get(cpl_bivector_get_x(iqe_res), 3) ;
-<a name="l00586"></a>00586             cpl_bivector_delete(iqe_res) ;
-<a name="l00587"></a>00587         }
-<a name="l00588"></a>00588 
-<a name="l00589"></a>00589         <span class="comment">/* Determine the radii */</span>
-<a name="l00590"></a>00590         r = hawki_cal_illum_config.star_r ;
-<a name="l00591"></a>00591         <span class="keywordflow">if</span> (r < 0) {
-<a name="l00592"></a>00592             <span class="keywordflow">if</span> (fwhm_x>0 && fwhm_y>0)   r = 5*(fwhm_x+fwhm_y)/2.0 ;
-<a name="l00593"></a>00593             <span class="keywordflow">else</span>                        r = HAWKI_PHOT_STAR_RADIUS ;
-<a name="l00594"></a>00594         }
-<a name="l00595"></a>00595         r1 = hawki_cal_illum_config.bg_r1 ;
-<a name="l00596"></a>00596         r2 = hawki_cal_illum_config.bg_r2 ;
-<a name="l00597"></a>00597         <span class="keywordflow">if</span> (r1 < 0) r1 = r + 10.0 ;
-<a name="l00598"></a>00598         <span class="keywordflow">if</span> (r2 < 0) r2 = r1 + 20.0 ;
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600         bg = irplib_strehl_ring_background(cur_ima, (<span class="keywordtype">int</span>)pos_x[i],
-<a name="l00601"></a>00601                 (<span class="keywordtype">int</span>)pos_y[i], r1, r2, IRPLIB_BG_METHOD_MEDIAN) ;
-<a name="l00602"></a>00602         fl = irplib_strehl_disk_flux(cur_ima, (<span class="keywordtype">int</span>)pos_x[i], (<span class="keywordtype">int</span>)pos_y[i], 
-<a name="l00603"></a>00603                 r, bg) ;
-<a name="l00604"></a>00604         cpl_vector_set(flux, i, fl); 
-<a name="l00605"></a>00605         <span class="keywordflow">if</span> (fabs(fl)>1e-3) nok++ ; 
-<a name="l00606"></a>00606         cpl_msg_info(__func__, <span class="stringliteral">"Flux for image %d: %g (r=%g, r1=%g, r2=%g)"</span>, 
-<a name="l00607"></a>00607                 i+1, fl, r, r1, r2) ;
-<a name="l00608"></a>00608     }
-<a name="l00609"></a>00609     *nvalid = nok ;
-<a name="l00610"></a>00610     <span class="keywordflow">return</span> flux ;
-<a name="l00611"></a>00611 }
-<a name="l00612"></a>00612  
-<a name="l00613"></a>00613 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00621"></a>00621 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00622"></a>00622 <span class="keyword">static</span> cpl_bivector * hawki_cal_illum_find_pos(
-<a name="l00623"></a>00623         cpl_imagelist   *   ilist,
-<a name="l00624"></a>00624         cpl_bivector    *   offsets,
-<a name="l00625"></a>00625         <span class="keywordtype">int</span>                 chip)
-<a name="l00626"></a>00626 {
-<a name="l00627"></a>00627     cpl_bivector        *   positions ;
-<a name="l00628"></a>00628     <span class="keywordtype">double</span>              *   positions_x ;
-<a name="l00629"></a>00629     <span class="keywordtype">double</span>              *   positions_y ;
-<a name="l00630"></a>00630     <span class="keywordtype">double</span>              *   offsets_x ;
-<a name="l00631"></a>00631     <span class="keywordtype">double</span>              *   offsets_y ;
-<a name="l00632"></a>00632     cpl_image           *   tmp_ima ;
-<a name="l00633"></a>00633     cpl_image           *   cur_ima ;
-<a name="l00634"></a>00634     cpl_image           *   filtered_ima ;
-<a name="l00635"></a>00635     cpl_matrix          *   kernel ;
-<a name="l00636"></a>00636     <span class="keywordtype">int</span>                     nx, ny, ni ;
-<a name="l00637"></a>00637     <span class="keywordtype">int</span>                     llx, lly, urx, ury, posx, posy, gap ;
-<a name="l00638"></a>00638     <span class="keywordtype">int</span>                     i ;
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="comment">/* Test entries */</span>
-<a name="l00641"></a>00641     <span class="keywordflow">if</span> (ilist == NULL || offsets == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00642"></a>00642     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00643"></a>00643     ni = cpl_imagelist_get_size(ilist) ;
-<a name="l00644"></a>00644     gap = 147 ;
-<a name="l00645"></a>00645 
-<a name="l00646"></a>00646     <span class="comment">/* Create the positions bivector */</span>
-<a name="l00647"></a>00647     positions = cpl_bivector_new(ni) ;
-<a name="l00648"></a>00648     positions_x = cpl_bivector_get_x_data(positions) ;
-<a name="l00649"></a>00649     positions_y = cpl_bivector_get_y_data(positions) ;
-<a name="l00650"></a>00650     offsets_x = cpl_bivector_get_x_data(offsets) ;
-<a name="l00651"></a>00651     offsets_y = cpl_bivector_get_y_data(offsets) ;
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="comment">/* Create the kernel */</span>
-<a name="l00654"></a>00654     kernel = cpl_matrix_new(3, 3) ;
-<a name="l00655"></a>00655     cpl_matrix_fill(kernel, 1.0) ;
-<a name="l00656"></a>00656     
-<a name="l00657"></a>00657     <span class="comment">/* Loop on all the images */</span>
-<a name="l00658"></a>00658     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {
-<a name="l00659"></a>00659         cur_ima = cpl_imagelist_get(ilist, i) ;
-<a name="l00660"></a>00660         nx = cpl_image_get_size_x(cur_ima) ;
-<a name="l00661"></a>00661         ny = cpl_image_get_size_y(cur_ima) ;
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663         <span class="comment">/* Define zone */</span>
-<a name="l00664"></a>00664         <span class="keywordflow">if</span> (chip == 1) {
-<a name="l00665"></a>00665             llx = nx + gap/2.0 + offsets_x[i] - hawki_cal_illum_config.s_hx ;
-<a name="l00666"></a>00666             urx = nx + gap/2.0 + offsets_x[i] + hawki_cal_illum_config.s_hx ;
-<a name="l00667"></a>00667             lly = ny + gap/2.0 + offsets_y[i] - hawki_cal_illum_config.s_hy ;
-<a name="l00668"></a>00668             ury = ny + gap/2.0 + offsets_y[i] + hawki_cal_illum_config.s_hy ;
-<a name="l00669"></a>00669         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 2) {
-<a name="l00670"></a>00670             llx = offsets_x[i] - gap/2.0 - hawki_cal_illum_config.s_hx ;
-<a name="l00671"></a>00671             urx = offsets_x[i] - gap/2.0 + hawki_cal_illum_config.s_hx ;
-<a name="l00672"></a>00672             lly = ny + gap/2.0 + offsets_y[i] - hawki_cal_illum_config.s_hy ;
-<a name="l00673"></a>00673             ury = ny + gap/2.0 + offsets_y[i] + hawki_cal_illum_config.s_hy ;
-<a name="l00674"></a>00674         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 3) {
-<a name="l00675"></a>00675             llx = offsets_x[i] - gap/2.0 - hawki_cal_illum_config.s_hx ;
-<a name="l00676"></a>00676             urx = offsets_x[i] - gap/2.0 + hawki_cal_illum_config.s_hx ;
-<a name="l00677"></a>00677             lly = offsets_y[i] - gap/2.0 - hawki_cal_illum_config.s_hy ;
-<a name="l00678"></a>00678             ury = offsets_y[i] - gap/2.0 + hawki_cal_illum_config.s_hy ;
-<a name="l00679"></a>00679         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 4) {
-<a name="l00680"></a>00680             llx = nx + gap/2.0 + offsets_x[i] - hawki_cal_illum_config.s_hx ;
-<a name="l00681"></a>00681             urx = nx + gap/2.0 + offsets_x[i] + hawki_cal_illum_config.s_hx ;
-<a name="l00682"></a>00682             lly = offsets_y[i] - gap/2.0 - hawki_cal_illum_config.s_hy ;
-<a name="l00683"></a>00683             ury = offsets_y[i] - gap/2.0 + hawki_cal_illum_config.s_hy ;
-<a name="l00684"></a>00684         }
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686         <span class="comment">/* Test zone */</span>
-<a name="l00687"></a>00687         <span class="keywordflow">if</span> (llx>urx || lly>ury || llx<1 || urx>nx || lly<1 || ury>ny) {
-<a name="l00688"></a>00688             cpl_msg_error(__func__, <span class="stringliteral">"Bad specified zone"</span>) ;
-<a name="l00689"></a>00689             cpl_bivector_delete(positions) ;
-<a name="l00690"></a>00690             cpl_matrix_delete(kernel) ;
-<a name="l00691"></a>00691             <span class="keywordflow">return</span> NULL ;
-<a name="l00692"></a>00692         }
-<a name="l00693"></a>00693         
-<a name="l00694"></a>00694         <span class="comment">/* Extract */</span>
-<a name="l00695"></a>00695         tmp_ima = cpl_image_extract(cur_ima, llx, lly, urx, ury) ;
-<a name="l00696"></a>00696         filtered_ima =cpl_image_filter_median(tmp_ima, kernel) ;
-<a name="l00697"></a>00697         cpl_image_delete(tmp_ima) ;
-<a name="l00698"></a>00698 
-<a name="l00699"></a>00699         <span class="comment">/* Find the max */</span>
-<a name="l00700"></a>00700         cpl_image_get_maxpos(filtered_ima, &posx, &posy) ;
-<a name="l00701"></a>00701         positions_x[i] = llx + posx ;
-<a name="l00702"></a>00702         positions_y[i] = lly + posy ;
-<a name="l00703"></a>00703         cpl_image_delete(filtered_ima) ;
-<a name="l00704"></a>00704         cpl_msg_info(__func__, <span class="stringliteral">"Star found at pos %g, %g in image %d"</span>,
-<a name="l00705"></a>00705                 positions_x[i], positions_y[i], i+1) ;
-<a name="l00706"></a>00706     }
-<a name="l00707"></a>00707     cpl_matrix_delete(kernel) ;
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     <span class="keywordflow">return</span> positions ;
-<a name="l00710"></a>00710 }
-<a name="l00711"></a>00711 
-<a name="l00712"></a>00712 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00721"></a>00721 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00722"></a>00722 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_save(
-<a name="l00723"></a>00723         <span class="keyword">const</span> cpl_image     **  illum,
-<a name="l00724"></a>00724         <span class="keyword">const</span> cpl_table     **  flux,
-<a name="l00725"></a>00725         cpl_parameterlist   *   parlist,
-<a name="l00726"></a>00726         cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l00727"></a>00727 {
-<a name="l00728"></a>00728     cpl_propertylist    **  qclists ;
-<a name="l00729"></a>00729     cpl_propertylist    *   paflist ;
-<a name="l00730"></a>00730     cpl_propertylist    *   paflist_cur ;
-<a name="l00731"></a>00731     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l00732"></a>00732     cpl_propertylist    *   inputlist ;
-<a name="l00733"></a>00733     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00734"></a>00734     <span class="keywordtype">char</span>                *   filename ;
-<a name="l00735"></a>00735     <span class="keywordtype">char</span>                    sval[16] ;
-<a name="l00736"></a>00736     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_illum"</span> ;
-<a name="l00737"></a>00737     <span class="keywordtype">int</span>                     i;
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739     <span class="comment">/* Get the reference frame */</span>
-<a name="l00740"></a>00740     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW) ;
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742     <span class="comment">/* Create the QC lists */</span>
-<a name="l00743"></a>00743     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00744"></a>00744     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00745"></a>00745         qclists[i] = cpl_propertylist_new() ;
-<a name="l00746"></a>00746         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l00747"></a>00747                 cpl_frameset_get_size(<span class="keyword">set</span>)) ;
-<a name="l00748"></a>00748 
-<a name="l00749"></a>00749         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00750"></a>00750         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);
-<a name="l00751"></a>00751         inputlist = cpl_propertylist_load_regexp(
-<a name="l00752"></a>00752                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00753"></a>00753                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l00754"></a>00754         cpl_propertylist_copy_property_regexp(qclists[i], inputlist, <span class="stringliteral">""</span>, 0) ;
-<a name="l00755"></a>00755         cpl_propertylist_delete(inputlist) ;
-<a name="l00756"></a>00756     }
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758     <span class="comment">/* Write the image */</span>
-<a name="l00759"></a>00759     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(<span class="keyword">set</span>,
-<a name="l00760"></a>00760                       parlist,
-<a name="l00761"></a>00761                       <span class="keyword">set</span>,
-<a name="l00762"></a>00762                       (<span class="keyword">const</span> cpl_image **)illum, 
-<a name="l00763"></a>00763                       recipe_name,
-<a name="l00764"></a>00764                       HAWKI_CALPRO_ILLUM, 
-<a name="l00765"></a>00765                       HAWKI_PROTYPE_ILLUM,
-<a name="l00766"></a>00766                       NULL,
-<a name="l00767"></a>00767                       (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l00768"></a>00768                       <span class="stringliteral">"hawki_cal_illum.fits"</span>) ;
-<a name="l00769"></a>00769     <span class="comment">/* To handle cases where a chip is missing */</span>
-<a name="l00770"></a>00770     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NULL_INPUT) cpl_error_reset() ;
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772     <span class="comment">/* Write the flux table */</span>
-<a name="l00773"></a>00773     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l00774"></a>00774                       parlist,
-<a name="l00775"></a>00775                       <span class="keyword">set</span>,
-<a name="l00776"></a>00776                       (<span class="keyword">const</span> cpl_table **)flux,
-<a name="l00777"></a>00777                       recipe_name,
-<a name="l00778"></a>00778                       HAWKI_CALPRO_ILLUM_PHOTOM,
-<a name="l00779"></a>00779                       HAWKI_PROTYPE_ILLUM_PHOTOM,
-<a name="l00780"></a>00780                       NULL,
-<a name="l00781"></a>00781                       (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l00782"></a>00782                       <span class="stringliteral">"hawki_cal_illum_photom.fits"</span>) ;
-<a name="l00783"></a>00783     <span class="comment">/* To handle cases where a chip is missing */</span>
-<a name="l00784"></a>00784     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NULL_INPUT) cpl_error_reset() ;
-<a name="l00785"></a>00785    
-<a name="l00786"></a>00786     <span class="comment">/* Remove the keywords for the FITS extensions */</span>
-<a name="l00787"></a>00787     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00788"></a>00788         cpl_propertylist_erase_regexp(qclists[i], HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l00789"></a>00789     }
-<a name="l00790"></a>00790 
-<a name="l00791"></a>00791     <span class="comment">/* Get FITS header from reference file */</span>
-<a name="l00792"></a>00792     paflist = cpl_propertylist_load_regexp(cpl_frame_get_filename(ref_frame),
-<a name="l00793"></a>00793             0, HAWKI_HEADER_PRI_TOPAF, 0) ;
-<a name="l00794"></a>00794 
-<a name="l00795"></a>00795     <span class="comment">/* Add the PRO REC1 ID in the paf files */</span>
-<a name="l00796"></a>00796     cpl_propertylist_prepend_string(paflist, <span class="stringliteral">"PRO REC1 ID"</span>, recipe_name) ;
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798     <span class="comment">/* Add the PRO CATG keyword. This is a workaround, since the current </span>
-<a name="l00799"></a>00799 <span class="comment">     * implemented behaviour is not to have PAF files associated to products.</span>
-<a name="l00800"></a>00800 <span class="comment">     * All this will be removed with the FITS2PAF utility in esorex </span>
-<a name="l00801"></a>00801 <span class="comment">     */</span>
-<a name="l00802"></a>00802     cpl_propertylist_prepend_string(paflist, <span class="stringliteral">"PRO CATG"</span>, HAWKI_CALPRO_ILLUM);
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804     <span class="comment">/* Write the extension PAF files */</span>
-<a name="l00805"></a>00805     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00806"></a>00806         <span class="comment">/* Duplicate paflist */</span>
-<a name="l00807"></a>00807         paflist_cur = cpl_propertylist_duplicate(paflist) ;
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809         <span class="comment">/* Add the EXTNAME keyword in the PAF */</span>
-<a name="l00810"></a>00810         sprintf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, i+1) ;
-<a name="l00811"></a>00811         cpl_propertylist_prepend_string(paflist_cur, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00812"></a>00812 
-<a name="l00813"></a>00813         <span class="comment">/* Get FITS header from reference file extension */</span>
-<a name="l00814"></a>00814         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);
-<a name="l00815"></a>00815         inputlist = cpl_propertylist_load_regexp(
-<a name="l00816"></a>00816                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00817"></a>00817                 HAWKI_HEADER_EXT_TOPAF, 0) ;
-<a name="l00818"></a>00818         cpl_propertylist_copy_property_regexp(paflist_cur, inputlist, <span class="stringliteral">""</span>, 0) ;
-<a name="l00819"></a>00819         cpl_propertylist_delete(inputlist) ;
-<a name="l00820"></a>00820 
-<a name="l00821"></a>00821         <span class="comment">/* End of Workaround */</span>
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823         <span class="comment">/* Copy the QC in paflist */</span>
-<a name="l00824"></a>00824         cpl_propertylist_copy_property_regexp(paflist_cur, qclists[i], <span class="stringliteral">""</span>, 0) ;
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826         <span class="comment">/* Paf file name */</span>
-<a name="l00827"></a>00827         filename = cpl_sprintf(<span class="stringliteral">"%s_%02d.paf"</span>, recipe_name, i+1) ;
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829         <span class="comment">/* Save the PAF file */</span>
-<a name="l00830"></a>00830         cpl_dfs_save_paf(<span class="stringliteral">"HAWKI"</span>,
-<a name="l00831"></a>00831                 recipe_name,
-<a name="l00832"></a>00832                 paflist_cur,
-<a name="l00833"></a>00833                 filename) ;
-<a name="l00834"></a>00834         cpl_free(filename) ;
-<a name="l00835"></a>00835         cpl_propertylist_delete(paflist_cur) ;
-<a name="l00836"></a>00836     }
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     <span class="comment">/* Free and return */</span>
-<a name="l00839"></a>00839     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00840"></a>00840         cpl_propertylist_delete(qclists[i]) ;
-<a name="l00841"></a>00841     }
-<a name="l00842"></a>00842     cpl_free(qclists) ;
-<a name="l00843"></a>00843     cpl_propertylist_delete(paflist) ;
-<a name="l00844"></a>00844     <span class="keywordflow">return</span>  0;
-<a name="l00845"></a>00845 }
-<a name="l00846"></a>00846 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_illum.c,v 1.8 2010/06/04 09:45:43 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/06/04 09:45:43 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "irplib_strehl.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_save.h"</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="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> <span class="keywordtype">int</span> hawki_cal_illum_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum(cpl_parameterlist *, cpl_frameset *) ;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_save(<span class="keyword">const</span> cpl_image **, <span class="keyword">const</span> cpl_table **, </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>         cpl_parameterlist *, cpl_frameset *) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> cpl_image * hawki_cal_illum_compute(cpl_frameset *, <span class="keywordtype">int</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> <span class="keywordtype">char</span> *, cpl_table **) ;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> cpl_vector * hawki_cal_illum_phot(cpl_imagelist *, cpl_bivector *, </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>         <span class="keywordtype">int</span> *) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">static</span> cpl_bivector * hawki_cal_illum_find_pos(cpl_imagelist *, </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>         cpl_bivector *, <span class="keywordtype">int</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="keyword">static</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="comment">/* Inputs */</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <span class="keywordtype">int</span>         subtract ;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keywordtype">int</span>         degree ;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordtype">int</span>         s_hx ;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="keywordtype">int</span>         s_hy ;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keywordtype">double</span>      star_r ;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="keywordtype">double</span>      bg_r1 ;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordtype">double</span>      bg_r2 ;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> } hawki_cal_illum_config ;</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="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_illum_description[] =</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"hawki_cal_illum -- Illumination recipe\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_ILLUM_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</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="l00089"></a><span class="lineno">   89</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</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> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe ) ;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <span class="stringliteral">"hawki_cal_illum"</span>,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     <span class="stringliteral">"Illumination recipe"</span>,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                     hawki_cal_illum_description,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                     <span class="stringliteral">"Yves Jung"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     hawki_cal_illum_create,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     hawki_cal_illum_exec,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     hawki_cal_illum_destroy) ;</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>     cpl_pluginlist_append(list, plugin) ;</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> 0;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_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>     <span class="comment">/* Check that the plugin is part of a valid recipe */</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordflow">else</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>     <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>     recipe->parameters = cpl_parameterlist_new() ; </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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="comment">/* --subtract */</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.subtract"</span>,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>             CPL_TYPE_BOOL, <span class="stringliteral">"Flag to subtract the next images"</span>,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             <span class="stringliteral">"hawki.hawki_cal_illum"</span>, TRUE) ;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"subtract"</span>) ;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="comment">/* --degree */</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.degree"</span>,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>             CPL_TYPE_INT, <span class="stringliteral">"Polynomial degree for the fit"</span>,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>             <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 3) ;</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">"degree"</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>        <span class="comment">/* --star_r */</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.star_r"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>             <span class="stringliteral">"the star radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;</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">"star_r"</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>     <span class="comment">/* --bg_r1 */</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.bg_r1"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>             <span class="stringliteral">"the internal background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;</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">"bg_r1"</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>     <span class="comment">/* --bg_r2 */</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.bg_r2"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>             <span class="stringliteral">"the external background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, -1.0) ;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r2"</span>) ;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <span class="comment">/* --s_hx */</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.s_hx"</span>, CPL_TYPE_INT,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>             <span class="stringliteral">"Half size of the seach box in x"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 50) ;</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">"s_hx"</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>     <span class="comment">/* --s_hy */</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_illum.s_hy"</span>, CPL_TYPE_INT,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>             <span class="stringliteral">"Half size of the seach box in y"</span>, <span class="stringliteral">"hawki.hawki_cal_illum"</span>, 50) ;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"s_hy"</span>) ;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</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>     <span class="keywordflow">return</span> hawki_cal_illum(recipe->parameters, recipe->frames) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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>     cpl_parameterlist_delete(recipe->parameters) ; </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="keywordflow">return</span> 0 ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum(</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         cpl_frameset        *   frameset)</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_parameter       *   par ;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   flat ;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   bpm ;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_frameset        *   rawframes ;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     cpl_frameset        *   cur_frames ;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordtype">int</span>                 *   labels ;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_image           *   illum[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_table           *   flux[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordtype">int</span>                     i ;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     rawframes = 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>     <span class="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.subtract"</span>) ;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     hawki_cal_illum_config.subtract = cpl_parameter_get_bool(par) ;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.degree"</span>) ;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     hawki_cal_illum_config.degree = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.s_hx"</span>) ;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     hawki_cal_illum_config.s_hx = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.s_hy"</span>) ;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     hawki_cal_illum_config.s_hy = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.star_r"</span>) ;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     hawki_cal_illum_config.star_r = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.bg_r1"</span>) ;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     hawki_cal_illum_config.bg_r1 = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_illum.bg_r2"</span>) ;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     hawki_cal_illum_config.bg_r2 = cpl_parameter_get_double(par) ;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve calibration data */</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     flat = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(frameset, HAWKI_CALPRO_FLAT) ;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     bpm = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(frameset, HAWKI_CALPRO_BPM) ;</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset, </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                     HAWKI_CAL_ILLUM_RAW)) == NULL) {</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         cpl_msg_error(__func__, <span class="stringliteral">"No raw frame in input"</span>) ;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Labelise frames */</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_msg_info(__func__, <span class="stringliteral">"Labelise the frames"</span>) ;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">if</span> ((labels = <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a>(rawframes)) == NULL) {</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot labelise"</span>) ;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Loop on the chips */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         cpl_msg_info(__func__, <span class="stringliteral">"Reduce chip nb %d"</span>, i+1) ;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         illum[i] = NULL ;</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">/* Get the frames for which the star is in chip number i+1 */</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         <span class="keywordflow">if</span> ((cur_frames = cpl_frameset_extract(rawframes, labels,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                         i+1)) == NULL) {</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>             cpl_msg_warning(__func__, <span class="stringliteral">"No frames for chip nb %d"</span>, i+1) ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>             <span class="comment">/* Create the flux table */</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             flux[i] = cpl_table_new(1) ;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_FLUX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>             <span class="comment">/* Create the flux table */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>             flux[i] = cpl_table_new(cpl_frameset_get_size(cur_frames)) ;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_POSY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>             cpl_table_new_column(flux[i],HAWKI_COL_ILLUM_FLUX, CPL_TYPE_DOUBLE);</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">/* Get the illumination */</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             <span class="keywordflow">if</span> ((illum[i] = hawki_cal_illum_compute(cur_frames, i+1, </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                             bpm, flat, &(flux[i]))) == NULL) {</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                 cpl_msg_warning(__func__, <span class="stringliteral">"Cannot compute for chip %d"</span>, i+1) ;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                 cpl_error_reset() ;</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_frameset_delete(cur_frames) ;</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_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_free(labels) ;</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">/* Save the product */</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the product"</span>) ;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">if</span> (hawki_cal_illum_save((<span class="keyword">const</span> cpl_image **)illum, </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                 (<span class="keyword">const</span> cpl_table **)flux, parlist, frameset)) {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the product"</span>) ;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_table_delete(flux[i]) ;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(illum[i]) ;</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>         <span class="keywordflow">return</span> -1 ;</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">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_table_delete(flux[i]) ;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(illum[i]) ;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_msg_indent_less() ;</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">/* Return */</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_image * hawki_cal_illum_compute(</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>         cpl_frameset    *   raw,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         <span class="keywordtype">int</span>                 chip,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         cpl_table       **  fl)</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_bivector    *   offsets ;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     cpl_imagelist   *   in ;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cpl_image       *   ima1 ;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_image       *   ima2 ;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     cpl_bivector    *   positions ;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_bivector    *   purged_pos ;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordtype">double</span>          *   positions_x,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                     *   positions_y,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                     *   purged_pos_x,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                     *   purged_pos_y ;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     cpl_vector      *   flux ;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_vector      *   purged_flux ;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_polynomial  *   poly ;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     cpl_image       *   poly_ima ;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">int</span>                 nval, nx, ny ;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordtype">double</span>              val ;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keywordtype">int</span>                 ival ;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordtype">int</span>                 i, j ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">if</span> (raw == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="keywordflow">if</span> (fl == NULL) <span class="keywordflow">return</span> NULL ;</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">/* Get the offsets from the raw frames */</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_msg_info(__func__, <span class="stringliteral">"Get the offsets from the files headers"</span>) ;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(raw)) == NULL) {</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the offsets"</span>) ;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         <span class="keywordflow">return</span> NULL ;</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>     cpl_msg_indent_less() ;</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">/* Load the input data */</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(raw, chip, CPL_TYPE_FLOAT)) == NULL) {</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load input data"</span>) ;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         <span class="keywordflow">return</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_msg_indent_less() ;</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="comment">/* Apply the calibrations */</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordflow">if</span> (flat || bpm) {</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>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a>(in, flat, bpm) == -1) {</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply calibrations"</span>) ;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>             <span class="keywordflow">return</span> 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_msg_indent_less() ;</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> </div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="comment">/* Subtract the consecutive frames */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordflow">if</span> (hawki_cal_illum_config.subtract) {</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         cpl_msg_info(__func__, <span class="stringliteral">"Subtract the next images"</span>) ;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>         ima1 = cpl_image_duplicate(cpl_imagelist_get(in, 0)) ;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(in) ; i++) {</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>             <span class="keywordflow">if</span> (i==cpl_imagelist_get_size(in)-1) {</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                 ima2 = ima1 ;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>             } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                 ima2 = cpl_imagelist_get(in, i+1) ;</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_image_subtract(cpl_imagelist_get(in, i), ima2) ;</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>         cpl_image_delete(ima1) ;</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> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     <span class="comment">/* Find the positions */</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_msg_info(__func__, <span class="stringliteral">"Find the positions"</span>) ;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span> ((positions=hawki_cal_illum_find_pos(in, offsets, chip)) == NULL) {</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the positions"</span>) ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         <span class="keywordflow">return</span> 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>     cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     cpl_msg_indent_less() ;</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">/* Compute the photometry */</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     cpl_msg_info(__func__, <span class="stringliteral">"Compute the photometry"</span>) ;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="keywordflow">if</span> ((flux=hawki_cal_illum_phot(in, positions, &nval)) == NULL) {</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the positions"</span>) ;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         <span class="keywordflow">return</span> NULL ;</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>     nx = cpl_image_get_size_x(cpl_imagelist_get(in, 0)) ;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     ny = cpl_image_get_size_y(cpl_imagelist_get(in, 0)) ;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <span class="keywordflow">if</span> (nval < 1) {</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         cpl_msg_error(__func__, <span class="stringliteral">"No flux computed"</span>) ;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         cpl_vector_delete(flux) ;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         <span class="keywordflow">return</span> 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>     </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="comment">/* Purge positions */</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     purged_pos = cpl_bivector_new(nval) ;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     purged_pos_x = cpl_bivector_get_x_data(purged_pos) ;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     purged_pos_y = cpl_bivector_get_y_data(purged_pos) ;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     positions_x = cpl_bivector_get_x_data(positions) ;</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     positions_y = cpl_bivector_get_y_data(positions) ;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     purged_flux = cpl_vector_new(nval) ;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     j = 0 ;</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     <span class="keywordflow">for</span> (i=0 ; i<cpl_vector_get_size(flux) ; i++) {</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>         <span class="keywordflow">if</span> (fabs(cpl_vector_get(flux, i)) > 0) {</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             purged_pos_x[j] = positions_x[i] ;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             purged_pos_y[j] = positions_y[i] ;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             cpl_vector_set(purged_flux, j, cpl_vector_get(flux, i)) ;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             j++ ;</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> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="comment">/* Fill the flux table */</span></div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordflow">for</span> (i=0 ; i<cpl_vector_get_size(flux) ; i++) {</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_POSX, i, positions_x[i]) ;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_POSY, i, positions_y[i]) ;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         cpl_table_set_double(*fl, HAWKI_COL_ILLUM_FLUX, i, </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                 cpl_vector_get(flux, i)) ;</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>     cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     cpl_vector_delete(flux) ;</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">/* Fit the polynomial */</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     cpl_msg_info(__func__, <span class="stringliteral">"Compute the polynomial"</span>) ;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <span class="keywordflow">if</span> ((poly = cpl_polynomial_fit_2d_create(purged_pos, purged_flux,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             hawki_cal_illum_config.degree, NULL)) == NULL) {</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit the polynomial"</span>) ;</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         cpl_bivector_delete(purged_pos) ;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         cpl_vector_delete(purged_flux) ;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         <span class="keywordflow">return</span> NULL ;</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_bivector_delete(purged_pos) ;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     cpl_vector_delete(purged_flux) ;</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="comment">/* Create the polynomial image */</span></div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     poly_ima = cpl_image_new(nx, ny, CPL_TYPE_FLOAT) ;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     cpl_image_fill_polynomial(poly_ima, poly, 1.0, 1.0, 1.0, 1.0) ;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     cpl_polynomial_delete(poly) ;</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">/* Normalise the image */</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     val = cpl_image_get(poly_ima, 1024, 1024, &ival) ;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_image_divide_scalar(poly_ima, val) ;</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> poly_ima ;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> <span class="keyword">static</span> cpl_vector * hawki_cal_illum_phot(</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_imagelist   *   ilist,</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         cpl_bivector    *   positions,</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         <span class="keywordtype">int</span>             *   nvalid)</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_vector          *   flux ;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     cpl_image           *   cur_ima ;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordtype">double</span>              *   pos_x ;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordtype">double</span>              *   pos_y ;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordtype">int</span>                     ni ;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordtype">int</span>                     nok ;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordtype">double</span>                  bg, fl ;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     cpl_bivector        *   iqe_res ;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <span class="keywordtype">double</span>                  fwhm_x, fwhm_y, r, r1, r2 ;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     <span class="keywordtype">int</span>                     i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span> (ilist == NULL || positions == NULL || nvalid == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     ni = cpl_imagelist_get_size(ilist) ;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     pos_x = cpl_bivector_get_x_data(positions) ;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     pos_y = cpl_bivector_get_y_data(positions) ;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     nok = 0 ;</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">/* Create the flux vector */</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     flux = cpl_vector_new(ni) ;</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">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         cur_ima = cpl_imagelist_get(ilist, i) ;</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">/* FWHM_X / FWHM_Y */</span></div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         <span class="keywordflow">if</span> ((iqe_res = cpl_image_iqe(cur_ima,</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                         (<span class="keywordtype">int</span>)(pos_x[i]-10.0), (<span class="keywordtype">int</span>)(pos_y[i]-10.0),</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>                         (<span class="keywordtype">int</span>)(pos_x[i]+10.0), (<span class="keywordtype">int</span>)(pos_y[i]+10.0))) == NULL) {</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>             cpl_msg_debug(__func__,<span class="stringliteral">"Cannot get FWHM for image %d"</span>, i+1);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>             fwhm_x = fwhm_y = -1.0 ;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>             cpl_error_reset() ;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>             fwhm_x = cpl_vector_get(cpl_bivector_get_x(iqe_res), 2) ;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>             fwhm_y = cpl_vector_get(cpl_bivector_get_x(iqe_res), 3) ;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>             cpl_bivector_delete(iqe_res) ;</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">/* Determine the radii */</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         r = hawki_cal_illum_config.star_r ;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         <span class="keywordflow">if</span> (r < 0) {</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>             <span class="keywordflow">if</span> (fwhm_x>0 && fwhm_y>0)   r = 5*(fwhm_x+fwhm_y)/2.0 ;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>             <span class="keywordflow">else</span>                        r = HAWKI_PHOT_STAR_RADIUS ;</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>         r1 = hawki_cal_illum_config.bg_r1 ;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         r2 = hawki_cal_illum_config.bg_r2 ;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         <span class="keywordflow">if</span> (r1 < 0) r1 = r + 10.0 ;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         <span class="keywordflow">if</span> (r2 < 0) r2 = r1 + 20.0 ;</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>         bg = irplib_strehl_ring_background(cur_ima, (<span class="keywordtype">int</span>)pos_x[i],</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>                 (<span class="keywordtype">int</span>)pos_y[i], r1, r2, IRPLIB_BG_METHOD_MEDIAN) ;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         fl = irplib_strehl_disk_flux(cur_ima, (<span class="keywordtype">int</span>)pos_x[i], (<span class="keywordtype">int</span>)pos_y[i], </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>                 r, bg) ;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         cpl_vector_set(flux, i, fl); </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         <span class="keywordflow">if</span> (fabs(fl)>1e-3) nok++ ; </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         cpl_msg_info(__func__, <span class="stringliteral">"Flux for image %d: %g (r=%g, r1=%g, r2=%g)"</span>, </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                 i+1, fl, r, r1, r2) ;</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>     *nvalid = nok ;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">return</span> flux ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_bivector * hawki_cal_illum_find_pos(</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         cpl_imagelist   *   ilist,</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         cpl_bivector    *   offsets,</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         <span class="keywordtype">int</span>                 chip)</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_bivector        *   positions ;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     <span class="keywordtype">double</span>              *   positions_x ;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordtype">double</span>              *   positions_y ;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keywordtype">double</span>              *   offsets_x ;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="keywordtype">double</span>              *   offsets_y ;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_image           *   tmp_ima ;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_image           *   cur_ima ;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_image           *   filtered_ima ;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     cpl_matrix          *   kernel ;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="keywordtype">int</span>                     nx, ny, ni ;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     <span class="keywordtype">int</span>                     llx, lly, urx, ury, posx, posy, gap ;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordtype">int</span>                     i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordflow">if</span> (ilist == NULL || offsets == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     ni = cpl_imagelist_get_size(ilist) ;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     gap = 147 ;</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="comment">/* Create the positions bivector */</span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     positions = cpl_bivector_new(ni) ;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     positions_x = cpl_bivector_get_x_data(positions) ;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     positions_y = cpl_bivector_get_y_data(positions) ;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     offsets_x = cpl_bivector_get_x_data(offsets) ;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     offsets_y = cpl_bivector_get_y_data(offsets) ;</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="comment">/* Create the kernel */</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     kernel = cpl_matrix_new(3, 3) ;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     cpl_matrix_fill(kernel, 1.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">/* Loop on all the images */</span></div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         cur_ima = cpl_imagelist_get(ilist, i) ;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         nx = cpl_image_get_size_x(cur_ima) ;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>         ny = cpl_image_get_size_y(cur_ima) ;</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">/* Define zone */</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         <span class="keywordflow">if</span> (chip == 1) {</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             llx = nx + gap/2.0 + offsets_x[i] - hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>             urx = nx + gap/2.0 + offsets_x[i] + hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>             lly = ny + gap/2.0 + offsets_y[i] - hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>             ury = ny + gap/2.0 + offsets_y[i] + hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 2) {</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>             llx = offsets_x[i] - gap/2.0 - hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>             urx = offsets_x[i] - gap/2.0 + hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>             lly = ny + gap/2.0 + offsets_y[i] - hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>             ury = ny + gap/2.0 + offsets_y[i] + hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 3) {</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>             llx = offsets_x[i] - gap/2.0 - hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>             urx = offsets_x[i] - gap/2.0 + hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>             lly = offsets_y[i] - gap/2.0 - hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>             ury = offsets_y[i] - gap/2.0 + hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (chip == 4) {</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>             llx = nx + gap/2.0 + offsets_x[i] - hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>             urx = nx + gap/2.0 + offsets_x[i] + hawki_cal_illum_config.s_hx ;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>             lly = offsets_y[i] - gap/2.0 - hawki_cal_illum_config.s_hy ;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>             ury = offsets_y[i] - gap/2.0 + hawki_cal_illum_config.s_hy ;</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>         <span class="comment">/* Test zone */</span></div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         <span class="keywordflow">if</span> (llx>urx || lly>ury || llx<1 || urx>nx || lly<1 || ury>ny) {</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>             cpl_msg_error(__func__, <span class="stringliteral">"Bad specified zone"</span>) ;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>             cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>             cpl_matrix_delete(kernel) ;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>             <span class="keywordflow">return</span> 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>         </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         <span class="comment">/* Extract */</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>         tmp_ima = cpl_image_extract(cur_ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>         filtered_ima =cpl_image_filter_median(tmp_ima, kernel) ;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>         cpl_image_delete(tmp_ima) ;</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="comment">/* Find the max */</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>         cpl_image_get_maxpos(filtered_ima, &posx, &posy) ;</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         positions_x[i] = llx + posx ;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         positions_y[i] = lly + posy ;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         cpl_image_delete(filtered_ima) ;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>         cpl_msg_info(__func__, <span class="stringliteral">"Star found at pos %g, %g in image %d"</span>,</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                 positions_x[i], positions_y[i], i+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>     cpl_matrix_delete(kernel) ;</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">return</span> positions ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_illum_save(</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         <span class="keyword">const</span> cpl_image     **  illum,</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>         <span class="keyword">const</span> cpl_table     **  flux,</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         cpl_frameset        *   <span class="keyword">set</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>     cpl_propertylist    **  qclists ;</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     cpl_propertylist    *   paflist ;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     cpl_propertylist    *   paflist_cur ;</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     <span class="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordtype">char</span>                *   filename ;</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <span class="keywordtype">char</span>                    sval[16] ;</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_illum"</span> ;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     <span class="keywordtype">int</span>                     i;</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">/* Get the reference frame */</span></div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW) ;</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="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>         qclists[i] = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         cpl_propertylist_append_double(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>                 cpl_frameset_get_size(<span class="keyword">set</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="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>         cpl_propertylist_copy_property_regexp(qclists[i], inputlist, <span class="stringliteral">""</span>, 0) ;</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>         cpl_propertylist_delete(inputlist) ;</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>     <span class="comment">/* Write the image */</span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>                       parlist,</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>                       <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                       (<span class="keyword">const</span> cpl_image **)illum, </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>                       recipe_name,</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                       HAWKI_CALPRO_ILLUM, </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                       HAWKI_PROTYPE_ILLUM,</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                       NULL,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                       (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>                       <span class="stringliteral">"hawki_cal_illum.fits"</span>) ;</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     <span class="comment">/* To handle cases where a chip is missing */</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NULL_INPUT) cpl_error_reset() ;</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">/* Write the flux table */</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                       parlist,</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                       <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>                       (<span class="keyword">const</span> cpl_table **)flux,</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>                       recipe_name,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>                       HAWKI_CALPRO_ILLUM_PHOTOM,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                       HAWKI_PROTYPE_ILLUM_PHOTOM,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                       NULL,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                       (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>                       <span class="stringliteral">"hawki_cal_illum_photom.fits"</span>) ;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="comment">/* To handle cases where a chip is missing */</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NULL_INPUT) cpl_error_reset() ;</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">/* Remove the keywords for the FITS extensions */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>         cpl_propertylist_erase_regexp(qclists[i], HAWKI_HEADER_EXT_FORWARD, 0) ;</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>     <span class="comment">/* Get FITS header from reference file */</span></div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     paflist = cpl_propertylist_load_regexp(cpl_frame_get_filename(ref_frame),</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>             0, HAWKI_HEADER_PRI_TOPAF, 0) ;</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>     <span class="comment">/* Add the PRO REC1 ID in the paf files */</span></div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     cpl_propertylist_prepend_string(paflist, <span class="stringliteral">"PRO REC1 ID"</span>, recipe_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="comment">/* Add the PRO CATG keyword. This is a workaround, since the current </span></div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="comment">     * implemented behaviour is not to have PAF files associated to products.</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> <span class="comment">     * All this will be removed with the FITS2PAF utility in esorex </span></div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_propertylist_prepend_string(paflist, <span class="stringliteral">"PRO CATG"</span>, HAWKI_CALPRO_ILLUM);</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">/* Write the extension PAF files */</span></div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         <span class="comment">/* Duplicate paflist */</span></div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         paflist_cur = cpl_propertylist_duplicate(paflist) ;</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="comment">/* Add the EXTNAME keyword in the PAF */</span></div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>         sprintf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, i+1) ;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         cpl_propertylist_prepend_string(paflist_cur, <span class="stringliteral">"EXTNAME"</span>, sval) ;</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>         <span class="comment">/* Get FITS header from reference file extension */</span></div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                 HAWKI_HEADER_EXT_TOPAF, 0) ;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         cpl_propertylist_copy_property_regexp(paflist_cur, inputlist, <span class="stringliteral">""</span>, 0) ;</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         cpl_propertylist_delete(inputlist) ;</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="comment">/* End of Workaround */</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="comment">/* Copy the QC in paflist */</span></div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         cpl_propertylist_copy_property_regexp(paflist_cur, qclists[i], <span class="stringliteral">""</span>, 0) ;</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="comment">/* Paf file name */</span></div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         filename = cpl_sprintf(<span class="stringliteral">"%s_%02d.paf"</span>, recipe_name, i+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>         <span class="comment">/* Save the PAF file */</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         cpl_dfs_save_paf(<span class="stringliteral">"HAWKI"</span>,</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>                 recipe_name,</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>                 paflist_cur,</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>                 filename) ;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>         cpl_free(filename) ;</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         cpl_propertylist_delete(paflist_cur) ;</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> </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>         cpl_propertylist_delete(qclists[i]) ;</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_free(qclists) ;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cpl_propertylist_delete(paflist) ;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     <span class="keywordflow">return</span>  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><!-- 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/hawki__cal__lingain_8c_source.html b/html/hawki__cal__lingain_8c_source.html
index 67256d1..92d68ae 100644
--- a/html/hawki__cal__lingain_8c_source.html
+++ b/html/hawki__cal__lingain_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_lingain.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,199 +40,200 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_lingain.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_lingain.c,v 1.4 2010/09/28 14:13:48 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 CRIRES Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/28 14:13:48 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                             Includes and Defines</span>
-<a name="l00034"></a>00034 <span class="comment"> ----------------------------------------------------------------------------*/</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 "irplib_detmon_lg.h"</span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_detmon.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_plugin.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="preprocessor">#define RECIPE_NAME "hawki_cal_lingain"</span>
-<a name="l00045"></a>00045 <span class="preprocessor"></span>
-<a name="l00046"></a>00046 <span class="comment">/* Copy here instrument specific keywords which need to be in the PAF file */</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#define INSTREGEXP   "ESO INS SETUP ID"</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define PAFREGEXP    "^(" REGEXP "|" INSTREGEXP ")$"</span>
-<a name="l00049"></a>00049 <span class="preprocessor"></span>
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00052"></a>00052 <span class="comment">                 Functions prototypes</span>
-<a name="l00053"></a>00053 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00054"></a>00054 
-<a name="l00057"></a>00057 cpl_error_code hawki_cal_lingain_fill_parlist_default(cpl_parameterlist * parlist);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 IRPLIB_RECIPE_DEFINE(hawki_cal_lingain, HAWKI_BINARY_VERSION,
-<a name="l00060"></a>00060         hawki_cal_lingain_fill_parlist_default(recipe->parameters),
-<a name="l00061"></a>00061         <span class="stringliteral">"Enrique Garcia"</span>, PACKAGE_BUGREPORT, <span class="stringliteral">"2009"</span>, 
-<a name="l00062"></a>00062         <span class="stringliteral">"Linearity/Gain recipe for the IR domain"</span>,
-<a name="l00063"></a>00063         irplib_detmon_lg_get_description(RECIPE_NAME, <span class="stringliteral">"HAWKI"</span>, 
-<a name="l00064"></a>00064                                          HAWKI_CAL_LINGAIN_LAMP_RAW,
-<a name="l00065"></a>00065                                          HAWKI_CAL_LINGAIN_DARK_RAW));
-<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>00069 <span class="comment">  @brief    Interpret the command line options and execute the data processing</span>
-<a name="l00070"></a>00070 <span class="comment">  @param    frameset    the frames list</span>
-<a name="l00071"></a>00071 <span class="comment">  @param    parlist     the parameters list</span>
-<a name="l00072"></a>00072 <span class="comment">  @return   0 if everything is ok</span>
-<a name="l00073"></a>00073 <span class="comment"> */</span>
-<a name="l00074"></a>00074 <span class="comment">/*---------------------------------------------------------------------------*/</span>
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_lingain(cpl_frameset            * frameset,
-<a name="l00076"></a>00076                              <span class="keyword">const</span> cpl_parameterlist * parlist)
-<a name="l00077"></a>00077 {
-<a name="l00078"></a>00078     cpl_error_code        error ;
-<a name="l00079"></a>00079     cpl_propertylist  *   pro_lintbl ;
-<a name="l00080"></a>00080     cpl_propertylist  *   pro_gaintbl ;
-<a name="l00081"></a>00081     cpl_propertylist  *   pro_coeffscube ;
-<a name="l00082"></a>00082     cpl_propertylist  *   pro_bpm ;
-<a name="l00083"></a>00083     cpl_propertylist  *   pro_corr ;
-<a name="l00084"></a>00084     cpl_propertylist  *   pro_diff ;
-<a name="l00085"></a>00085     
-<a name="l00086"></a>00086     <span class="comment">/* Create the PRO keys propertylist */</span>
-<a name="l00087"></a>00087     pro_lintbl = cpl_propertylist_new() ;
-<a name="l00088"></a>00088     cpl_propertylist_append_string(pro_lintbl, CPL_DFS_PRO_CATG, 
-<a name="l00089"></a>00089             HAWKI_CALPRO_LINGAIN_LIN) ;
-<a name="l00090"></a>00090     cpl_propertylist_append_string(pro_lintbl, CPL_DFS_PRO_TYPE,
-<a name="l00091"></a>00091             HAWKI_PROTYPE_LIN_STATS) ;
-<a name="l00092"></a>00092     
-<a name="l00093"></a>00093     pro_gaintbl = cpl_propertylist_new() ;
-<a name="l00094"></a>00094     cpl_propertylist_append_string(pro_gaintbl, CPL_DFS_PRO_CATG, 
-<a name="l00095"></a>00095             HAWKI_CALPRO_LINGAIN_GAIN) ;
-<a name="l00096"></a>00096     cpl_propertylist_append_string(pro_gaintbl, CPL_DFS_PRO_TYPE,
-<a name="l00097"></a>00097             HAWKI_PROTYPE_GAIN_STATS) ;
-<a name="l00098"></a>00098     
-<a name="l00099"></a>00099     pro_coeffscube = cpl_propertylist_new() ;
-<a name="l00100"></a>00100     cpl_propertylist_append_string(pro_coeffscube, CPL_DFS_PRO_CATG, 
-<a name="l00101"></a>00101             HAWKI_CALPRO_LINGAIN_COEFFS) ;
-<a name="l00102"></a>00102     cpl_propertylist_append_string(pro_coeffscube, CPL_DFS_PRO_TYPE, 
-<a name="l00103"></a>00103             HAWKI_PROTYPE_LIN_COEFFS) ;
-<a name="l00104"></a>00104     
-<a name="l00105"></a>00105     pro_bpm = cpl_propertylist_new() ;
-<a name="l00106"></a>00106     cpl_propertylist_append_string(pro_bpm, CPL_DFS_PRO_CATG, 
-<a name="l00107"></a>00107             HAWKI_CALPRO_LINGAIN_BPM) ;
-<a name="l00108"></a>00108     cpl_propertylist_append_string(pro_bpm, CPL_DFS_PRO_TYPE, 
-<a name="l00109"></a>00109             HAWKI_PROTYPE_BPM_LEVELS) ;
-<a name="l00110"></a>00110     
-<a name="l00111"></a>00111     pro_corr = cpl_propertylist_new() ;
-<a name="l00112"></a>00112     cpl_propertylist_append_string(pro_corr, CPL_DFS_PRO_CATG, 
-<a name="l00113"></a>00113             HAWKI_CALPRO_LINGAIN_CORR) ;
-<a name="l00114"></a>00114     cpl_propertylist_append_string(pro_corr, CPL_DFS_PRO_TYPE,
-<a name="l00115"></a>00115             HAWKI_PROTYPE_LINGAIN_CORR) ;
-<a name="l00116"></a>00116     
-<a name="l00117"></a>00117     pro_diff = cpl_propertylist_new() ;
-<a name="l00118"></a>00118     cpl_propertylist_append_string(pro_diff, CPL_DFS_PRO_CATG, 
-<a name="l00119"></a>00119             HAWKI_CALPRO_LINGAIN_DIFF) ;
-<a name="l00120"></a>00120     cpl_propertylist_append_string(pro_diff, CPL_DFS_PRO_TYPE,
-<a name="l00121"></a>00121             HAWKI_PROTYPE_LINGAIN_DIFF) ;
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     <span class="comment">/* Call the lingain function */</span>
-<a name="l00124"></a>00124     error = irplib_detmon_lg(frameset,
-<a name="l00125"></a>00125             parlist,
-<a name="l00126"></a>00126             HAWKI_CAL_LINGAIN_LAMP_RAW,
-<a name="l00127"></a>00127             HAWKI_CAL_LINGAIN_DARK_RAW,
-<a name="l00128"></a>00128             RECIPE_NAME,
-<a name="l00129"></a>00129             PACKAGE_TARNAME,
-<a name="l00130"></a>00130             PAFREGEXP,
-<a name="l00131"></a>00131             pro_lintbl, 
-<a name="l00132"></a>00132             pro_gaintbl, 
-<a name="l00133"></a>00133             pro_coeffscube, 
-<a name="l00134"></a>00134             pro_bpm, 
-<a name="l00135"></a>00135             pro_corr, 
-<a name="l00136"></a>00136             pro_diff,
-<a name="l00137"></a>00137             PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00138"></a>00138             NULL, NULL, TRUE);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="comment">/* Delete the PRO keys propertylist */</span>
-<a name="l00141"></a>00141     cpl_propertylist_delete(pro_lintbl) ;
-<a name="l00142"></a>00142     cpl_propertylist_delete(pro_gaintbl) ;
-<a name="l00143"></a>00143     cpl_propertylist_delete(pro_coeffscube) ;
-<a name="l00144"></a>00144     cpl_propertylist_delete(pro_bpm) ;
-<a name="l00145"></a>00145     cpl_propertylist_delete(pro_corr) ;
-<a name="l00146"></a>00146     cpl_propertylist_delete(pro_diff) ;
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="comment">/* Propagate the error, if any */</span>
-<a name="l00149"></a>00149     cpl_ensure_code(!error, error);
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/* Return */</span>
-<a name="l00152"></a>00152     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00153"></a>00153     {
-<a name="l00154"></a>00154         cpl_msg_error(__func__,
-<a name="l00155"></a>00155                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00156"></a>00156         <span class="keywordflow">return</span> -1 ;
-<a name="l00157"></a>00157     }
-<a name="l00158"></a>00158     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0;
-<a name="l00159"></a>00159 }
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161 cpl_error_code
-<a name="l00162"></a>00162 hawki_cal_lingain_fill_parlist_default(cpl_parameterlist * parlist)
-<a name="l00163"></a>00163 {
-<a name="l00164"></a>00164     cpl_parameter   *   p;
-<a name="l00165"></a>00165     cpl_error_code      error ;
-<a name="l00166"></a>00166         
-<a name="l00167"></a>00167     error=irplib_detmon_lg_fill_parlist_nir_default(parlist,
-<a name="l00168"></a>00168             RECIPE_NAME, PACKAGE_TARNAME);
-<a name="l00169"></a>00169     cpl_ensure_code(!error, error);
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     <span class="comment">/* Set to reduce all extensions */</span>
-<a name="l00172"></a>00172     p = cpl_parameterlist_find(parlist, PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME 
-<a name="l00173"></a>00173             <span class="stringliteral">".exts"</span>);
-<a name="l00174"></a>00174     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00175"></a>00175     error = cpl_parameter_set_default_int(p, -1);
-<a name="l00176"></a>00176     cpl_ensure_code(!error, error);
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00180"></a>00180 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_lingain.c,v 1.4 2010/09/28 14:13:48 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 CRIRES Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/09/28 14:13:48 $</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: hawki-1_8_12 $</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="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                             Includes and Defines</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> </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 "irplib_detmon_lg.h"</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include "irplib_detmon.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "irplib_plugin.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 "hawki_dfs.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 RECIPE_NAME "hawki_cal_lingain"</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> <span class="comment">/* Copy here instrument specific keywords which need to be in the PAF file */</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#define INSTREGEXP   "ESO INS SETUP ID"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define PAFREGEXP    "^(" REGEXP "|" INSTREGEXP ")$"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor"></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="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">                 Functions prototypes</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> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> cpl_error_code hawki_cal_lingain_fill_parlist_default(cpl_parameterlist * parlist);</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> IRPLIB_RECIPE_DEFINE(hawki_cal_lingain, HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>         hawki_cal_lingain_fill_parlist_default(recipe->parameters),</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>         <span class="stringliteral">"Enrique Garcia"</span>, PACKAGE_BUGREPORT, <span class="stringliteral">"2009"</span>, </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>         <span class="stringliteral">"Linearity/Gain recipe for the IR domain"</span>,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>         irplib_detmon_lg_get_description(RECIPE_NAME, <span class="stringliteral">"HAWKI"</span>, </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                          HAWKI_CAL_LINGAIN_LAMP_RAW,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                                          HAWKI_CAL_LINGAIN_DARK_RAW));</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="comment">  @brief    Interpret the command line options and execute the data processing</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="comment">  @param    frameset    the frames list</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="comment">  @param    parlist     the parameters list</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="comment">  @return   0 if everything is ok</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="comment">/*---------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_lingain(cpl_frameset            * frameset,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                              <span class="keyword">const</span> cpl_parameterlist * parlist)</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>     cpl_error_code        error ;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_propertylist  *   pro_lintbl ;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cpl_propertylist  *   pro_gaintbl ;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     cpl_propertylist  *   pro_coeffscube ;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     cpl_propertylist  *   pro_bpm ;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     cpl_propertylist  *   pro_corr ;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     cpl_propertylist  *   pro_diff ;</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">/* Create the PRO keys propertylist */</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     pro_lintbl = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     cpl_propertylist_append_string(pro_lintbl, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>             HAWKI_CALPRO_LINGAIN_LIN) ;</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_propertylist_append_string(pro_lintbl, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>             HAWKI_PROTYPE_LIN_STATS) ;</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>     pro_gaintbl = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     cpl_propertylist_append_string(pro_gaintbl, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>             HAWKI_CALPRO_LINGAIN_GAIN) ;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_propertylist_append_string(pro_gaintbl, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>             HAWKI_PROTYPE_GAIN_STATS) ;</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>     pro_coeffscube = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_propertylist_append_string(pro_coeffscube, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>             HAWKI_CALPRO_LINGAIN_COEFFS) ;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_propertylist_append_string(pro_coeffscube, CPL_DFS_PRO_TYPE, </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             HAWKI_PROTYPE_LIN_COEFFS) ;</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>     pro_bpm = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     cpl_propertylist_append_string(pro_bpm, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>             HAWKI_CALPRO_LINGAIN_BPM) ;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     cpl_propertylist_append_string(pro_bpm, CPL_DFS_PRO_TYPE, </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>             HAWKI_PROTYPE_BPM_LEVELS) ;</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>     pro_corr = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_propertylist_append_string(pro_corr, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>             HAWKI_CALPRO_LINGAIN_CORR) ;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     cpl_propertylist_append_string(pro_corr, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>             HAWKI_PROTYPE_LINGAIN_CORR) ;</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>     pro_diff = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     cpl_propertylist_append_string(pro_diff, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>             HAWKI_CALPRO_LINGAIN_DIFF) ;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_propertylist_append_string(pro_diff, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>             HAWKI_PROTYPE_LINGAIN_DIFF) ;</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">/* Call the lingain function */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     error = irplib_detmon_lg(frameset,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             parlist,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>             HAWKI_CAL_LINGAIN_LAMP_RAW,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>             HAWKI_CAL_LINGAIN_DARK_RAW,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>             RECIPE_NAME,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>             PACKAGE_TARNAME,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>             PAFREGEXP,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>             pro_lintbl, </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>             pro_gaintbl, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>             pro_coeffscube, </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>             pro_bpm, </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>             pro_corr, </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>             pro_diff,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>             PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>             NULL, NULL, TRUE);</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="comment">/* Delete the PRO keys propertylist */</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_propertylist_delete(pro_lintbl) ;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_propertylist_delete(pro_gaintbl) ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_propertylist_delete(pro_coeffscube) ;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_propertylist_delete(pro_bpm) ;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_propertylist_delete(pro_corr) ;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     cpl_propertylist_delete(pro_diff) ;</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">/* Propagate the error, if any */</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_ensure_code(!error, error);</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">/* Return */</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>         <span class="keywordflow">return</span> -1 ;</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="keywordflow">else</span> <span class="keywordflow">return</span> 0;</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="l00161"></a><span class="lineno">  161</span> cpl_error_code</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> hawki_cal_lingain_fill_parlist_default(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>     cpl_parameter   *   p;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     cpl_error_code      error ;</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>     error=irplib_detmon_lg_fill_parlist_nir_default(parlist,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>             RECIPE_NAME, PACKAGE_TARNAME);</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>     <span class="comment">/* Set to reduce all extensions */</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     p = cpl_parameterlist_find(parlist, PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>             <span class="stringliteral">".exts"</span>);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     error = cpl_parameter_set_default_int(p, -1);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cpl_ensure_code(!error, error);</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>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</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/hawki__cal__zpoint_8c_source.html b/html/hawki__cal__zpoint_8c_source.html
index 14c6c52..3954523 100644
--- a/html/hawki__cal__zpoint_8c_source.html
+++ b/html/hawki__cal__zpoint_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_cal_zpoint.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,1838 +40,1844 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_cal_zpoint.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_cal_zpoint.c,v 1.34 2012/04/23 09:58: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/04/23 09:58:56 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.34 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_calib.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "irplib_strehl.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "irplib_stdstar.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "irplib_cat.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "irplib_wcs.h"</span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00053"></a>00053 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00054"></a>00054 <span class="preprocessor">#include "hawki_alloc.h"</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00057"></a>00057 <span class="comment">                            Functions prototypes</span>
-<a name="l00058"></a>00058 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_create(cpl_plugin *) ;
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_exec(cpl_plugin *) ;
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_destroy(cpl_plugin *) ;
-<a name="l00063"></a>00063 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_cal_zpoint_output_init(<span class="keywordtype">void</span>);
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_retrieve_input_param
-<a name="l00067"></a>00067 (cpl_parameterlist  *  parlist);
-<a name="l00068"></a>00068 <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_reduce
-<a name="l00069"></a>00069 (cpl_frameset    *   <span class="keyword">set</span>,
-<a name="l00070"></a>00070  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,
-<a name="l00071"></a>00071  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,
-<a name="l00072"></a>00072  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,
-<a name="l00073"></a>00073  cpl_table       **  raw_zpoint_stats,
-<a name="l00074"></a>00074  <span class="keywordtype">int</span>             *   labels,
-<a name="l00075"></a>00075  cpl_imagelist   **  images);
-<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_save
-<a name="l00077"></a>00077 (cpl_table           **  zpoint_tables,
-<a name="l00078"></a>00078  <span class="keywordtype">int</span>                 *   labels,
-<a name="l00079"></a>00079  cpl_imagelist       *   images,
-<a name="l00080"></a>00080  cpl_table           **  raw_zpoint_stats,
-<a name="l00081"></a>00081  cpl_frameset        *   zpoint_frames,
-<a name="l00082"></a>00082  cpl_frameset        *   calib_frames,
-<a name="l00083"></a>00083  <span class="keyword">const</span> cpl_frame     *   stars_frame,
-<a name="l00084"></a>00084  cpl_parameterlist   *   parlist,
-<a name="l00085"></a>00085  cpl_frameset        *   <span class="keyword">set</span>);
-<a name="l00086"></a>00086 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_qc
-<a name="l00087"></a>00087 (cpl_propertylist *   qcmainparams, 
-<a name="l00088"></a>00088  cpl_propertylist **  qcextparams,
-<a name="l00089"></a>00089  cpl_frameset     *   <span class="keyword">set</span>);
-<a name="l00090"></a>00090 <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_photom
-<a name="l00091"></a>00091 (cpl_imagelist       *   ilist,
-<a name="l00092"></a>00092  cpl_bivector        *   pos,
-<a name="l00093"></a>00093  <span class="keywordtype">int</span>                 *   labels);
-<a name="l00094"></a>00094 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_get_mag(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, hawki_band) ;
-<a name="l00095"></a>00095 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_keywords
-<a name="l00096"></a>00096 (cpl_frameset * <span class="keyword">set</span>, 
-<a name="l00097"></a>00097  <span class="keywordtype">int</span>          * labels);
-<a name="l00098"></a>00098 <span class="keyword">static</span> cpl_error_code  hawki_cal_zpoint_get_expected_pos
-<a name="l00099"></a>00099 (cpl_frameset * <span class="keyword">set</span>,
-<a name="l00100"></a>00100  <span class="keywordtype">int</span>          * labels);
-<a name="l00101"></a>00101 <span class="keywordtype">int</span> hawki_cal_zpoint_check_epoch_equinox(cpl_propertylist * plist);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00104"></a>00104 <span class="comment">                            Static variables</span>
-<a name="l00105"></a>00105 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00108"></a>00108     <span class="comment">/* Inputs */</span>
-<a name="l00109"></a>00109     <span class="keywordtype">double</span>      xcoord[HAWKI_NB_DETECTORS] ;
-<a name="l00110"></a>00110     <span class="keywordtype">double</span>      ycoord[HAWKI_NB_DETECTORS] ;
-<a name="l00111"></a>00111     <span class="keywordtype">double</span>      target_ra;
-<a name="l00112"></a>00112     <span class="keywordtype">double</span>      target_dec;
-<a name="l00113"></a>00113     <span class="keywordtype">double</span>      stdstar_given_magnitude;
-<a name="l00114"></a>00114     <span class="keywordtype">double</span>      detect_sigma ;
-<a name="l00115"></a>00115     <span class="keywordtype">int</span>         sx ;
-<a name="l00116"></a>00116     <span class="keywordtype">int</span>         sy ;
-<a name="l00117"></a>00117     <span class="keywordtype">double</span>      phot_star_radius ;
-<a name="l00118"></a>00118     <span class="keywordtype">double</span>      phot_bg_r1 ;
-<a name="l00119"></a>00119     <span class="keywordtype">double</span>      phot_bg_r2 ;
-<a name="l00120"></a>00120 } hawki_cal_zpoint_config;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 <span class="keyword">static</span> <span class="keyword">struct </span>{
-<a name="l00123"></a>00123     <span class="comment">/* Outputs */</span>
-<a name="l00124"></a>00124     <span class="keywordtype">double</span>      dit;
-<a name="l00125"></a>00125     <span class="keywordtype">double</span>      pixscale;
-<a name="l00126"></a>00126     <span class="keywordtype">char</span>        filter[512];
-<a name="l00127"></a>00127     hawki_band  band;
-<a name="l00128"></a>00128     <span class="keywordtype">char</span>        starname[512];
-<a name="l00129"></a>00129     <span class="keywordtype">char</span>        sptype[512];
-<a name="l00130"></a>00130     <span class="keywordtype">char</span>        catalog[512];
-<a name="l00131"></a>00131     <span class="keywordtype">double</span>      humidity;
-<a name="l00132"></a>00132     <span class="keywordtype">double</span>      airmass[HAWKI_NB_DETECTORS];
-<a name="l00133"></a>00133     <span class="keywordtype">double</span>      zpoint[HAWKI_NB_DETECTORS];
-<a name="l00134"></a>00134     <span class="keywordtype">double</span>      atx0[HAWKI_NB_DETECTORS];
-<a name="l00135"></a>00135     <span class="keywordtype">double</span>      posx[HAWKI_NB_DETECTORS];
-<a name="l00136"></a>00136     <span class="keywordtype">double</span>      posy[HAWKI_NB_DETECTORS];
-<a name="l00137"></a>00137     <span class="keywordtype">double</span>      flux[HAWKI_NB_DETECTORS];
-<a name="l00138"></a>00138     <span class="keywordtype">double</span>      instrmag[HAWKI_NB_DETECTORS];
-<a name="l00139"></a>00139     <span class="keywordtype">double</span>      peak[HAWKI_NB_DETECTORS];
-<a name="l00140"></a>00140     <span class="keywordtype">double</span>      bgd[HAWKI_NB_DETECTORS];
-<a name="l00141"></a>00141     <span class="keywordtype">double</span>      fwhmx[HAWKI_NB_DETECTORS];
-<a name="l00142"></a>00142     <span class="keywordtype">double</span>      fwhmy[HAWKI_NB_DETECTORS];
-<a name="l00143"></a>00143     <span class="keywordtype">double</span>      fwhm[HAWKI_NB_DETECTORS];
-<a name="l00144"></a>00144     <span class="keywordtype">double</span>      fwhmx_as[HAWKI_NB_DETECTORS];
-<a name="l00145"></a>00145     <span class="keywordtype">double</span>      fwhmy_as[HAWKI_NB_DETECTORS];
-<a name="l00146"></a>00146     <span class="keywordtype">double</span>      fwhm_as[HAWKI_NB_DETECTORS];
-<a name="l00147"></a>00147     <span class="keywordtype">double</span>      mean_zpoint;
-<a name="l00148"></a>00148     <span class="keywordtype">double</span>      mean_atx0;
-<a name="l00149"></a>00149     <span class="keywordtype">double</span>      mean_airmass;
-<a name="l00150"></a>00150     <span class="keywordtype">double</span>      ext_coeff;
-<a name="l00151"></a>00151     <span class="keywordtype">double</span>      stdstar_ra;
-<a name="l00152"></a>00152     <span class="keywordtype">double</span>      stdstar_dec;
-<a name="l00153"></a>00153     <span class="keywordtype">double</span>      stdstar_mag_filter;
-<a name="l00154"></a>00154     <span class="keywordtype">double</span>      stdstar_mag_H;
-<a name="l00155"></a>00155     <span class="keywordtype">double</span>      stdstar_mag_J;
-<a name="l00156"></a>00156     <span class="keywordtype">double</span>      stdstar_mag_K;
-<a name="l00157"></a>00157     <span class="keywordtype">double</span>      stdstar_mag_Y;
-<a name="l00158"></a>00158     <span class="keywordtype">int</span>         stdstar_incat_found;
-<a name="l00159"></a>00159     <span class="keywordtype">int</span>         stdstar_mag_available;
-<a name="l00160"></a>00160     <span class="keywordtype">int</span>         stdstar_image_detected[HAWKI_NB_DETECTORS];
-<a name="l00161"></a>00161     <span class="keywordtype">int</span>         zpoint_computable[HAWKI_NB_DETECTORS];
-<a name="l00162"></a>00162     <span class="keywordtype">int</span>         zpoint_mean_computable;
-<a name="l00163"></a>00163 } hawki_cal_zpoint_outputs;
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_zpoint_description[] =
-<a name="l00166"></a>00166 <span class="stringliteral">"hawki_cal_zpoint -- Zero point recipe\n"</span>
-<a name="l00167"></a>00167 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00168"></a>00168 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00169"></a>00169 <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_ZPOINT_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00170"></a>00170 <span class="stringliteral">"stdstars-file.fits "</span>HAWKI_CALPRO_STDSTARS<span class="stringliteral">" or\n"</span>
-<a name="l00171"></a>00171 <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span>
-<a name="l00172"></a>00172 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</span>
-<a name="l00173"></a>00173 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00174"></a>00174 <span class="stringliteral">"hawki_cal_zpoint.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): Zero point solution table\n"</span>
-<a name="l00175"></a>00175 <span class="stringliteral">"hawki_cal_zpoint_check.fits ("</span>HAWKI_CALPRO_ZPOINT_IMA<span class="stringliteral">"): Standard star images corrected (for checking purposes)\n"</span>
-<a name="l00176"></a>00176 <span class="stringliteral">"hawki_cal_zpoint_stats.fits ("</span>HAWKI_CALPRO_ZPOINT_STATS<span class="stringliteral">"): Statistics of the raw standard star images\n"</span>
-<a name="l00177"></a>00177 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00178"></a>00178 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00179"></a>00179 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00182"></a>00182 <span class="comment">                                Functions code</span>
-<a name="l00183"></a>00183 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00193"></a>00193 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00194"></a>00194 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00195"></a>00195 {
-<a name="l00196"></a>00196     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe));
-<a name="l00197"></a>00197     cpl_plugin  *   plugin = &recipe->interface;
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     cpl_plugin_init(plugin,
-<a name="l00200"></a>00200                     CPL_PLUGIN_API,
-<a name="l00201"></a>00201                     HAWKI_BINARY_VERSION,
-<a name="l00202"></a>00202                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00203"></a>00203                     <span class="stringliteral">"hawki_cal_zpoint"</span>,
-<a name="l00204"></a>00204                     <span class="stringliteral">"Zero point computation recipe"</span>,
-<a name="l00205"></a>00205                     hawki_cal_zpoint_description,
-<a name="l00206"></a>00206                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00207"></a>00207                     PACKAGE_BUGREPORT,
-<a name="l00208"></a>00208                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00209"></a>00209                     hawki_cal_zpoint_create,
-<a name="l00210"></a>00210                     hawki_cal_zpoint_exec,
-<a name="l00211"></a>00211                     hawki_cal_zpoint_destroy) ;
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     cpl_pluginlist_append(list, plugin) ;
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     <span class="keywordflow">return</span> 0;
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00227"></a>00227 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00228"></a>00228 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_create(cpl_plugin * plugin)
-<a name="l00229"></a>00229 {
-<a name="l00230"></a>00230     cpl_recipe      * recipe ;
-<a name="l00231"></a>00231     cpl_parameter   * p ;
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00234"></a>00234     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00235"></a>00235         recipe = (cpl_recipe *)plugin ;
-<a name="l00236"></a>00236     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00239"></a>00239     recipe->parameters = cpl_parameterlist_new();
-<a name="l00240"></a>00240     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00241"></a>00241         <span class="keywordflow">return</span> 1;
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00244"></a>00244     <span class="comment">/* --detect_sigma */</span>
-<a name="l00245"></a>00245     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.detect_sigma"</span>,
-<a name="l00246"></a>00246             CPL_TYPE_DOUBLE, <span class="stringliteral">"the sigma value for object detection"</span>,
-<a name="l00247"></a>00247             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 7.0);
-<a name="l00248"></a>00248     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"detect_sigma"</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     <span class="comment">/* --star_r */</span>
-<a name="l00252"></a>00252     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.star_r"</span>,CPL_TYPE_DOUBLE,
-<a name="l00253"></a>00253             <span class="stringliteral">"the star radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.0) ;
-<a name="l00254"></a>00254     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"star_r"</span>) ;
-<a name="l00255"></a>00255     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00256"></a>00256     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00257"></a>00257     <span class="comment">/* --bg_r1 */</span>
-<a name="l00258"></a>00258     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r1"</span>, CPL_TYPE_DOUBLE,
-<a name="l00259"></a>00259             <span class="stringliteral">"the internal background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.0) ;
-<a name="l00260"></a>00260     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r1"</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     <span class="comment">/* --bg_r2 */</span>
-<a name="l00264"></a>00264     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r2"</span>, CPL_TYPE_DOUBLE,
-<a name="l00265"></a>00265             <span class="stringliteral">"the external background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.0) ;
-<a name="l00266"></a>00266     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r2"</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     <span class="comment">/* --ra */</span>
-<a name="l00270"></a>00270     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.ra"</span>, CPL_TYPE_DOUBLE,
-<a name="l00271"></a>00271             <span class="stringliteral">"RA in degrees"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 999.0) ;
-<a name="l00272"></a>00272     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ra"</span>) ;
-<a name="l00273"></a>00273     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00274"></a>00274     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00275"></a>00275     <span class="comment">/* --dec */</span>
-<a name="l00276"></a>00276     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.dec"</span>, CPL_TYPE_DOUBLE,
-<a name="l00277"></a>00277             <span class="stringliteral">"DEC in degrees"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 999.0) ;
-<a name="l00278"></a>00278     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dec"</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     <span class="comment">/* --mag */</span>
-<a name="l00282"></a>00282     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.mag"</span>, CPL_TYPE_DOUBLE,
-<a name="l00283"></a>00283             <span class="stringliteral">"magnitude"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 99.0) ;
-<a name="l00284"></a>00284     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"mag"</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     <span class="comment">/* --sx */</span>
-<a name="l00288"></a>00288     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.sx"</span>, CPL_TYPE_INT,
-<a name="l00289"></a>00289             <span class="stringliteral">"x half-size of the search box"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 100) ;
-<a name="l00290"></a>00290     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sx"</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     <span class="comment">/* --sy */</span>
-<a name="l00294"></a>00294     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.sy"</span>, CPL_TYPE_INT,
-<a name="l00295"></a>00295             <span class="stringliteral">"y half-size of the search box"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 100) ;
-<a name="l00296"></a>00296     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sy"</span>) ;
-<a name="l00297"></a>00297     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00298"></a>00298     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00299"></a>00299     <span class="comment">/* --xcoord */</span>
-<a name="l00300"></a>00300     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.xcoord"</span>, CPL_TYPE_STRING,
-<a name="l00301"></a>00301             <span class="stringliteral">"Coordinates in X where the standard star is located. If -1 use WCS"</span>,
-<a name="l00302"></a>00302             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, <span class="stringliteral">"-1., -1., -1., -1."</span>);
-<a name="l00303"></a>00303     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcoord"</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     <span class="comment">/* --ycoord */</span>
-<a name="l00307"></a>00307     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.ycoord"</span>, CPL_TYPE_STRING,
-<a name="l00308"></a>00308             <span class="stringliteral">"Coordinates in Y where the standard star is located. If -1 use WCS"</span>,
-<a name="l00309"></a>00309             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, <span class="stringliteral">"-1., -1., -1., -1."</span>) ;
-<a name="l00310"></a>00310     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ycoord"</span>) ;
-<a name="l00311"></a>00311     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00312"></a>00312     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00324"></a>00324 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00325"></a>00325 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_exec(cpl_plugin * plugin)
-<a name="l00326"></a>00326 {
-<a name="l00327"></a>00327     cpl_recipe  *   recipe ;
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00330"></a>00330     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00331"></a>00331         recipe = (cpl_recipe *)plugin ;
-<a name="l00332"></a>00332     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/* Issue a banner */</span>
-<a name="l00335"></a>00335     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="keywordflow">return</span> hawki_cal_zpoint(recipe->parameters, recipe->frames) ;
-<a name="l00338"></a>00338 }
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00346"></a>00346 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00347"></a>00347 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_destroy(cpl_plugin * plugin)
-<a name="l00348"></a>00348 {
-<a name="l00349"></a>00349     cpl_recipe  *   recipe ;
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00352"></a>00352     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00353"></a>00353         recipe = (cpl_recipe *)plugin ;
-<a name="l00354"></a>00354     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00357"></a>00357     <span class="keywordflow">return</span> 0 ;
-<a name="l00358"></a>00358 }
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00367"></a>00367 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00368"></a>00368 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint(
-<a name="l00369"></a>00369         cpl_parameterlist   *   parlist,
-<a name="l00370"></a>00370         cpl_frameset        *   framelist)
-<a name="l00371"></a>00371 {
-<a name="l00372"></a>00372     cpl_parameter   *   par ;
-<a name="l00373"></a>00373     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat ;
-<a name="l00374"></a>00374     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm ;
-<a name="l00375"></a>00375     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars ;
-<a name="l00376"></a>00376     cpl_frameset    *   zpoint_frames ;
-<a name="l00377"></a>00377     cpl_frameset    *   calib_frames ;
-<a name="l00378"></a>00378     <span class="keyword">const</span> cpl_frame *   stars_frame;
-<a name="l00379"></a>00379     cpl_table       **  raw_zpoint_stats;
-<a name="l00380"></a>00380     cpl_table       **  zpoint_tables;
-<a name="l00381"></a>00381     cpl_imagelist   *   std_star_images ;
-<a name="l00382"></a>00382     <span class="keywordtype">int</span>             *   labels;
-<a name="l00383"></a>00383     <span class="keywordtype">int</span>                 idet;
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="comment">/* Initialise Output */</span>
-<a name="l00386"></a>00386     hawki_cal_zpoint_output_init();
-<a name="l00387"></a>00387     zpoint_frames = NULL ;
-<a name="l00388"></a>00388     par = NULL ;
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00391"></a>00391     <span class="keywordflow">if</span>(hawki_cal_zpoint_retrieve_input_param(parlist))
-<a name="l00392"></a>00392     {
-<a name="l00393"></a>00393         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00394"></a>00394         <span class="keywordflow">return</span> -1;
-<a name="l00395"></a>00395     }
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00398"></a>00398     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00399"></a>00399         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00400"></a>00400         <span class="keywordflow">return</span> -1 ;
-<a name="l00401"></a>00401     }
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     <span class="comment">/* Retrieve calibration data */</span>
-<a name="l00404"></a>00404     calib_frames = cpl_frameset_new();
-<a name="l00405"></a>00405     flat = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_FLAT) ;
-<a name="l00406"></a>00406     <span class="keywordflow">if</span>(flat)
-<a name="l00407"></a>00407         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(
-<a name="l00408"></a>00408                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT)));
-<a name="l00409"></a>00409     bpm = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_BPM) ;
-<a name="l00410"></a>00410     <span class="keywordflow">if</span>(bpm)
-<a name="l00411"></a>00411         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(
-<a name="l00412"></a>00412                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM)));
-<a name="l00413"></a>00413 
-<a name="l00414"></a>00414     <span class="comment">/* STD stars catalog requested */</span>
-<a name="l00415"></a>00415     stars_frame = cpl_frameset_find_const(framelist, HAWKI_CALPRO_STDSTARS);
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (stars_frame  == NULL) 
-<a name="l00417"></a>00417     {
-<a name="l00418"></a>00418         cpl_msg_error(__func__,<span class="stringliteral">"Cannot find the catalog in the input list (%s)"</span>,
-<a name="l00419"></a>00419                       HAWKI_CALPRO_STDSTARS);
-<a name="l00420"></a>00420         cpl_frameset_delete(calib_frames);
-<a name="l00421"></a>00421         <span class="keywordflow">return</span> -1 ;
-<a name="l00422"></a>00422     }
-<a name="l00423"></a>00423     stdstars = cpl_frame_get_filename(stars_frame);
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00426"></a>00426     <span class="keywordflow">if</span> ((zpoint_frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,
-<a name="l00427"></a>00427                     HAWKI_CAL_ZPOINT_RAW)) != NULL) {
-<a name="l00428"></a>00428     } <span class="keywordflow">else</span> {
-<a name="l00429"></a>00429         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list (%s)"</span>,
-<a name="l00430"></a>00430                       HAWKI_CAL_ZPOINT_RAW);
-<a name="l00431"></a>00431         cpl_frameset_delete(calib_frames);
-<a name="l00432"></a>00432         <span class="keywordflow">return</span> -1 ;
-<a name="l00433"></a>00433     }
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     <span class="comment">/* Exactly 4 images are expected */</span>
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (cpl_frameset_get_size(zpoint_frames) != 4) {
-<a name="l00437"></a>00437         cpl_msg_error(__func__, 
-<a name="l00438"></a>00438                       <span class="stringliteral">"4 input raw frames are expected, not %"</span>CPL_SIZE_FORMAT,
-<a name="l00439"></a>00439                       cpl_frameset_get_size(zpoint_frames)) ;
-<a name="l00440"></a>00440         cpl_frameset_delete(zpoint_frames) ;
-<a name="l00441"></a>00441         cpl_frameset_delete(calib_frames);
-<a name="l00442"></a>00442         <span class="keywordflow">return</span> -1 ;
-<a name="l00443"></a>00443     }
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     <span class="comment">/* Create the statistics table */</span>
-<a name="l00446"></a>00446     raw_zpoint_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00447"></a>00447     <span class="keywordflow">for</span>(idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00448"></a>00448     {
-<a name="l00449"></a>00449         raw_zpoint_stats[idet] = cpl_table_new(
-<a name="l00450"></a>00450             cpl_frameset_get_size(zpoint_frames));
-<a name="l00451"></a>00451     }
-<a name="l00452"></a>00452     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_zpoint_stats);
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454     <span class="comment">/* Compute the zpoint values */</span>
-<a name="l00455"></a>00455     cpl_msg_info(__func__, <span class="stringliteral">"Reduce the data"</span>) ;
-<a name="l00456"></a>00456     cpl_msg_indent_more() ;
-<a name="l00457"></a>00457     labels = cpl_calloc(cpl_frameset_get_size(zpoint_frames), <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)) ;
-<a name="l00458"></a>00458     <span class="keywordflow">if</span> ((zpoint_tables = hawki_cal_zpoint_reduce(zpoint_frames, stdstars, 
-<a name="l00459"></a>00459              bpm, flat, raw_zpoint_stats, labels, &std_star_images))==NULL)
-<a name="l00460"></a>00460     {
-<a name="l00461"></a>00461         cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce the data"</span>) ;
-<a name="l00462"></a>00462         cpl_frameset_delete(zpoint_frames) ;
-<a name="l00463"></a>00463         cpl_frameset_delete(calib_frames);
-<a name="l00464"></a>00464         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);
-<a name="l00465"></a>00465         cpl_free(labels);
-<a name="l00466"></a>00466         cpl_msg_indent_less() ;
-<a name="l00467"></a>00467         <span class="keywordflow">return</span> -1 ;
-<a name="l00468"></a>00468     }
-<a name="l00469"></a>00469     cpl_msg_indent_less() ;
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     <span class="comment">/* Save the products */</span>
-<a name="l00472"></a>00472     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00473"></a>00473     cpl_msg_indent_more() ;
-<a name="l00474"></a>00474     <span class="keywordflow">if</span> (hawki_cal_zpoint_save
-<a name="l00475"></a>00475             (zpoint_tables, labels, std_star_images, raw_zpoint_stats, 
-<a name="l00476"></a>00476              zpoint_frames, calib_frames, stars_frame,
-<a name="l00477"></a>00477              parlist, framelist) == -1)
-<a name="l00478"></a>00478     {
-<a name="l00479"></a>00479         cpl_msg_warning(__func__, <span class="stringliteral">"Data could not be saved. "</span>
-<a name="l00480"></a>00480                         <span class="stringliteral">"Check permisions or disk space"</span>) ;
-<a name="l00481"></a>00481         cpl_frameset_delete(zpoint_frames);
-<a name="l00482"></a>00482         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables) ;
-<a name="l00483"></a>00483         cpl_imagelist_delete(std_star_images) ;
-<a name="l00484"></a>00484         cpl_frameset_delete(calib_frames);
-<a name="l00485"></a>00485         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);
-<a name="l00486"></a>00486         cpl_free(labels);
-<a name="l00487"></a>00487         cpl_msg_indent_less() ;
-<a name="l00488"></a>00488         <span class="keywordflow">return</span> -1 ;
-<a name="l00489"></a>00489     }
-<a name="l00490"></a>00490     cpl_msg_indent_less() ;
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492     <span class="comment">/* Free and return */</span>
-<a name="l00493"></a>00493     cpl_frameset_delete(zpoint_frames);
-<a name="l00494"></a>00494     cpl_frameset_delete(calib_frames);
-<a name="l00495"></a>00495     cpl_imagelist_delete(std_star_images);
-<a name="l00496"></a>00496     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables);
-<a name="l00497"></a>00497     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);
-<a name="l00498"></a>00498     cpl_free(labels);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     <span class="comment">/* Return */</span>
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00502"></a>00502     {
-<a name="l00503"></a>00503         cpl_msg_error(__func__,
-<a name="l00504"></a>00504                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00505"></a>00505         <span class="keywordflow">return</span> -1 ;
-<a name="l00506"></a>00506     }
-<a name="l00507"></a>00507     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00508"></a>00508 }
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00520"></a>00520 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00521"></a>00521 <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_reduce
-<a name="l00522"></a>00522 (cpl_frameset    *   <span class="keyword">set</span>,
-<a name="l00523"></a>00523  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,
-<a name="l00524"></a>00524  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,
-<a name="l00525"></a>00525  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,
-<a name="l00526"></a>00526  cpl_table       **  raw_zpoint_stats,
-<a name="l00527"></a>00527  <span class="keywordtype">int</span>             *   labels,
-<a name="l00528"></a>00528  cpl_imagelist   **  star_images)
-<a name="l00529"></a>00529 {
-<a name="l00530"></a>00530     cpl_frame           *   cur_frame ;
-<a name="l00531"></a>00531     cpl_propertylist    *   plist ;
-<a name="l00532"></a>00532     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;
-<a name="l00533"></a>00533     cpl_imagelist       *   star_images_frame_order ;
-<a name="l00534"></a>00534     <span class="keywordtype">int</span>                     nima ;
-<a name="l00535"></a>00535     cpl_bivector        *   positions ;
-<a name="l00536"></a>00536     cpl_image           *   filt_ima ;
-<a name="l00537"></a>00537     cpl_mask            *   kernel;
-<a name="l00538"></a>00538     <span class="keywordtype">int</span>                     size_x, size_y ;
-<a name="l00539"></a>00539     <span class="keywordtype">double</span>                  pos_x, pos_y, pos_x_cen, pos_y_cen, dist, min_dist ;
-<a name="l00540"></a>00540     cpl_apertures       *   aperts ;
-<a name="l00541"></a>00541     cpl_table           **  zpoint_tables;
-<a name="l00542"></a>00542     cpl_image           *   tmp_ima ;
-<a name="l00543"></a>00543     <span class="keywordtype">int</span>                     iaper;
-<a name="l00544"></a>00544     <span class="keywordtype">int</span>                     idet;
-<a name="l00545"></a>00545     <span class="keywordtype">int</span>                     iframe;
-<a name="l00546"></a>00546     <span class="keywordtype">int</span>                     iframe_star = -1;
-<a name="l00547"></a>00547     <span class="keywordtype">int</span>                     nframes;
-<a name="l00548"></a>00548     <span class="keywordtype">char</span>                    rastr[32];
-<a name="l00549"></a>00549     <span class="keywordtype">char</span>                    decstr[32];
-<a name="l00550"></a>00550     cpl_errorstate          error_prevstate;
-<a name="l00551"></a>00551     <span class="keywordtype">int</span>                     return_code;
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553     <span class="comment">/* Check inputs */</span>
-<a name="l00554"></a>00554     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00555"></a>00555     <span class="keywordflow">if</span> (stdstars == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00556"></a>00556     <span class="keywordflow">if</span> (star_images == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558     <span class="comment">/* Get the filter name, DIT, Target RA and DEC  */</span>
-<a name="l00559"></a>00559     error_prevstate = cpl_errorstate_get();
-<a name="l00560"></a>00560     cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, 0) ;
-<a name="l00561"></a>00561     plist=cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0) ;
-<a name="l00562"></a>00562     <span class="keywordflow">if</span> ((sval = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist)) == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00563"></a>00563     <span class="keywordflow">else</span> sprintf(hawki_cal_zpoint_outputs.filter, sval) ;
-<a name="l00564"></a>00564     <span class="keywordflow">if</span> (hawki_cal_zpoint_config.target_ra > 998.0)
-<a name="l00565"></a>00565     {
-<a name="l00566"></a>00566         hawki_cal_zpoint_config.target_ra = <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(plist);
-<a name="l00567"></a>00567         <span class="comment">//hawki_cal_zpoint_config.target_ra = hawki_pfits_get_ra(plist) -</span>
-<a name="l00568"></a>00568         <span class="comment">//hawki_pfits_get_cumoffseta(plist) / 3600.;// Not valid before Nov 2008</span>
-<a name="l00569"></a>00569         <span class="keywordflow">if</span>(hawki_cal_zpoint_check_epoch_equinox(plist) == -1)
-<a name="l00570"></a>00570         {
-<a name="l00571"></a>00571             cpl_propertylist_delete(plist);
-<a name="l00572"></a>00572             <span class="keywordflow">return</span> NULL;
-<a name="l00573"></a>00573         }
-<a name="l00574"></a>00574     }
-<a name="l00575"></a>00575     <span class="keywordflow">if</span> (hawki_cal_zpoint_config.target_dec > 998.0)
-<a name="l00576"></a>00576     {
-<a name="l00577"></a>00577         hawki_cal_zpoint_config.target_dec = <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(plist);
-<a name="l00578"></a>00578         <span class="comment">//hawki_cal_zpoint_config.target_dec = hawki_pfits_get_dec(plist) -</span>
-<a name="l00579"></a>00579         <span class="comment">//hawki_pfits_get_cumoffsetd(plist) / 3600.;// Not valid before Nov 2008</span>
-<a name="l00580"></a>00580         <span class="keywordflow">if</span>(hawki_cal_zpoint_check_epoch_equinox(plist) == -1)
-<a name="l00581"></a>00581         {
-<a name="l00582"></a>00582             cpl_propertylist_delete(plist);
-<a name="l00583"></a>00583             <span class="keywordflow">return</span> NULL;
-<a name="l00584"></a>00584         }
-<a name="l00585"></a>00585     }
-<a name="l00586"></a>00586     hawki_cal_zpoint_outputs.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;
-<a name="l00587"></a>00587     hawki_cal_zpoint_outputs.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist) ;
-<a name="l00588"></a>00588     cpl_propertylist_delete(plist) ;
-<a name="l00589"></a>00589     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00590"></a>00590     {
-<a name="l00591"></a>00591         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get keywords from main header:"</span>);
-<a name="l00592"></a>00592         cpl_msg_indent_more();
-<a name="l00593"></a>00593         cpl_msg_error(__func__, <span class="stringliteral">"%s"</span>,cpl_error_get_message());
-<a name="l00594"></a>00594         cpl_msg_indent_less();
-<a name="l00595"></a>00595         <span class="keywordflow">return</span> NULL ;
-<a name="l00596"></a>00596     }
-<a name="l00597"></a>00597     cpl_msg_info(__func__,<span class="stringliteral">"Searching catalog stars closest to target:"</span>);
-<a name="l00598"></a>00598     cpl_msg_indent_more();
-<a name="l00599"></a>00599     <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_config.target_ra);
-<a name="l00600"></a>00600     <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_config.target_dec);
-<a name="l00601"></a>00601     cpl_msg_info(__func__,<span class="stringliteral">"RA = %g (%s); DEC = %g (%s)"</span>,
-<a name="l00602"></a>00602                  hawki_cal_zpoint_config.target_ra, rastr,
-<a name="l00603"></a>00603                  hawki_cal_zpoint_config.target_dec, decstr);
-<a name="l00604"></a>00604     cpl_msg_info(__func__,<span class="stringliteral">"HAWK-I Filter: %s"</span>, hawki_cal_zpoint_outputs.filter);
-<a name="l00605"></a>00605     cpl_msg_indent_less();
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607     <span class="comment">/* Get the band */</span>
-<a name="l00608"></a>00608     <span class="keywordflow">if</span> ((hawki_cal_zpoint_outputs.band =
-<a name="l00609"></a>00609                 <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(hawki_cal_zpoint_outputs.filter)) ==
-<a name="l00610"></a>00610             HAWKI_BAND_UNKNOWN) {
-<a name="l00611"></a>00611         cpl_msg_error(__func__, <span class="stringliteral">"Cannot associate the filter %s to a band"</span>,
-<a name="l00612"></a>00612                 hawki_cal_zpoint_outputs.filter) ;
-<a name="l00613"></a>00613         <span class="keywordflow">return</span> NULL ;
-<a name="l00614"></a>00614     }
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="comment">/* Get the standard star information from database */</span>
-<a name="l00617"></a>00617     cpl_msg_indent_more();
-<a name="l00618"></a>00618     return_code = hawki_cal_zpoint_get_mag(stdstars,
-<a name="l00619"></a>00619             hawki_cal_zpoint_config.target_ra,
-<a name="l00620"></a>00620             hawki_cal_zpoint_config.target_dec,
-<a name="l00621"></a>00621             hawki_cal_zpoint_outputs.band);
-<a name="l00622"></a>00622     <span class="keywordflow">if</span> (return_code == -1)
-<a name="l00623"></a>00623     {
-<a name="l00624"></a>00624         cpl_msg_error(__func__, <span class="stringliteral">"Could not open star database"</span>);
-<a name="l00625"></a>00625         <span class="keywordflow">return</span> NULL ;
-<a name="l00626"></a>00626     }   
-<a name="l00627"></a>00627     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(return_code == 1)
-<a name="l00628"></a>00628     {
-<a name="l00629"></a>00629         cpl_msg_warning(__func__,<span class="stringliteral">"No suitable star found in catalog"</span>);
-<a name="l00630"></a>00630         cpl_msg_warning(__func__,<span class="stringliteral">"Using the target coordinates "</span>
-<a name="l00631"></a>00631                         <span class="stringliteral">"as the standard star coordinates: "</span>);
-<a name="l00632"></a>00632         hawki_cal_zpoint_outputs.stdstar_ra = 
-<a name="l00633"></a>00633                 hawki_cal_zpoint_config.target_ra;
-<a name="l00634"></a>00634         hawki_cal_zpoint_outputs.stdstar_dec = 
-<a name="l00635"></a>00635                 hawki_cal_zpoint_config.target_dec;
-<a name="l00636"></a>00636         <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_outputs.stdstar_ra);
-<a name="l00637"></a>00637         <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_outputs.stdstar_dec);
-<a name="l00638"></a>00638         cpl_msg_info(__func__, <span class="stringliteral">" RA = %g (%s) ; DEC = %g (%s)"</span>,
-<a name="l00639"></a>00639                      hawki_cal_zpoint_outputs.stdstar_ra, rastr,
-<a name="l00640"></a>00640                      hawki_cal_zpoint_outputs.stdstar_dec, decstr);
-<a name="l00641"></a>00641     }
-<a name="l00642"></a>00642     <span class="keywordflow">else</span>
-<a name="l00643"></a>00643     {    
-<a name="l00644"></a>00644         cpl_msg_info(__func__, <span class="stringliteral">"Catalog where the star was found: %s"</span>,
-<a name="l00645"></a>00645                      hawki_cal_zpoint_outputs.catalog);
-<a name="l00646"></a>00646         cpl_msg_info(__func__, <span class="stringliteral">"Star name: %s"</span>,
-<a name="l00647"></a>00647                      hawki_cal_zpoint_outputs.starname);
-<a name="l00648"></a>00648         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)
-<a name="l00649"></a>00649         {
-<a name="l00650"></a>00650             cpl_msg_info(__func__, <span class="stringliteral">"Star magnitude in filter %s : %g [mag]"</span>,
-<a name="l00651"></a>00651                     hawki_cal_zpoint_outputs.filter,
-<a name="l00652"></a>00652                     hawki_cal_zpoint_outputs.stdstar_mag_filter);
-<a name="l00653"></a>00653         }
-<a name="l00654"></a>00654         <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_outputs.stdstar_ra);
-<a name="l00655"></a>00655         <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_outputs.stdstar_dec);
-<a name="l00656"></a>00656         cpl_msg_info(__func__, <span class="stringliteral">"Star coordinates: RA = %g (%s) ; DEC = %g (%s)"</span>,
-<a name="l00657"></a>00657                      hawki_cal_zpoint_outputs.stdstar_ra, rastr,
-<a name="l00658"></a>00658                      hawki_cal_zpoint_outputs.stdstar_dec, decstr);
-<a name="l00659"></a>00659     }
-<a name="l00660"></a>00660     <span class="keywordflow">if</span> (hawki_cal_zpoint_config.stdstar_given_magnitude < 98.0) 
-<a name="l00661"></a>00661     {
-<a name="l00662"></a>00662         hawki_cal_zpoint_outputs.stdstar_mag_available = 1;
-<a name="l00663"></a>00663         hawki_cal_zpoint_outputs.stdstar_mag_filter = 
-<a name="l00664"></a>00664                 hawki_cal_zpoint_config.stdstar_given_magnitude;
-<a name="l00665"></a>00665         cpl_msg_info(__func__, <span class="stringliteral">"Using user defined "</span>
-<a name="l00666"></a>00666                      <span class="stringliteral">"star magnitude in filter %s : %g [mag]"</span>,
-<a name="l00667"></a>00667                      hawki_cal_zpoint_outputs.filter,
-<a name="l00668"></a>00668                      hawki_cal_zpoint_outputs.stdstar_mag_filter);
-<a name="l00669"></a>00669     }
-<a name="l00670"></a>00670     cpl_msg_indent_less();
-<a name="l00671"></a>00671 
-<a name="l00672"></a>00672     <span class="comment">/* Labelise frames */</span>
-<a name="l00673"></a>00673     cpl_msg_info(__func__, <span class="stringliteral">"Guessing which frame the STD is in for each chip"</span>);
-<a name="l00674"></a>00674     <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a>
-<a name="l00675"></a>00675         (<span class="keyword">set</span>, hawki_cal_zpoint_outputs.stdstar_ra,
-<a name="l00676"></a>00676          hawki_cal_zpoint_outputs.stdstar_dec, labels);
-<a name="l00677"></a>00677     <span class="keywordflow">if</span> (labels == NULL)
-<a name="l00678"></a>00678     {
-<a name="l00679"></a>00679         cpl_msg_error(__func__, <span class="stringliteral">"Cannot determine which frame the STD is on"</span>) ;
-<a name="l00680"></a>00680         <span class="keywordflow">return</span> NULL ;
-<a name="l00681"></a>00681     }
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683     <span class="comment">/* Compute the expected position of the star in pixels */</span>
-<a name="l00684"></a>00684     <span class="comment">/* This is stored in hawki_cal_zpoint_config.xcoord, ycoord */</span>
-<a name="l00685"></a>00685     cpl_msg_indent_more();
-<a name="l00686"></a>00686     <span class="keywordflow">if</span>(hawki_cal_zpoint_get_expected_pos(<span class="keyword">set</span>, labels) != CPL_ERROR_NONE)
-<a name="l00687"></a>00687     {
-<a name="l00688"></a>00688         cpl_msg_error(__func__,<span class="stringliteral">"Could not determine where the star is located"</span>);
-<a name="l00689"></a>00689         cpl_msg_indent_less();
-<a name="l00690"></a>00690         <span class="keywordflow">return</span> NULL;
-<a name="l00691"></a>00691     }
-<a name="l00692"></a>00692     cpl_msg_indent_less();
-<a name="l00693"></a>00693     
-<a name="l00694"></a>00694     <span class="comment">/* Fetch the airmass and humidity */</span>
-<a name="l00695"></a>00695     hawki_cal_zpoint_compute_keywords(<span class="keyword">set</span>, labels);
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697     <span class="comment">/* Create the positions vector */</span>
-<a name="l00698"></a>00698     nima = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l00699"></a>00699     positions = cpl_bivector_new(nima) ;
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701     <span class="comment">/* Initialize */</span>
-<a name="l00702"></a>00702     *star_images = cpl_imagelist_new();
-<a name="l00703"></a>00703 
-<a name="l00704"></a>00704     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00705"></a>00705     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l00706"></a>00706     cpl_msg_info(__func__,<span class="stringliteral">"Loop on the chips"</span>);
-<a name="l00707"></a>00707     cpl_msg_indent_more() ;
-<a name="l00708"></a>00708     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00709"></a>00709     {
-<a name="l00710"></a>00710         cpl_imagelist * sky_images;
-<a name="l00711"></a>00711         cpl_image     * star_ima = NULL;
-<a name="l00712"></a>00712         cpl_image     * sky;
-<a name="l00713"></a>00713         cpl_image     * flat_im;
-<a name="l00714"></a>00714         <span class="keywordtype">int</span>             ext_nb;
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716         cpl_msg_info(__func__, <span class="stringliteral">"Loading the chip %d"</span>, idet+1);
-<a name="l00717"></a>00717         cpl_msg_indent_more() ;
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719         <span class="comment">/* Allocate */</span>
-<a name="l00720"></a>00720         sky_images = cpl_imagelist_new();
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722         cpl_msg_indent_more() ;
-<a name="l00723"></a>00723         <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++)
-<a name="l00724"></a>00724         {
-<a name="l00725"></a>00725             cpl_image * ima_cur;
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727             <span class="comment">/* Load the image */</span>
-<a name="l00728"></a>00728             ima_cur = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(<span class="keyword">set</span>, iframe, idet+1, CPL_TYPE_FLOAT) ;
-<a name="l00729"></a>00729             <span class="keywordflow">if</span>(ima_cur == NULL)
-<a name="l00730"></a>00730             {
-<a name="l00731"></a>00731                 cpl_bivector_delete(positions) ;
-<a name="l00732"></a>00732                 cpl_imagelist_delete(*star_images);
-<a name="l00733"></a>00733                 cpl_imagelist_delete(sky_images) ;
-<a name="l00734"></a>00734                 cpl_msg_error(__func__, <span class="stringliteral">"Error reading image"</span>);
-<a name="l00735"></a>00735                 <span class="keywordflow">return</span> NULL;
-<a name="l00736"></a>00736             }
-<a name="l00737"></a>00737             <span class="comment">/* Get image statistics */</span>
-<a name="l00738"></a>00738             size_x = cpl_image_get_size_x(ima_cur) ;
-<a name="l00739"></a>00739             size_y = cpl_image_get_size_y(ima_cur) ;
-<a name="l00740"></a>00740             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00741"></a>00741                 (raw_zpoint_stats,
-<a name="l00742"></a>00742                  ima_cur,
-<a name="l00743"></a>00743                  1,
-<a name="l00744"></a>00744                  1,
-<a name="l00745"></a>00745                  size_x,
-<a name="l00746"></a>00746                  size_y,
-<a name="l00747"></a>00747                  idet,
-<a name="l00748"></a>00748                  iframe) !=0 )
-<a name="l00749"></a>00749             {
-<a name="l00750"></a>00750                 cpl_msg_error(__func__,<span class="stringliteral">"Cannot compute stats on ima %d det %d"</span>,
-<a name="l00751"></a>00751                               iframe+1, idet+1);
-<a name="l00752"></a>00752                 cpl_bivector_delete(positions) ;
-<a name="l00753"></a>00753                 cpl_imagelist_delete(*star_images);
-<a name="l00754"></a>00754                 cpl_imagelist_delete(sky_images) ;
-<a name="l00755"></a>00755                 cpl_image_delete(ima_cur);
-<a name="l00756"></a>00756                 cpl_msg_indent_less() ;
-<a name="l00757"></a>00757                 <span class="keywordflow">return</span> NULL ;
-<a name="l00758"></a>00758             }
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760             <span class="comment">/* Add the image to either the sky images or the star image */</span>
-<a name="l00761"></a>00761             <span class="keywordflow">if</span>(labels[iframe] == idet + 1)
-<a name="l00762"></a>00762             {
-<a name="l00763"></a>00763                 star_ima = ima_cur;
-<a name="l00764"></a>00764                 iframe_star = iframe;
-<a name="l00765"></a>00765             }
-<a name="l00766"></a>00766             <span class="keywordflow">else</span>
-<a name="l00767"></a>00767                 cpl_imagelist_set(sky_images, ima_cur,
-<a name="l00768"></a>00768                                   cpl_imagelist_get_size(sky_images));
-<a name="l00769"></a>00769         }
-<a name="l00770"></a>00770         cpl_msg_indent_less();
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772         <span class="comment">/* Create the sky */</span>
-<a name="l00773"></a>00773         cpl_msg_info(__func__, <span class="stringliteral">"Correct for the sky"</span>);
-<a name="l00774"></a>00774         sky = cpl_imagelist_collapse_median_create(sky_images);
-<a name="l00775"></a>00775         cpl_imagelist_delete(sky_images) ;
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777         <span class="comment">/* Subtract the sky */</span>
-<a name="l00778"></a>00778         cpl_image_subtract(star_ima, sky) ;
-<a name="l00779"></a>00779         cpl_image_delete(sky) ;
-<a name="l00780"></a>00780 
-<a name="l00781"></a>00781         <span class="comment">/* Divide by the flatfield if one is provided */</span>
-<a name="l00782"></a>00782         <span class="keywordflow">if</span> (flat) {
-<a name="l00783"></a>00783             cpl_msg_info(__func__, <span class="stringliteral">"Correct for the flat"</span>) ;
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785             <span class="comment">/* Get the extension with the current chip */</span>
-<a name="l00786"></a>00786             <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(flat, idet + 1)) == -1)
-<a name="l00787"></a>00787             {
-<a name="l00788"></a>00788                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,
-<a name="l00789"></a>00789                               idet + 1);
-<a name="l00790"></a>00790                 cpl_imagelist_delete(*star_images) ;
-<a name="l00791"></a>00791                 cpl_bivector_delete(positions) ;
-<a name="l00792"></a>00792                 <span class="keywordflow">return</span> NULL ;
-<a name="l00793"></a>00793             }
-<a name="l00794"></a>00794             <span class="comment">/* Load */</span>
-<a name="l00795"></a>00795             flat_im = cpl_image_load(flat, CPL_TYPE_FLOAT, 0, ext_nb) ;
-<a name="l00796"></a>00796             cpl_image_divide(star_ima, flat_im) ;
-<a name="l00797"></a>00797             cpl_image_delete(flat_im) ;
-<a name="l00798"></a>00798         }
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800         <span class="comment">/* Correct the bad pixels */</span>
-<a name="l00801"></a>00801         <span class="keywordflow">if</span> (bpm) {
-<a name="l00802"></a>00802             cpl_msg_info(__func__, <span class="stringliteral">"Correct for the bad pixels"</span>) ;
-<a name="l00803"></a>00803             <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a>(star_ima, bpm, idet + 1) == -1)
-<a name="l00804"></a>00804             {
-<a name="l00805"></a>00805                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct the BPM for chip %d"</span>,
-<a name="l00806"></a>00806                               idet + 1);
-<a name="l00807"></a>00807                 cpl_imagelist_delete(*star_images) ;
-<a name="l00808"></a>00808                 cpl_bivector_delete(positions) ;
-<a name="l00809"></a>00809                 <span class="keywordflow">return</span> NULL ;
-<a name="l00810"></a>00810             }
-<a name="l00811"></a>00811         }
-<a name="l00812"></a>00812 
-<a name="l00813"></a>00813         <span class="comment">/* Put the result in the image list */</span>
-<a name="l00814"></a>00814         cpl_imagelist_set(*star_images, star_ima,
-<a name="l00815"></a>00815                           cpl_imagelist_get_size(*star_images)) ;
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817         <span class="comment">/* Object detection */</span>
-<a name="l00818"></a>00818         cpl_msg_info(__func__,<span class="stringliteral">"For chip %d the STD should be on frame %d"</span>,
-<a name="l00819"></a>00819                      idet + 1, iframe_star+1);
-<a name="l00820"></a>00820         pos_x_cen = pos_y_cen = -1.0 ;
-<a name="l00821"></a>00821         size_x = cpl_image_get_size_x(star_ima) ;
-<a name="l00822"></a>00822         size_y = cpl_image_get_size_y(star_ima) ;
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824         <span class="comment">/* Filtering the image*/</span>
-<a name="l00825"></a>00825         kernel = cpl_mask_new(3, 3);
-<a name="l00826"></a>00826         cpl_mask_not(kernel);
-<a name="l00827"></a>00827         filt_ima = cpl_image_new(cpl_image_get_size_x(star_ima),
-<a name="l00828"></a>00828                                  cpl_image_get_size_y(star_ima),
-<a name="l00829"></a>00829                                  cpl_image_get_type(star_ima));
-<a name="l00830"></a>00830         cpl_image_filter_mask(filt_ima, star_ima, kernel, CPL_FILTER_MEDIAN, 
-<a name="l00831"></a>00831                               CPL_BORDER_FILTER);
-<a name="l00832"></a>00832         cpl_mask_delete(kernel);
-<a name="l00833"></a>00833 
-<a name="l00834"></a>00834         <span class="comment">/* Looking for apertures */</span>
-<a name="l00835"></a>00835         aperts = cpl_apertures_extract_sigma(filt_ima,
-<a name="l00836"></a>00836                 hawki_cal_zpoint_config.detect_sigma) ;
-<a name="l00837"></a>00837         cpl_image_delete(filt_ima) ;
-<a name="l00838"></a>00838         <span class="keywordflow">if</span> (aperts == NULL)
-<a name="l00839"></a>00839         {
-<a name="l00840"></a>00840             cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the central object"</span>) ;
-<a name="l00841"></a>00841             cpl_imagelist_delete(*star_images) ;
-<a name="l00842"></a>00842             cpl_bivector_delete(positions) ;
-<a name="l00843"></a>00843             <span class="keywordflow">return</span> NULL ;
-<a name="l00844"></a>00844         }
-<a name="l00845"></a>00845         min_dist = size_x * size_x + size_y * size_y ;
-<a name="l00846"></a>00846         <span class="keywordflow">for</span> (iaper=0 ; iaper<cpl_apertures_get_size(aperts) ; iaper++) {
-<a name="l00847"></a>00847             pos_x = cpl_apertures_get_centroid_x(aperts, iaper+1) ;
-<a name="l00848"></a>00848             pos_y = cpl_apertures_get_centroid_y(aperts, iaper+1) ;
-<a name="l00849"></a>00849             dist = (pos_x-hawki_cal_zpoint_config.xcoord[idet])*
-<a name="l00850"></a>00850                     (pos_x-hawki_cal_zpoint_config.xcoord[idet]) +
-<a name="l00851"></a>00851                    (pos_y-hawki_cal_zpoint_config.ycoord[idet])*
-<a name="l00852"></a>00852                     (pos_y-hawki_cal_zpoint_config.ycoord[idet]);
-<a name="l00853"></a>00853             <span class="keywordflow">if</span> (dist<min_dist) {
-<a name="l00854"></a>00854                 min_dist = dist ;
-<a name="l00855"></a>00855                 pos_x_cen = pos_x ;
-<a name="l00856"></a>00856                 pos_y_cen = pos_y ;
-<a name="l00857"></a>00857             }
-<a name="l00858"></a>00858         }
-<a name="l00859"></a>00859         cpl_apertures_delete(aperts) ;
-<a name="l00860"></a>00860 
-<a name="l00861"></a>00861         cpl_vector_set(cpl_bivector_get_x(positions), iframe_star, pos_x_cen) ;
-<a name="l00862"></a>00862         cpl_vector_set(cpl_bivector_get_y(positions), iframe_star, pos_y_cen) ;
-<a name="l00863"></a>00863         cpl_msg_info(__func__, <span class="stringliteral">"Expected star position: %g %g"</span>,
-<a name="l00864"></a>00864                 hawki_cal_zpoint_config.xcoord[idet],
-<a name="l00865"></a>00865                 hawki_cal_zpoint_config.ycoord[idet]);
-<a name="l00866"></a>00866         cpl_msg_info(__func__, <span class="stringliteral">"Bright object position: %g %g"</span>,
-<a name="l00867"></a>00867                 pos_x_cen, pos_y_cen) ;
-<a name="l00868"></a>00868 
-<a name="l00869"></a>00869         <span class="comment">/* Check that the star is within the search window */</span>
-<a name="l00870"></a>00870         <span class="keywordflow">if</span>(fabs(pos_x_cen - hawki_cal_zpoint_config.xcoord[idet]) >
-<a name="l00871"></a>00871                 hawki_cal_zpoint_config.sx                        ||
-<a name="l00872"></a>00872            fabs(pos_y_cen - hawki_cal_zpoint_config.ycoord[idet]) >
-<a name="l00873"></a>00873                 hawki_cal_zpoint_config.sy)
-<a name="l00874"></a>00874         {
-<a name="l00875"></a>00875             hawki_cal_zpoint_outputs.stdstar_image_detected[idet] = 0;
-<a name="l00876"></a>00876             cpl_msg_warning(cpl_func,<span class="stringliteral">"No object has been found within the box"</span>
-<a name="l00877"></a>00877                             <span class="stringliteral">"limits [%d, %d] around the expected position"</span>,
-<a name="l00878"></a>00878                             hawki_cal_zpoint_config.sx,
-<a name="l00879"></a>00879                             hawki_cal_zpoint_config.sy);
-<a name="l00880"></a>00880         }
-<a name="l00881"></a>00881         <span class="keywordflow">else</span>
-<a name="l00882"></a>00882         {
-<a name="l00883"></a>00883             hawki_cal_zpoint_outputs.stdstar_image_detected[idet] = 1;
-<a name="l00884"></a>00884         }
-<a name="l00885"></a>00885 
-<a name="l00886"></a>00886         <span class="comment">/* Free */</span>
-<a name="l00887"></a>00887         cpl_msg_indent_less() ;
-<a name="l00888"></a>00888     }
-<a name="l00889"></a>00889     cpl_msg_indent_less() ;
-<a name="l00890"></a>00890 
-<a name="l00891"></a>00891     <span class="comment">/* Reorder the images (frame order) */</span>
-<a name="l00892"></a>00892     star_images_frame_order = cpl_imagelist_new() ;
-<a name="l00893"></a>00893     <span class="keywordflow">for</span> (iframe=0 ; iframe< nframes; iframe++)
-<a name="l00894"></a>00894     {
-<a name="l00895"></a>00895         tmp_ima = cpl_image_duplicate
-<a name="l00896"></a>00896             (cpl_imagelist_get(*star_images, labels[iframe] -1 ));
-<a name="l00897"></a>00897         cpl_imagelist_set(star_images_frame_order, tmp_ima, iframe);
-<a name="l00898"></a>00898     }
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900     <span class="comment">/* Compute the photometry */</span>
-<a name="l00901"></a>00901     cpl_msg_info(__func__, <span class="stringliteral">"Compute the photometry"</span>) ;
-<a name="l00902"></a>00902     cpl_msg_indent_more() ;
-<a name="l00903"></a>00903     <span class="keywordflow">if</span> ((zpoint_tables = hawki_cal_zpoint_photom
-<a name="l00904"></a>00904             (star_images_frame_order, positions, labels))==NULL) {
-<a name="l00905"></a>00905         cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce"</span>) ;
-<a name="l00906"></a>00906         cpl_bivector_delete(positions) ;
-<a name="l00907"></a>00907         cpl_imagelist_delete(star_images_frame_order) ;
-<a name="l00908"></a>00908         cpl_msg_indent_less() ;
-<a name="l00909"></a>00909         <span class="keywordflow">return</span> NULL ;
-<a name="l00910"></a>00910     }
-<a name="l00911"></a>00911 
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913     <span class="comment">/* Free and exit */</span>
-<a name="l00914"></a>00914     cpl_msg_indent_less() ;
-<a name="l00915"></a>00915     cpl_bivector_delete(positions) ;
-<a name="l00916"></a>00916     cpl_imagelist_delete(star_images_frame_order) ;
-<a name="l00917"></a>00917 
-<a name="l00918"></a>00918     <span class="keywordflow">return</span> zpoint_tables;
-<a name="l00919"></a>00919 }
-<a name="l00920"></a>00920 
-<a name="l00921"></a>00921 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00931"></a>00931 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00932"></a>00932 <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_photom(
-<a name="l00933"></a>00933         cpl_imagelist       *   ilist,
-<a name="l00934"></a>00934         cpl_bivector        *   pos,
-<a name="l00935"></a>00935         <span class="keywordtype">int</span>                 *   labels)
-<a name="l00936"></a>00936 {
-<a name="l00937"></a>00937     cpl_table **        zpoint;
-<a name="l00938"></a>00938     <span class="keywordtype">int</span>                 nframes;
-<a name="l00939"></a>00939     <span class="keywordtype">double</span>              r, r1, r2;
-<a name="l00940"></a>00940     <span class="keywordtype">double</span>              stdstar_mag;
-<a name="l00941"></a>00941     <span class="keywordtype">double</span>              dit;
-<a name="l00942"></a>00942     <span class="keywordtype">double</span>              extinction;
-<a name="l00943"></a>00943     <span class="keywordtype">double</span>              pixscale;
-<a name="l00944"></a>00944     cpl_image       *   ima ;
-<a name="l00945"></a>00945     <span class="keywordtype">double</span>          *   pos_x ;
-<a name="l00946"></a>00946     <span class="keywordtype">double</span>          *   pos_y ;
-<a name="l00947"></a>00947     <span class="keywordtype">double</span>              bgd, fl, zp, peak, fwhm_x, fwhm_y ;
-<a name="l00948"></a>00948     cpl_bivector    *   iqe_res ;
-<a name="l00949"></a>00949     <span class="keywordtype">int</span>                 iframe;
-<a name="l00950"></a>00950     <span class="keywordtype">int</span>                 idet;
-<a name="l00951"></a>00951 
-<a name="l00952"></a>00952     <span class="comment">/* Test entries */</span>
-<a name="l00953"></a>00953     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00954"></a>00954     <span class="keywordflow">if</span> (pos == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00955"></a>00955 
-<a name="l00956"></a>00956     <span class="comment">/* Initialise */</span>
-<a name="l00957"></a>00957     nframes = cpl_imagelist_get_size(ilist) ;
-<a name="l00958"></a>00958     stdstar_mag = hawki_cal_zpoint_outputs.stdstar_mag_filter;
-<a name="l00959"></a>00959     dit = hawki_cal_zpoint_outputs.dit ;
-<a name="l00960"></a>00960     pixscale = hawki_cal_zpoint_outputs.pixscale ;
-<a name="l00961"></a>00961 
-<a name="l00962"></a>00962     <span class="comment">/* Get extinction */</span>
-<a name="l00963"></a>00963     <span class="keywordflow">switch</span> (hawki_cal_zpoint_outputs.band) {
-<a name="l00964"></a>00964         <span class="keywordflow">case</span> HAWKI_BAND_J:      extinction = 0.098 ; break ;
-<a name="l00965"></a>00965         <span class="keywordflow">case</span> HAWKI_BAND_H:      extinction = 0.039 ; break ;
-<a name="l00966"></a>00966         <span class="keywordflow">case</span> HAWKI_BAND_K:      extinction = 0.065 ; break ;
-<a name="l00967"></a>00967         <span class="keywordflow">case</span> HAWKI_BAND_Y:      extinction = 0.00 ; break ;
-<a name="l00968"></a>00968         <span class="keywordflow">default</span>:                extinction = 0.00 ; break ;
-<a name="l00969"></a>00969     }
-<a name="l00970"></a>00970     hawki_cal_zpoint_outputs.ext_coeff = extinction;
-<a name="l00971"></a>00971     cpl_msg_info(__func__,<span class="stringliteral">"Using tabulated extinction for band %s: %f"</span>,
-<a name="l00972"></a>00972                  hawki_cal_zpoint_outputs.filter, extinction);
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974     <span class="comment">/* Loop on the images */</span>
-<a name="l00975"></a>00975     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) {
-<a name="l00976"></a>00976         idet = labels[iframe]-1;
-<a name="l00977"></a>00977         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)
-<a name="l00978"></a>00978         {
-<a name="l00979"></a>00979             <span class="comment">/* Get the current image */</span>
-<a name="l00980"></a>00980             ima = cpl_imagelist_get(ilist, iframe) ;
-<a name="l00981"></a>00981 
-<a name="l00982"></a>00982             <span class="comment">/* Get the current position */</span>
-<a name="l00983"></a>00983             pos_x = cpl_bivector_get_x_data(pos) ;
-<a name="l00984"></a>00984             pos_y = cpl_bivector_get_y_data(pos) ;
-<a name="l00985"></a>00985 
-<a name="l00986"></a>00986             <span class="comment">/* FWHM_X / FWHM_Y */</span>
-<a name="l00987"></a>00987             iqe_res = cpl_image_iqe
-<a name="l00988"></a>00988                     (ima, (<span class="keywordtype">int</span>)(pos_x[iframe]-10.0), (<span class="keywordtype">int</span>)(pos_y[iframe]-10.0),
-<a name="l00989"></a>00989                           (<span class="keywordtype">int</span>)(pos_x[iframe]+10.0), (<span class="keywordtype">int</span>)(pos_y[iframe]+10.0));
-<a name="l00990"></a>00990             <span class="keywordflow">if</span> (iqe_res == NULL)
-<a name="l00991"></a>00991             {
-<a name="l00992"></a>00992                 cpl_msg_debug(__func__,<span class="stringliteral">"Cannot compute FWHM for chip %d"</span>,
-<a name="l00993"></a>00993                         idet + 1);
-<a name="l00994"></a>00994                 fwhm_x = fwhm_y = -1.0 ;
-<a name="l00995"></a>00995                 cpl_error_reset() ;
-<a name="l00996"></a>00996             } <span class="keywordflow">else</span> {
-<a name="l00997"></a>00997                 fwhm_x = cpl_vector_get(cpl_bivector_get_x(iqe_res), 2) ;
-<a name="l00998"></a>00998                 fwhm_y = cpl_vector_get(cpl_bivector_get_x(iqe_res), 3) ;
-<a name="l00999"></a>00999                 cpl_bivector_delete(iqe_res) ;
-<a name="l01000"></a>01000             }
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002             <span class="comment">/* Determine the radii */</span>
-<a name="l01003"></a>01003             r = hawki_cal_zpoint_config.phot_star_radius ;
-<a name="l01004"></a>01004             <span class="keywordflow">if</span> (r < 0) {
-<a name="l01005"></a>01005                 <span class="keywordflow">if</span> (fwhm_x>0 && fwhm_y>0)   r = 5*(fwhm_x+fwhm_y)/2.0 ;
-<a name="l01006"></a>01006                 <span class="keywordflow">else</span>                        r = HAWKI_PHOT_STAR_RADIUS ;
-<a name="l01007"></a>01007             }
-<a name="l01008"></a>01008             r1 = hawki_cal_zpoint_config.phot_bg_r1 ;
-<a name="l01009"></a>01009             r2 = hawki_cal_zpoint_config.phot_bg_r2 ;
-<a name="l01010"></a>01010             <span class="keywordflow">if</span> (r1 < 0) r1 = r + 10.0 ;
-<a name="l01011"></a>01011             <span class="keywordflow">if</span> (r2 < 0) r2 = r1 + 20.0 ;
-<a name="l01012"></a>01012             <span class="comment">//cpl_msg_info(__func__, "Use radii for star: %g and background: %g, %g",</span>
-<a name="l01013"></a>01013             <span class="comment">//        r, r1, r2) ;</span>
-<a name="l01014"></a>01014 
-<a name="l01015"></a>01015             <span class="comment">/* Compute the photometry */</span>
-<a name="l01016"></a>01016             <span class="comment">/* Background */</span>
-<a name="l01017"></a>01017             bgd = irplib_strehl_ring_background(ima, (<span class="keywordtype">int</span>)(pos_x[iframe]),
-<a name="l01018"></a>01018                (<span class="keywordtype">int</span>)(pos_y[iframe]), (<span class="keywordtype">int</span>)r1, (<span class="keywordtype">int</span>)r2, IRPLIB_BG_METHOD_MEDIAN);
-<a name="l01019"></a>01019             <span class="comment">/* Flux */</span>
-<a name="l01020"></a>01020             fl = irplib_strehl_disk_flux(ima,
-<a name="l01021"></a>01021                     (<span class="keywordtype">int</span>)(pos_x[iframe]), (<span class="keywordtype">int</span>)(pos_y[iframe]), (<span class="keywordtype">int</span>)r, bgd);
-<a name="l01022"></a>01022             
-<a name="l01023"></a>01023             <span class="comment">//cpl_msg_info(__func__, "Zero point in chip %d:   %g", labels[iframe], zp) ;</span>
-<a name="l01024"></a>01024             <span class="comment">/* Peak */</span>
-<a name="l01025"></a>01025             peak = cpl_image_get_max_window(ima,
-<a name="l01026"></a>01026                     (<span class="keywordtype">int</span>)(pos_x[iframe]-5), (<span class="keywordtype">int</span>)(pos_y[iframe]-5),
-<a name="l01027"></a>01027                     (<span class="keywordtype">int</span>)(pos_x[iframe]+5), (<span class="keywordtype">int</span>)(pos_y[iframe]+5));
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029             <span class="comment">/* Zero Point */</span>
-<a name="l01030"></a>01030             <span class="keywordflow">if</span> (hawki_cal_zpoint_outputs.stdstar_mag_available == 1)
-<a name="l01031"></a>01031             {
-<a name="l01032"></a>01032                 <span class="keywordflow">if</span> (fl > 0 && dit > 0)
-<a name="l01033"></a>01033                 {
-<a name="l01034"></a>01034                     hawki_cal_zpoint_outputs.zpoint_computable[idet] = 1;
-<a name="l01035"></a>01035                     zp = stdstar_mag + 2.5 * log10(fl) - 2.5 * log10(dit);
-<a name="l01036"></a>01036 
-<a name="l01037"></a>01037                     hawki_cal_zpoint_outputs.zpoint[idet] = zp;
-<a name="l01038"></a>01038                     hawki_cal_zpoint_outputs.atx0[idet] = zp + 
-<a name="l01039"></a>01039                             extinction * hawki_cal_zpoint_outputs.airmass[idet];
-<a name="l01040"></a>01040                 }
-<a name="l01041"></a>01041                 <span class="keywordflow">else</span>
-<a name="l01042"></a>01042                     hawki_cal_zpoint_outputs.zpoint_computable[idet] = 0;
-<a name="l01043"></a>01043             }
-<a name="l01044"></a>01044             hawki_cal_zpoint_outputs.posx[idet] = pos_x[iframe];
-<a name="l01045"></a>01045             hawki_cal_zpoint_outputs.posy[idet] = pos_y[iframe];
-<a name="l01046"></a>01046             hawki_cal_zpoint_outputs.flux[idet] = fl;
-<a name="l01047"></a>01047             hawki_cal_zpoint_outputs.instrmag[idet] = 2.5 * log10(fl/dit);
-<a name="l01048"></a>01048             hawki_cal_zpoint_outputs.peak[idet] = peak;
-<a name="l01049"></a>01049             hawki_cal_zpoint_outputs.bgd[idet] = bgd;
-<a name="l01050"></a>01050             hawki_cal_zpoint_outputs.fwhmx[idet] = fwhm_x;
-<a name="l01051"></a>01051             hawki_cal_zpoint_outputs.fwhmy[idet] = fwhm_y;
-<a name="l01052"></a>01052             <span class="keywordflow">if</span> (fwhm_x > 0 && fwhm_y > 0)
-<a name="l01053"></a>01053                 hawki_cal_zpoint_outputs.fwhm[idet] = sqrt(fwhm_x*fwhm_y);
-<a name="l01054"></a>01054             <span class="keywordflow">else</span>
-<a name="l01055"></a>01055                 hawki_cal_zpoint_outputs.fwhm[idet] = -1.0;
-<a name="l01056"></a>01056             hawki_cal_zpoint_outputs.fwhmx_as[idet] = fwhm_x * pixscale;
-<a name="l01057"></a>01057             hawki_cal_zpoint_outputs.fwhmy_as[idet] = fwhm_y * pixscale;
-<a name="l01058"></a>01058             <span class="keywordflow">if</span> (fwhm_x > 0 && fwhm_y > 0)
-<a name="l01059"></a>01059                 hawki_cal_zpoint_outputs.fwhm_as[idet] =
-<a name="l01060"></a>01060                         sqrt(fwhm_x*fwhm_y*pixscale*pixscale);
-<a name="l01061"></a>01061             <span class="keywordflow">else</span>
-<a name="l01062"></a>01062                 hawki_cal_zpoint_outputs.fwhm_as[labels[iframe]-1] = -1.0;
-<a name="l01063"></a>01063         }
-<a name="l01064"></a>01064         <span class="keywordflow">else</span>
-<a name="l01065"></a>01065         {
-<a name="l01066"></a>01066             cpl_msg_warning(cpl_func,<span class="stringliteral">"Standard star not detected in chip %d. "</span>
-<a name="l01067"></a>01067                     <span class="stringliteral">"No zeropoint computed."</span>, idet + 1);
-<a name="l01068"></a>01068         }
-<a name="l01069"></a>01069 
-<a name="l01070"></a>01070     }
-<a name="l01071"></a>01071 
-<a name="l01072"></a>01072     <span class="comment">/* Create the table */</span>
-<a name="l01073"></a>01073     zpoint = <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(1);
-<a name="l01074"></a>01074     <span class="comment">//tab = cpl_table_new(nframes) ;</span>
-<a name="l01075"></a>01075     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01076"></a>01076         cpl_table_new_column(zpoint[idet], 
-<a name="l01077"></a>01077                              HAWKI_COL_ZPOINT_CHIP, CPL_TYPE_INT);
-<a name="l01078"></a>01078         cpl_table_new_column(zpoint[idet], 
-<a name="l01079"></a>01079                              HAWKI_COL_ZPOINT_STARNAME, CPL_TYPE_STRING);
-<a name="l01080"></a>01080         cpl_table_new_column(zpoint[idet], 
-<a name="l01081"></a>01081                              HAWKI_COL_ZPOINT_POSX, CPL_TYPE_DOUBLE);
-<a name="l01082"></a>01082         cpl_table_set_column_unit(zpoint[idet],
-<a name="l01083"></a>01083                                   HAWKI_COL_ZPOINT_POSX,<span class="stringliteral">"pix"</span>);
-<a name="l01084"></a>01084         cpl_table_new_column(zpoint[idet], 
-<a name="l01085"></a>01085                              HAWKI_COL_ZPOINT_POSY, CPL_TYPE_DOUBLE);
-<a name="l01086"></a>01086         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_POSY,<span class="stringliteral">"pix"</span>);
-<a name="l01087"></a>01087         cpl_table_new_column(zpoint[idet], 
-<a name="l01088"></a>01088                              HAWKI_COL_ZPOINT_ZPOINT, CPL_TYPE_DOUBLE);
-<a name="l01089"></a>01089         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_ZPOINT,<span class="stringliteral">"mag"</span>);
-<a name="l01090"></a>01090         cpl_table_new_column(zpoint[idet], 
-<a name="l01091"></a>01091                              HAWKI_COL_ZPOINT_ATX0, CPL_TYPE_DOUBLE);
-<a name="l01092"></a>01092         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_ATX0,<span class="stringliteral">"mag"</span>);
-<a name="l01093"></a>01093         cpl_table_new_column(zpoint[idet], 
-<a name="l01094"></a>01094                              HAWKI_COL_ZPOINT_AIRMASS, CPL_TYPE_DOUBLE);
-<a name="l01095"></a>01095         cpl_table_new_column(zpoint[idet], 
-<a name="l01096"></a>01096                              HAWKI_COL_ZPOINT_FLUX, CPL_TYPE_DOUBLE);
-<a name="l01097"></a>01097         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FLUX,<span class="stringliteral">"ADU"</span>);
-<a name="l01098"></a>01098         cpl_table_new_column(zpoint[idet], 
-<a name="l01099"></a>01099                              HAWKI_COL_ZPOINT_INSTRMAG, CPL_TYPE_DOUBLE);
-<a name="l01100"></a>01100         cpl_table_set_column_unit(zpoint[idet],
-<a name="l01101"></a>01101                                   HAWKI_COL_ZPOINT_INSTRMAG,<span class="stringliteral">"log(ADU/s)"</span>);
-<a name="l01102"></a>01102         cpl_table_new_column(zpoint[idet], 
-<a name="l01103"></a>01103                              HAWKI_COL_ZPOINT_FILTER, CPL_TYPE_STRING);
-<a name="l01104"></a>01104         cpl_table_new_column(zpoint[idet], 
-<a name="l01105"></a>01105                              HAWKI_COL_ZPOINT_PEAK, CPL_TYPE_DOUBLE);
-<a name="l01106"></a>01106         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_PEAK,<span class="stringliteral">"ADU"</span>);
-<a name="l01107"></a>01107         cpl_table_new_column(zpoint[idet], 
-<a name="l01108"></a>01108                              HAWKI_COL_ZPOINT_BGD, CPL_TYPE_DOUBLE);
-<a name="l01109"></a>01109         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_BGD,<span class="stringliteral">"ADU"</span>);
-<a name="l01110"></a>01110         cpl_table_new_column(zpoint[idet], 
-<a name="l01111"></a>01111                              HAWKI_COL_ZPOINT_FWHMX, CPL_TYPE_DOUBLE);
-<a name="l01112"></a>01112         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMX,<span class="stringliteral">"pix"</span>);
-<a name="l01113"></a>01113         cpl_table_new_column(zpoint[idet], 
-<a name="l01114"></a>01114                              HAWKI_COL_ZPOINT_FWHMY, CPL_TYPE_DOUBLE);
-<a name="l01115"></a>01115         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMY,<span class="stringliteral">"pix"</span>);
-<a name="l01116"></a>01116         cpl_table_new_column(zpoint[idet], 
-<a name="l01117"></a>01117                              HAWKI_COL_ZPOINT_FWHM, CPL_TYPE_DOUBLE);
-<a name="l01118"></a>01118         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHM,<span class="stringliteral">"pix"</span>);
-<a name="l01119"></a>01119         cpl_table_new_column(zpoint[idet], 
-<a name="l01120"></a>01120                              HAWKI_COL_ZPOINT_FWHMX_AS, CPL_TYPE_DOUBLE);
-<a name="l01121"></a>01121         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMX_AS,<span class="stringliteral">"arcsec"</span>);
-<a name="l01122"></a>01122         cpl_table_new_column(zpoint[idet], 
-<a name="l01123"></a>01123                              HAWKI_COL_ZPOINT_FWHMY_AS, CPL_TYPE_DOUBLE);
-<a name="l01124"></a>01124         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMY_AS,<span class="stringliteral">"arcsec"</span>);
-<a name="l01125"></a>01125         cpl_table_new_column(zpoint[idet], 
-<a name="l01126"></a>01126                              HAWKI_COL_ZPOINT_FWHM_AS, CPL_TYPE_DOUBLE);
-<a name="l01127"></a>01127         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHM_AS,<span class="stringliteral">"arcsec"</span>);
-<a name="l01128"></a>01128         cpl_table_new_column(zpoint[idet], 
-<a name="l01129"></a>01129                              HAWKI_COL_ZPOINT_STARMAG, CPL_TYPE_DOUBLE);
-<a name="l01130"></a>01130         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_STARMAG,<span class="stringliteral">"mag"</span>);
-<a name="l01131"></a>01131         
-<a name="l01132"></a>01132         cpl_table_set_int(zpoint[idet], HAWKI_COL_ZPOINT_CHIP, 0, idet+1) ;
-<a name="l01133"></a>01133         cpl_table_set_string(zpoint[idet], HAWKI_COL_ZPOINT_FILTER, 0,
-<a name="l01134"></a>01134                 hawki_cal_zpoint_outputs.filter);
-<a name="l01135"></a>01135         cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_AIRMASS, 0,
-<a name="l01136"></a>01136                 hawki_cal_zpoint_outputs.airmass[idet]) ;
-<a name="l01137"></a>01137         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_incat_found== 1)
-<a name="l01138"></a>01138         {
-<a name="l01139"></a>01139             cpl_table_set_string(zpoint[idet], HAWKI_COL_ZPOINT_STARNAME, 0,
-<a name="l01140"></a>01140                     hawki_cal_zpoint_outputs.starname) ;
-<a name="l01141"></a>01141             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available== 1)
-<a name="l01142"></a>01142             {
-<a name="l01143"></a>01143                 cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_STARMAG, 0,
-<a name="l01144"></a>01144                         hawki_cal_zpoint_outputs.stdstar_mag_filter);
-<a name="l01145"></a>01145             }
-<a name="l01146"></a>01146         }
-<a name="l01147"></a>01147         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)
-<a name="l01148"></a>01148         {
-<a name="l01149"></a>01149             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_POSX, 0,
-<a name="l01150"></a>01150                     hawki_cal_zpoint_outputs.posx[idet]) ;
-<a name="l01151"></a>01151             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_POSY, 0,
-<a name="l01152"></a>01152                                  hawki_cal_zpoint_outputs.posy[idet]) ;
-<a name="l01153"></a>01153             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FLUX, 0,
-<a name="l01154"></a>01154                                  hawki_cal_zpoint_outputs.flux[idet]) ;
-<a name="l01155"></a>01155             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_INSTRMAG, 0,
-<a name="l01156"></a>01156                                  hawki_cal_zpoint_outputs.instrmag[idet]) ;
-<a name="l01157"></a>01157             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_PEAK, 0,
-<a name="l01158"></a>01158                                  hawki_cal_zpoint_outputs.peak[idet]) ;
-<a name="l01159"></a>01159             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_BGD, 0,
-<a name="l01160"></a>01160                                  hawki_cal_zpoint_outputs.bgd[idet]) ;
-<a name="l01161"></a>01161             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMX, 0,
-<a name="l01162"></a>01162                                  hawki_cal_zpoint_outputs.fwhmx[idet]) ;
-<a name="l01163"></a>01163             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMY, 0,
-<a name="l01164"></a>01164                                  hawki_cal_zpoint_outputs.fwhmy[idet]) ;
-<a name="l01165"></a>01165             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHM, 0,
-<a name="l01166"></a>01166                                  hawki_cal_zpoint_outputs.fwhm[idet]) ;
-<a name="l01167"></a>01167             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMX_AS, 0,
-<a name="l01168"></a>01168                                  hawki_cal_zpoint_outputs.fwhmx_as[idet]) ;
-<a name="l01169"></a>01169             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMY_AS, 0,
-<a name="l01170"></a>01170                                  hawki_cal_zpoint_outputs.fwhmy_as[idet]) ;
-<a name="l01171"></a>01171             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHM_AS, 0,
-<a name="l01172"></a>01172                                  hawki_cal_zpoint_outputs.fwhm_as[idet]) ;
-<a name="l01173"></a>01173             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)
-<a name="l01174"></a>01174             {
-<a name="l01175"></a>01175                 cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_ZPOINT, 0,
-<a name="l01176"></a>01176                         hawki_cal_zpoint_outputs.zpoint[idet]);
-<a name="l01177"></a>01177                 cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_ATX0, 0,
-<a name="l01178"></a>01178                         hawki_cal_zpoint_outputs.atx0[idet]);
-<a name="l01179"></a>01179             }
-<a name="l01180"></a>01180         }
-<a name="l01181"></a>01181     }
-<a name="l01182"></a>01182 
-<a name="l01183"></a>01183     <span class="comment">/* Mean values */</span>
-<a name="l01184"></a>01184     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)
-<a name="l01185"></a>01185     {
-<a name="l01186"></a>01186         <span class="keywordtype">int</span> nzpoint = 0;
-<a name="l01187"></a>01187         hawki_cal_zpoint_outputs.mean_zpoint = 0.0 ;
-<a name="l01188"></a>01188         hawki_cal_zpoint_outputs.mean_atx0 = 0.0 ;
-<a name="l01189"></a>01189         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01190"></a>01190             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)
-<a name="l01191"></a>01191             {
-<a name="l01192"></a>01192 
-<a name="l01193"></a>01193                 hawki_cal_zpoint_outputs.mean_zpoint +=
-<a name="l01194"></a>01194                         hawki_cal_zpoint_outputs.zpoint[idet] ;
-<a name="l01195"></a>01195                 hawki_cal_zpoint_outputs.mean_atx0  +=
-<a name="l01196"></a>01196                         hawki_cal_zpoint_outputs.atx0[idet] ;
-<a name="l01197"></a>01197                 nzpoint++;
-<a name="l01198"></a>01198             }
-<a name="l01199"></a>01199         }
-<a name="l01200"></a>01200         <span class="keywordflow">if</span>(nzpoint > 0)
-<a name="l01201"></a>01201         {
-<a name="l01202"></a>01202             hawki_cal_zpoint_outputs.zpoint_mean_computable = 1;
-<a name="l01203"></a>01203             hawki_cal_zpoint_outputs.mean_zpoint /= nzpoint ;
-<a name="l01204"></a>01204             hawki_cal_zpoint_outputs.mean_atx0 /= nzpoint ;
-<a name="l01205"></a>01205         }
-<a name="l01206"></a>01206     }
-<a name="l01207"></a>01207     
-<a name="l01208"></a>01208     <span class="comment">/* Output results */</span>
-<a name="l01209"></a>01209     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01210"></a>01210     {
-<a name="l01211"></a>01211         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)
-<a name="l01212"></a>01212         {
-<a name="l01213"></a>01213             cpl_msg_info(__func__, <span class="stringliteral">"Zero point [at airmass=1] in chip %d:"</span>,
-<a name="l01214"></a>01214                     idet + 1);
-<a name="l01215"></a>01215             cpl_msg_indent_more();
-<a name="l01216"></a>01216             cpl_msg_info(__func__,<span class="stringliteral">"   ZP: %g [%g]"</span>,
-<a name="l01217"></a>01217                          hawki_cal_zpoint_outputs.zpoint[idet],
-<a name="l01218"></a>01218                          hawki_cal_zpoint_outputs.atx0[idet]);
-<a name="l01219"></a>01219             cpl_msg_info(__func__,<span class="stringliteral">"   Flux of star: %f"</span>,
-<a name="l01220"></a>01220                          hawki_cal_zpoint_outputs.flux[idet]);
-<a name="l01221"></a>01221             cpl_msg_indent_less();
-<a name="l01222"></a>01222         }
-<a name="l01223"></a>01223         <span class="keywordflow">else</span>
-<a name="l01224"></a>01224             cpl_msg_info(__func__, <span class="stringliteral">"Zero point not available for chip %d"</span>,
-<a name="l01225"></a>01225                     idet + 1);
-<a name="l01226"></a>01226 
-<a name="l01227"></a>01227     }
-<a name="l01228"></a>01228 
-<a name="l01229"></a>01229     <span class="keywordflow">return</span> zpoint;
-<a name="l01230"></a>01230 }
-<a name="l01231"></a>01231 
-<a name="l01232"></a>01232 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01240"></a>01240 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01241"></a>01241 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_get_mag(
-<a name="l01242"></a>01242         <span class="keyword">const</span> <span class="keywordtype">char</span>  *       std_file,
-<a name="l01243"></a>01243         <span class="keywordtype">double</span>              pointing_ra,
-<a name="l01244"></a>01244         <span class="keywordtype">double</span>              pointing_dec,
-<a name="l01245"></a>01245         hawki_band          band)
-<a name="l01246"></a>01246 {
-<a name="l01247"></a>01247     cpl_table      * catalogue;
-<a name="l01248"></a>01248     <span class="keywordtype">char</span>           * star_name;
-<a name="l01249"></a>01249     <span class="keywordtype">char</span>           * used_catname;
-<a name="l01250"></a>01250     <span class="keywordtype">char</span>           * star_type;
-<a name="l01251"></a>01251     <span class="keywordtype">double</span>           stdstar_ra;
-<a name="l01252"></a>01252     <span class="keywordtype">double</span>           stdstar_dec;
-<a name="l01253"></a>01253     <span class="keywordtype">double</span>           mag_filter;
-<a name="l01254"></a>01254     <span class="keywordtype">double</span>           mag_J;
-<a name="l01255"></a>01255     <span class="keywordtype">double</span>           mag_H;
-<a name="l01256"></a>01256     <span class="keywordtype">double</span>           mag_K;
-<a name="l01257"></a>01257     <span class="keywordtype">double</span>           mag_Y;
-<a name="l01258"></a>01258     <span class="keywordtype">int</span>              mag_invalid;
-<a name="l01259"></a>01259     <span class="keywordtype">int</span>              star_ind;
-<a name="l01260"></a>01260 
-<a name="l01261"></a>01261     hawki_cal_zpoint_outputs.stdstar_incat_found = 0;    
-<a name="l01262"></a>01262     
-<a name="l01263"></a>01263     <span class="comment">/* Load the catalog */</span>
-<a name="l01264"></a>01264     <span class="keywordflow">if</span> ((catalogue = irplib_stdstar_load_catalog(std_file, <span class="stringliteral">"all"</span>)) == NULL) {
-<a name="l01265"></a>01265         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot read catalogue file %s"</span>,std_file);
-<a name="l01266"></a>01266         <span class="keywordflow">return</span> -1;
-<a name="l01267"></a>01267     }
-<a name="l01268"></a>01268 
-<a name="l01269"></a>01269     <span class="comment">/* Check that the columns are there */</span>
-<a name="l01270"></a>01270     <span class="keywordflow">if</span> (irplib_stdstar_check_columns_exist(catalogue) != CPL_ERROR_NONE) {
-<a name="l01271"></a>01271         cpl_msg_error(cpl_func,<span class="stringliteral">"Note all the columns are present"</span>
-<a name="l01272"></a>01272                       <span class="stringliteral">" in the  catalogue file %s"</span>,std_file);
-<a name="l01273"></a>01273         <span class="keywordflow">return</span> -1;
-<a name="l01274"></a>01274     }    
-<a name="l01275"></a>01275     
-<a name="l01276"></a>01276     <span class="comment">/* Select stars within a given distance */</span>
-<a name="l01277"></a>01277     <span class="keywordflow">if</span> (irplib_stdstar_select_stars_dist(catalogue, 
-<a name="l01278"></a>01278             pointing_ra, pointing_dec, 5.0) == -1) {
-<a name="l01279"></a>01279         cpl_table_delete(catalogue) ;
-<a name="l01280"></a>01280         <span class="keywordflow">return</span> 1;
-<a name="l01281"></a>01281     }
-<a name="l01282"></a>01282 
-<a name="l01283"></a>01283     <span class="comment">/* Take the closest */</span>
-<a name="l01284"></a>01284     <span class="keywordflow">if</span> ((star_ind=irplib_stdstar_find_closest(catalogue, 
-<a name="l01285"></a>01285             pointing_ra, pointing_dec)) < 0) {
-<a name="l01286"></a>01286         cpl_table_delete(catalogue) ;
-<a name="l01287"></a>01287         <span class="keywordflow">return</span> 1;
-<a name="l01288"></a>01288     }
-<a name="l01289"></a>01289 
-<a name="l01290"></a>01290     <span class="comment">/* Retrieve the star information */</span>
-<a name="l01291"></a>01291     hawki_cal_zpoint_outputs.stdstar_incat_found = 1;    
-<a name="l01292"></a>01292     star_name = cpl_strdup(cpl_table_get_string(catalogue,
-<a name="l01293"></a>01293                                             IRPLIB_STDSTAR_STAR_COL, star_ind));
-<a name="l01294"></a>01294     used_catname = cpl_strdup(cpl_table_get_string
-<a name="l01295"></a>01295                               (catalogue, IRPLIB_STDSTAR_CAT_COL, star_ind));
-<a name="l01296"></a>01296     star_type = cpl_strdup(cpl_table_get_string(catalogue, 
-<a name="l01297"></a>01297             IRPLIB_STDSTAR_TYPE_COL, star_ind));
-<a name="l01298"></a>01298     stdstar_ra  = cpl_table_get_double(catalogue, 
-<a name="l01299"></a>01299             IRPLIB_STDSTAR_RA_COL, star_ind, NULL);
-<a name="l01300"></a>01300     stdstar_dec = cpl_table_get_double(catalogue, 
-<a name="l01301"></a>01301             IRPLIB_STDSTAR_DEC_COL, star_ind, NULL);
-<a name="l01302"></a>01302     mag_filter = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(band), 
-<a name="l01303"></a>01303             star_ind, &mag_invalid);
-<a name="l01304"></a>01304     mag_H = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_H),
-<a name="l01305"></a>01305             star_ind, NULL);
-<a name="l01306"></a>01306     mag_J = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_J), 
-<a name="l01307"></a>01307             star_ind, NULL);
-<a name="l01308"></a>01308     mag_K = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_K), 
-<a name="l01309"></a>01309             star_ind, NULL);
-<a name="l01310"></a>01310     mag_Y = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_Y), 
-<a name="l01311"></a>01311             star_ind, NULL);
-<a name="l01312"></a>01312     
-<a name="l01313"></a>01313     <span class="comment">/* Store results */</span>
-<a name="l01314"></a>01314     strcpy(hawki_cal_zpoint_outputs.starname, star_name) ;
-<a name="l01315"></a>01315     strcpy(hawki_cal_zpoint_outputs.sptype, star_type) ;
-<a name="l01316"></a>01316     strcpy(hawki_cal_zpoint_outputs.catalog, used_catname);
-<a name="l01317"></a>01317     hawki_cal_zpoint_outputs.stdstar_ra = stdstar_ra;
-<a name="l01318"></a>01318     hawki_cal_zpoint_outputs.stdstar_dec = stdstar_dec;
-<a name="l01319"></a>01319     <span class="keywordflow">if</span>(mag_invalid == 0)
-<a name="l01320"></a>01320     {
-<a name="l01321"></a>01321         hawki_cal_zpoint_outputs.stdstar_mag_available = 1;
-<a name="l01322"></a>01322         hawki_cal_zpoint_outputs.stdstar_mag_filter = mag_filter;
-<a name="l01323"></a>01323     }
-<a name="l01324"></a>01324     <span class="keywordflow">else</span>
-<a name="l01325"></a>01325         hawki_cal_zpoint_outputs.stdstar_mag_available = 0;
-<a name="l01326"></a>01326     hawki_cal_zpoint_outputs.stdstar_mag_H = mag_H;
-<a name="l01327"></a>01327     hawki_cal_zpoint_outputs.stdstar_mag_J = mag_J;
-<a name="l01328"></a>01328     hawki_cal_zpoint_outputs.stdstar_mag_K = mag_K;
-<a name="l01329"></a>01329     hawki_cal_zpoint_outputs.stdstar_mag_Y = mag_Y;
-<a name="l01330"></a>01330     cpl_free(star_name);
-<a name="l01331"></a>01331     cpl_free(star_type);
-<a name="l01332"></a>01332     cpl_free(used_catname);
-<a name="l01333"></a>01333     cpl_table_delete(catalogue);
-<a name="l01334"></a>01334     
-<a name="l01335"></a>01335     <span class="keywordflow">return</span> 0;
-<a name="l01336"></a>01336 }
-<a name="l01337"></a>01337 
-<a name="l01338"></a>01338 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01347"></a>01347 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01348"></a>01348 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_save
-<a name="l01349"></a>01349 (cpl_table           **  zpoint_tables,
-<a name="l01350"></a>01350  <span class="keywordtype">int</span>                 *   labels,
-<a name="l01351"></a>01351  cpl_imagelist       *   images,
-<a name="l01352"></a>01352  cpl_table           **  raw_zpoint_stats,
-<a name="l01353"></a>01353  cpl_frameset        *   zpoint_frames,
-<a name="l01354"></a>01354  cpl_frameset        *   calib_frames,
-<a name="l01355"></a>01355  <span class="keyword">const</span> cpl_frame     *   stars_frame,
-<a name="l01356"></a>01356  cpl_parameterlist   *   parlist,
-<a name="l01357"></a>01357  cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l01358"></a>01358 {
-<a name="l01359"></a>01359     cpl_propertylist    *   qcmainparams;
-<a name="l01360"></a>01360     cpl_propertylist    **  qcextparams;
-<a name="l01361"></a>01361     cpl_propertylist    *   mainheader;
-<a name="l01362"></a>01362     cpl_propertylist    **  extheaders;
-<a name="l01363"></a>01363     cpl_propertylist    **  statsqcextparams;
-<a name="l01364"></a>01364     cpl_propertylist    **  statsextheaders;
-<a name="l01365"></a>01365     cpl_frameset        *   used_frames;
-<a name="l01366"></a>01366     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   ref_filename;
-<a name="l01367"></a>01367     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_zpoint"</span> ;
-<a name="l01368"></a>01368     <span class="keywordtype">int</span>                     idet;
-<a name="l01369"></a>01369     <span class="keywordtype">int</span>                     iframe;
-<a name="l01370"></a>01370     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l01371"></a>01371 
-<a name="l01372"></a>01372 
-<a name="l01373"></a>01373     <span class="comment">/* Get the reference frame */</span>
-<a name="l01374"></a>01374     ref_filename = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">set</span>);
-<a name="l01375"></a>01375 
-<a name="l01376"></a>01376     <span class="comment">/* Create QC parameters for the zpoint table */</span>
-<a name="l01377"></a>01377     qcmainparams = cpl_propertylist_new();
-<a name="l01378"></a>01378     qcextparams = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01379"></a>01379     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01380"></a>01380         qcextparams[idet] = cpl_propertylist_new();
-<a name="l01381"></a>01381     <span class="comment">/* Write QC parameters */</span>
-<a name="l01382"></a>01382     hawki_cal_zpoint_compute_qc(qcmainparams, qcextparams, <span class="keyword">set</span>);
-<a name="l01383"></a>01383     
-<a name="l01384"></a>01384     <span class="comment">/* Create QC parameters for the stats table: Statistics of the raw images */</span>
-<a name="l01385"></a>01385     statsqcextparams = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01386"></a>01386     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01387"></a>01387         statsqcextparams[idet] = cpl_propertylist_new();
-<a name="l01388"></a>01388     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_zpoint_stats, statsqcextparams);    
-<a name="l01389"></a>01389     
-<a name="l01390"></a>01390     <span class="comment">/* Create the main and extension headers for the zpoint table*/</span>
-<a name="l01391"></a>01391     mainheader = cpl_propertylist_new();
-<a name="l01392"></a>01392     extheaders = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01393"></a>01393     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01394"></a>01394         extheaders[idet] = cpl_propertylist_new();
-<a name="l01395"></a>01395     <span class="comment">/* Copy QC params to the headers */</span>
-<a name="l01396"></a>01396     cpl_propertylist_append(mainheader, qcmainparams);
-<a name="l01397"></a>01397     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01398"></a>01398         cpl_propertylist_append(extheaders[idet], qcextparams[idet]) ;
-<a name="l01399"></a>01399     
-<a name="l01400"></a>01400     <span class="comment">/* Create the  extension headers for the stats table*/</span>
-<a name="l01401"></a>01401     statsextheaders = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01402"></a>01402     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01403"></a>01403         statsextheaders[idet] = cpl_propertylist_duplicate(statsqcextparams[idet]);
-<a name="l01404"></a>01404     
-<a name="l01405"></a>01405     <span class="comment">/* Write additional keywords to the headers */</span>
-<a name="l01406"></a>01406     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01407"></a>01407     {
-<a name="l01408"></a>01408         cpl_propertylist    *   inputlist;
-<a name="l01409"></a>01409         cpl_propertylist    *   wcslist;
-<a name="l01410"></a>01410         <span class="keywordtype">int</span>                     this_iframe = -1;
-<a name="l01411"></a>01411         <span class="keywordtype">int</span>                     ext_nb;
-<a name="l01412"></a>01412 
-<a name="l01413"></a>01413         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l01414"></a>01414         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(ref_filename, idet+1);
-<a name="l01415"></a>01415         inputlist = cpl_propertylist_load_regexp(ref_filename, ext_nb,
-<a name="l01416"></a>01416                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l01417"></a>01417         cpl_propertylist_append(extheaders[idet], inputlist);
-<a name="l01418"></a>01418         cpl_propertylist_append(statsextheaders[idet], inputlist);
-<a name="l01419"></a>01419         cpl_propertylist_delete(inputlist);
-<a name="l01420"></a>01420 
-<a name="l01421"></a>01421         <span class="comment">/* Propagate WCS keywords */</span>
-<a name="l01422"></a>01422         <span class="keywordflow">for</span>(iframe=0; iframe<cpl_frameset_get_size(zpoint_frames); iframe++)
-<a name="l01423"></a>01423             <span class="keywordflow">if</span>(labels[iframe] == idet + 1)
-<a name="l01424"></a>01424                 this_iframe = iframe;
-<a name="l01425"></a>01425         wcslist = cpl_propertylist_load_regexp
-<a name="l01426"></a>01426             (cpl_frame_get_filename(cpl_frameset_get_frame(zpoint_frames, this_iframe)),
-<a name="l01427"></a>01427                                     ext_nb, HAWKI_HEADER_WCS, 0);
-<a name="l01428"></a>01428         cpl_propertylist_copy_property_regexp
-<a name="l01429"></a>01429             (extheaders[idet], wcslist, HAWKI_HEADER_WCS, 0);
-<a name="l01430"></a>01430         cpl_propertylist_delete(wcslist);
-<a name="l01431"></a>01431     }
-<a name="l01432"></a>01432     
-<a name="l01433"></a>01433     <span class="comment">/* Write the zpoint table  */</span>
-<a name="l01434"></a>01434     used_frames = cpl_frameset_duplicate(zpoint_frames);
-<a name="l01435"></a>01435     <span class="keywordflow">for</span>(iframe = 0; iframe< cpl_frameset_get_size(calib_frames); ++iframe)
-<a name="l01436"></a>01436         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-<a name="l01437"></a>01437                 cpl_frameset_get_frame(calib_frames, iframe)));
-<a name="l01438"></a>01438     cpl_frameset_insert(used_frames, cpl_frame_duplicate(stars_frame));
-<a name="l01439"></a>01439     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l01440"></a>01440                       parlist,
-<a name="l01441"></a>01441                       used_frames,
-<a name="l01442"></a>01442                       (<span class="keyword">const</span> cpl_table **)zpoint_tables,
-<a name="l01443"></a>01443                       recipe_name,
-<a name="l01444"></a>01444                       HAWKI_CALPRO_ZPOINT_TAB,
-<a name="l01445"></a>01445                       HAWKI_PROTYPE_ZPOINT_TAB,
-<a name="l01446"></a>01446                       mainheader,
-<a name="l01447"></a>01447                       (<span class="keyword">const</span> cpl_propertylist **)extheaders,
-<a name="l01448"></a>01448                       <span class="stringliteral">"hawki_cal_zpoint.fits"</span>);
-<a name="l01449"></a>01449     cpl_frameset_delete(used_frames);
-<a name="l01450"></a>01450     
-<a name="l01451"></a>01451     <span class="comment">/* Write the table with the raw zpoint objects statistics */</span>
-<a name="l01452"></a>01452     used_frames = cpl_frameset_duplicate(zpoint_frames);
-<a name="l01453"></a>01453     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l01454"></a>01454                       parlist,
-<a name="l01455"></a>01455                       used_frames,
-<a name="l01456"></a>01456                       (<span class="keyword">const</span> cpl_table **)raw_zpoint_stats,
-<a name="l01457"></a>01457                       recipe_name,
-<a name="l01458"></a>01458                       HAWKI_CALPRO_ZPOINT_STATS,
-<a name="l01459"></a>01459                       HAWKI_PROTYPE_ZPOINT_STATS,
-<a name="l01460"></a>01460                       NULL,
-<a name="l01461"></a>01461                       (<span class="keyword">const</span> cpl_propertylist **)statsextheaders,
-<a name="l01462"></a>01462                       <span class="stringliteral">"hawki_cal_zpoint_stats.fits"</span>);
-<a name="l01463"></a>01463 
-<a name="l01464"></a>01464     <span class="comment">/* Write the images  */</span>
-<a name="l01465"></a>01465     <span class="keywordflow">for</span>(iframe = 0; iframe< cpl_frameset_get_size(calib_frames); ++iframe)
-<a name="l01466"></a>01466         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-<a name="l01467"></a>01467                 cpl_frameset_get_frame(calib_frames, iframe)));
-<a name="l01468"></a>01468     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,
-<a name="l01469"></a>01469                          parlist,
-<a name="l01470"></a>01470                          used_frames,
-<a name="l01471"></a>01471                          images,
-<a name="l01472"></a>01472                          recipe_name,
-<a name="l01473"></a>01473                          HAWKI_CALPRO_ZPOINT_IMA,
-<a name="l01474"></a>01474                          HAWKI_PROTYPE_ZPOINT_IMA,
-<a name="l01475"></a>01475                          NULL,
-<a name="l01476"></a>01476                          NULL,
-<a name="l01477"></a>01477                          <span class="stringliteral">"hawki_cal_zpoint_check.fits"</span>) ;
-<a name="l01478"></a>01478     cpl_frameset_delete(used_frames);
-<a name="l01479"></a>01479 
-<a name="l01480"></a>01480     <span class="comment">/* Free */</span>
-<a name="l01481"></a>01481     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01482"></a>01482         cpl_propertylist_delete(extheaders[idet]) ;
-<a name="l01483"></a>01483         cpl_propertylist_delete(qcextparams[idet]) ;
-<a name="l01484"></a>01484         cpl_propertylist_delete(statsqcextparams[idet]);
-<a name="l01485"></a>01485         cpl_propertylist_delete(statsextheaders[idet]);
-<a name="l01486"></a>01486     }
-<a name="l01487"></a>01487     cpl_propertylist_delete(mainheader);
-<a name="l01488"></a>01488     cpl_propertylist_delete(qcmainparams);
-<a name="l01489"></a>01489     cpl_free(extheaders);
-<a name="l01490"></a>01490     cpl_free(qcextparams);
-<a name="l01491"></a>01491     cpl_free(statsqcextparams);
-<a name="l01492"></a>01492     cpl_free(statsextheaders);
-<a name="l01493"></a>01493 
-<a name="l01494"></a>01494     <span class="comment">/* Free */</span>
-<a name="l01495"></a>01495     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l01496"></a>01496     {
-<a name="l01497"></a>01497         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l01498"></a>01498         <span class="keywordflow">return</span> -1;
-<a name="l01499"></a>01499     }
-<a name="l01500"></a>01500     <span class="keywordflow">return</span>  0;
-<a name="l01501"></a>01501 }
-<a name="l01502"></a>01502 
-<a name="l01503"></a>01503 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01510"></a>01510 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01511"></a>01511 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_qc
-<a name="l01512"></a>01512 (cpl_propertylist *   qcmainparams, 
-<a name="l01513"></a>01513  cpl_propertylist **  qcextparams,
-<a name="l01514"></a>01514  cpl_frameset     *   <span class="keyword">set</span>)
-<a name="l01515"></a>01515 {
-<a name="l01516"></a>01516     <span class="keywordtype">int</span>  idet;
-<a name="l01517"></a>01517     <span class="keywordtype">int</span>  nframes;
-<a name="l01518"></a>01518 
-<a name="l01519"></a>01519     
-<a name="l01520"></a>01520     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l01521"></a>01521 
-<a name="l01522"></a>01522     <span class="comment">/* Check inputs */</span>
-<a name="l01523"></a>01523     <span class="keywordflow">if</span> (qcmainparams == NULL) <span class="keywordflow">return</span> -1;
-<a name="l01524"></a>01524     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01525"></a>01525         <span class="keywordflow">if</span> (qcextparams[idet] == NULL) <span class="keywordflow">return</span> -1;
-<a name="l01526"></a>01526     
-<a name="l01527"></a>01527     <span class="comment">/* Write the QC params common to all extensions in the main header */</span>
-<a name="l01528"></a>01528     cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC FILTER OBS"</span>,
-<a name="l01529"></a>01529             hawki_cal_zpoint_outputs.filter);
-<a name="l01530"></a>01530     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC FILTER OBS"</span>,
-<a name="l01531"></a>01531                                  <span class="stringliteral">"Observation filter"</span>);
-<a name="l01532"></a>01532     cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC FILTER REF"</span>,
-<a name="l01533"></a>01533             <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(hawki_cal_zpoint_outputs.band)) ;
-<a name="l01534"></a>01534     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC FILTER REF"</span>,
-<a name="l01535"></a>01535                                  <span class="stringliteral">"Reference filter"</span>);
-<a name="l01536"></a>01536     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC AMBI RHUM AVG"</span>,
-<a name="l01537"></a>01537             hawki_cal_zpoint_outputs.humidity);
-<a name="l01538"></a>01538     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC AMBI RHUM AVG"</span>,
-<a name="l01539"></a>01539                      <span class="stringliteral">"(percent) ambient relative humidity @ 30/2 m"</span>);
-<a name="l01540"></a>01540     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,
-<a name="l01541"></a>01541             hawki_cal_zpoint_outputs.mean_airmass) ;
-<a name="l01542"></a>01542     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,
-<a name="l01543"></a>01543                                  <span class="stringliteral">"Average airmass"</span>);
-<a name="l01544"></a>01544     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l01545"></a>01545                                    nframes);
-<a name="l01546"></a>01546     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l01547"></a>01547                                  <span class="stringliteral">"Number of files used for the reduction"</span>);
-<a name="l01548"></a>01548     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_incat_found == 1)
-<a name="l01549"></a>01549     {
-<a name="l01550"></a>01550         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC STDNAME"</span>,
-<a name="l01551"></a>01551                 hawki_cal_zpoint_outputs.starname) ;
-<a name="l01552"></a>01552         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STDNAME"</span>,
-<a name="l01553"></a>01553                                      <span class="stringliteral">"Standard star name"</span>);
-<a name="l01554"></a>01554         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC SPECTYPE"</span>,
-<a name="l01555"></a>01555                                        hawki_cal_zpoint_outputs.sptype) ;
-<a name="l01556"></a>01556         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC SPECTYPE"</span>,
-<a name="l01557"></a>01557                                      <span class="stringliteral">"Standard star spectral type"</span>);
-<a name="l01558"></a>01558         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG H"</span>,
-<a name="l01559"></a>01559                                        hawki_cal_zpoint_outputs.stdstar_mag_H) ;
-<a name="l01560"></a>01560         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG H"</span>,
-<a name="l01561"></a>01561                                      <span class="stringliteral">"Standard star magnitude in H"</span>);
-<a name="l01562"></a>01562         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG J"</span>,
-<a name="l01563"></a>01563                                        hawki_cal_zpoint_outputs.stdstar_mag_J) ;
-<a name="l01564"></a>01564         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG J"</span>,
-<a name="l01565"></a>01565                                      <span class="stringliteral">"Standard star magnitude in J"</span>);
-<a name="l01566"></a>01566         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG K"</span>,
-<a name="l01567"></a>01567                                        hawki_cal_zpoint_outputs.stdstar_mag_K) ;
-<a name="l01568"></a>01568         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG K"</span>,
-<a name="l01569"></a>01569                                      <span class="stringliteral">"Standard star magnitude in K"</span>);
-<a name="l01570"></a>01570         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG Y"</span>,
-<a name="l01571"></a>01571                                        hawki_cal_zpoint_outputs.stdstar_mag_Y) ;
-<a name="l01572"></a>01572         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG Y"</span>,
-<a name="l01573"></a>01573                                      <span class="stringliteral">"Standard star magnitude in Y"</span>);
-<a name="l01574"></a>01574         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC CATNAME"</span>,
-<a name="l01575"></a>01575                                        hawki_cal_zpoint_outputs.catalog) ;
-<a name="l01576"></a>01576         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC CATNAME"</span>,
-<a name="l01577"></a>01577                                      <span class="stringliteral">"Standard star catalogue name"</span>);
-<a name="l01578"></a>01578     }
-<a name="l01579"></a>01579     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)
-<a name="l01580"></a>01580     {
-<a name="l01581"></a>01581         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG"</span>,
-<a name="l01582"></a>01582                 hawki_cal_zpoint_outputs.stdstar_mag_filter) ;
-<a name="l01583"></a>01583         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG"</span>,
-<a name="l01584"></a>01584                                  <span class="stringliteral">"Standard star magnitude in observed filter"</span>);
-<a name="l01585"></a>01585     }
-<a name="l01586"></a>01586     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_mean_computable == 1)
-<a name="l01587"></a>01587     {
-<a name="l01588"></a>01588         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT MEAN"</span>,
-<a name="l01589"></a>01589                 hawki_cal_zpoint_outputs.mean_zpoint) ;
-<a name="l01590"></a>01590         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT MEAN"</span>,
-<a name="l01591"></a>01591                             <span class="stringliteral">"Mean measured zero-point for all the chips [mag]"</span>);
-<a name="l01592"></a>01592         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ATX0 MEAN"</span>,
-<a name="l01593"></a>01593                                        hawki_cal_zpoint_outputs.mean_atx0);
-<a name="l01594"></a>01594         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ATX0 MEAN"</span>,
-<a name="l01595"></a>01595                <span class="stringliteral">"Mean extinction corrected zero-point for all the chips [mag]"</span>);
-<a name="l01596"></a>01596         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT EXT COEFF"</span>,
-<a name="l01597"></a>01597                                        hawki_cal_zpoint_outputs.ext_coeff);
-<a name="l01598"></a>01598         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT EXT COEFF"</span>,
-<a name="l01599"></a>01599                <span class="stringliteral">"Extinction coefficient used in the computation of ATX0"</span>);
-<a name="l01600"></a>01600     }
-<a name="l01601"></a>01601         
-<a name="l01602"></a>01602     <span class="comment">/* Write QC params that are specific of the extension */</span>
-<a name="l01603"></a>01603     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01604"></a>01604     {
-<a name="l01605"></a>01605         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)
-<a name="l01606"></a>01606         {
-<a name="l01607"></a>01607             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>,
-<a name="l01608"></a>01608                     hawki_cal_zpoint_outputs.zpoint[idet]) ;
-<a name="l01609"></a>01609             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>,
-<a name="l01610"></a>01610                                  <span class="stringliteral">"Measured zero-point for a given chip [mag]"</span>);
-<a name="l01611"></a>01611             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ATX0"</span>,
-<a name="l01612"></a>01612                                            hawki_cal_zpoint_outputs.atx0[idet]);
-<a name="l01613"></a>01613             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ATX0"</span>,
-<a name="l01614"></a>01614                      <span class="stringliteral">"Extinction corrected zero-point for a given chip [mag]"</span>);
-<a name="l01615"></a>01615         }
-<a name="l01616"></a>01616         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)
-<a name="l01617"></a>01617         {
-<a name="l01618"></a>01618             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSX"</span>,
-<a name="l01619"></a>01619                                            hawki_cal_zpoint_outputs.posx[idet]);
-<a name="l01620"></a>01620             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSX"</span>,
-<a name="l01621"></a>01621                                     <span class="stringliteral">"X position of the standard star [pixel]"</span>);
-<a name="l01622"></a>01622             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSY"</span>,
-<a name="l01623"></a>01623                                            hawki_cal_zpoint_outputs.posy[idet]);
-<a name="l01624"></a>01624             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSY"</span>,
-<a name="l01625"></a>01625                                     <span class="stringliteral">"Y position of the standard star [pixel]"</span>);
-<a name="l01626"></a>01626             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FLUX"</span>,
-<a name="l01627"></a>01627                                         hawki_cal_zpoint_outputs.flux[idet]);
-<a name="l01628"></a>01628             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FLUX"</span>,
-<a name="l01629"></a>01629                     <span class="stringliteral">"Flux of the standard star [ADU]"</span>);
-<a name="l01630"></a>01630             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT PEAK"</span>,
-<a name="l01631"></a>01631                                            hawki_cal_zpoint_outputs.peak[idet]) ;
-<a name="l01632"></a>01632             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT PEAK"</span>,
-<a name="l01633"></a>01633                                          <span class="stringliteral">"Peak of the standard starr [ADU]"</span>);
-<a name="l01634"></a>01634             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT BGD"</span>,
-<a name="l01635"></a>01635                                            hawki_cal_zpoint_outputs.bgd[idet]) ;
-<a name="l01636"></a>01636             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT BGD"</span>,
-<a name="l01637"></a>01637                                    <span class="stringliteral">"Background around the standard star [ADU]"</span>);
-<a name="l01638"></a>01638             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX"</span>,
-<a name="l01639"></a>01639                                         hawki_cal_zpoint_outputs.fwhmx[idet]);
-<a name="l01640"></a>01640             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX"</span>,
-<a name="l01641"></a>01641                                          <span class="stringliteral">"X FWHM of the standard star [pixel]"</span>);
-<a name="l01642"></a>01642             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY"</span>,
-<a name="l01643"></a>01643                                          hawki_cal_zpoint_outputs.fwhmy[idet]);
-<a name="l01644"></a>01644             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY"</span>,
-<a name="l01645"></a>01645                                          <span class="stringliteral">"Y FWHM of the standard star [pixel]"</span>);
-<a name="l01646"></a>01646             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM"</span>,
-<a name="l01647"></a>01647                                            hawki_cal_zpoint_outputs.fwhm[idet]);
-<a name="l01648"></a>01648             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM"</span>,
-<a name="l01649"></a>01649                                          <span class="stringliteral">"FWHM of the standard star [pixel]"</span>);
-<a name="l01650"></a>01650             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX_AS"</span>,
-<a name="l01651"></a>01651                                       hawki_cal_zpoint_outputs.fwhmx_as[idet]);
-<a name="l01652"></a>01652             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX_AS"</span>,
-<a name="l01653"></a>01653                                        <span class="stringliteral">"X FWHM of the standard star [arcsec]"</span>);
-<a name="l01654"></a>01654             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY_AS"</span>,
-<a name="l01655"></a>01655                                     hawki_cal_zpoint_outputs.fwhmy_as[idet]);
-<a name="l01656"></a>01656             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY_AS"</span>,
-<a name="l01657"></a>01657                                       <span class="stringliteral">"Y FWHM of the standard star [arcsec]"</span>);
-<a name="l01658"></a>01658             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM_AS"</span>,
-<a name="l01659"></a>01659                                        hawki_cal_zpoint_outputs.fwhm_as[idet]);
-<a name="l01660"></a>01660             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM_AS"</span>,
-<a name="l01661"></a>01661                                          <span class="stringliteral">"FWHM of the standard star [arcsec]"</span>);
-<a name="l01662"></a>01662         }
-<a name="l01663"></a>01663     }
-<a name="l01664"></a>01664     <span class="keywordflow">return</span> 0;
-<a name="l01665"></a>01665 }
-<a name="l01666"></a>01666 
-<a name="l01667"></a>01667 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01673"></a>01673 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01674"></a>01674 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_keywords(
-<a name="l01675"></a>01675         cpl_frameset    *   <span class="keyword">set</span>,
-<a name="l01676"></a>01676         <span class="keywordtype">int</span>             *   labels)
-<a name="l01677"></a>01677 {
-<a name="l01678"></a>01678     <span class="keywordtype">int</span>                     nframes ;
-<a name="l01679"></a>01679     cpl_vector          *   hum_vec ;
-<a name="l01680"></a>01680     cpl_frame           *   cur_frame ;
-<a name="l01681"></a>01681     cpl_propertylist    *   plist ;
-<a name="l01682"></a>01682     <span class="keywordtype">int</span>                     iframe;
-<a name="l01683"></a>01683 
-<a name="l01684"></a>01684     <span class="comment">/* Test inputs  */</span>
-<a name="l01685"></a>01685     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01686"></a>01686 
-<a name="l01687"></a>01687     <span class="comment">/* Initialize */</span>
-<a name="l01688"></a>01688     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l01689"></a>01689     hawki_cal_zpoint_outputs.mean_airmass   = 0.0 ;
-<a name="l01690"></a>01690 
-<a name="l01691"></a>01691     hum_vec = cpl_vector_new(nframes) ;
-<a name="l01692"></a>01692 
-<a name="l01693"></a>01693     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) {
-<a name="l01694"></a>01694         <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01695"></a>01695             cpl_vector_delete(hum_vec) ;
-<a name="l01696"></a>01696             <span class="keywordflow">return</span> -1 ;
-<a name="l01697"></a>01697         }
-<a name="l01698"></a>01698         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, iframe) ;
-<a name="l01699"></a>01699         plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0) ;
-<a name="l01700"></a>01700         <span class="keywordflow">if</span> (iframe==0) 
-<a name="l01701"></a>01701             hawki_cal_zpoint_outputs.mean_airmass += 
-<a name="l01702"></a>01702                 <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) ; 
-<a name="l01703"></a>01703         <span class="keywordflow">if</span> (iframe==nframes-1) 
-<a name="l01704"></a>01704             hawki_cal_zpoint_outputs.mean_airmass += 
-<a name="l01705"></a>01705                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist);
-<a name="l01706"></a>01706         hawki_cal_zpoint_outputs.airmass[labels[iframe] - 1] = 
-<a name="l01707"></a>01707             (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) + 
-<a name="l01708"></a>01708              <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist)) / 2.;
-<a name="l01709"></a>01709         cpl_vector_set(hum_vec,  iframe, <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(plist));
-<a name="l01710"></a>01710         cpl_propertylist_delete(plist) ;
-<a name="l01711"></a>01711         <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01712"></a>01712             cpl_vector_delete(hum_vec) ;
-<a name="l01713"></a>01713             cpl_error_reset() ;
-<a name="l01714"></a>01714             <span class="keywordflow">return</span> -1 ;
-<a name="l01715"></a>01715         }
-<a name="l01716"></a>01716     }
-<a name="l01717"></a>01717     hawki_cal_zpoint_outputs.humidity  = cpl_vector_get_mean(hum_vec) ;
-<a name="l01718"></a>01718     hawki_cal_zpoint_outputs.mean_airmass /= 2 ;
-<a name="l01719"></a>01719 
-<a name="l01720"></a>01720     <span class="comment">/* Free and return */</span>
-<a name="l01721"></a>01721     cpl_vector_delete(hum_vec) ;
-<a name="l01722"></a>01722     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l01723"></a>01723     <span class="keywordflow">return</span> 0 ;
-<a name="l01724"></a>01724 }
-<a name="l01725"></a>01725 
-<a name="l01726"></a>01726 <span class="keyword">static</span> cpl_error_code hawki_cal_zpoint_get_expected_pos
-<a name="l01727"></a>01727 (cpl_frameset * <span class="keyword">set</span>,
-<a name="l01728"></a>01728  <span class="keywordtype">int</span>          * labels)
-<a name="l01729"></a>01729 {
-<a name="l01730"></a>01730     <span class="keyword">const</span> <span class="keywordtype">char</span> *  filename;
-<a name="l01731"></a>01731     <span class="keywordtype">int</span>           iframe;
-<a name="l01732"></a>01732 
-<a name="l01733"></a>01733     <span class="keywordflow">for</span>(iframe=0 ; iframe<HAWKI_NB_DETECTORS ; iframe++)
-<a name="l01734"></a>01734     {
-<a name="l01735"></a>01735         cpl_propertylist * wcs_plist;
-<a name="l01736"></a>01736         cpl_wcs          * wcs;
-<a name="l01737"></a>01737         <span class="keywordtype">int</span>                idet;
-<a name="l01738"></a>01738 
-<a name="l01739"></a>01739         idet = labels[iframe];
-<a name="l01740"></a>01740         <span class="keywordflow">if</span>(hawki_cal_zpoint_config.xcoord[idet - 1] == -1 ||
-<a name="l01741"></a>01741                 hawki_cal_zpoint_config.ycoord[idet - 1] == -1)
-<a name="l01742"></a>01742         {
-<a name="l01743"></a>01743             filename = cpl_frame_get_filename
-<a name="l01744"></a>01744                 (cpl_frameset_get_frame_const(<span class="keyword">set</span>, iframe));
-<a name="l01745"></a>01745             wcs_plist = cpl_propertylist_load
-<a name="l01746"></a>01746                 (filename, <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename, idet));
-<a name="l01747"></a>01747             wcs = cpl_wcs_new_from_propertylist(wcs_plist);
-<a name="l01748"></a>01748             cpl_propertylist_delete(wcs_plist);
-<a name="l01749"></a>01749             <span class="keywordflow">if</span>(wcs == NULL)
-<a name="l01750"></a>01750             {
-<a name="l01751"></a>01751                 cpl_msg_error(__func__, <span class="stringliteral">"Could not get WCS info"</span>);
-<a name="l01752"></a>01752                 cpl_wcs_delete(wcs);
-<a name="l01753"></a>01753                 <span class="keywordflow">return</span> CPL_ERROR_ILLEGAL_INPUT;
-<a name="l01754"></a>01754             }
-<a name="l01755"></a>01755             <span class="keywordflow">if</span>(irplib_wcs_radectoxy(wcs,
-<a name="l01756"></a>01756                                     hawki_cal_zpoint_outputs.stdstar_ra,
-<a name="l01757"></a>01757                                     hawki_cal_zpoint_outputs.stdstar_dec,
-<a name="l01758"></a>01758                                     &(hawki_cal_zpoint_config.xcoord[idet - 1]),
-<a name="l01759"></a>01759                                     &(hawki_cal_zpoint_config.ycoord[idet - 1]))
-<a name="l01760"></a>01760                     != CPL_ERROR_NONE)
-<a name="l01761"></a>01761             {
-<a name="l01762"></a>01762                 cpl_msg_error(__func__,<span class="stringliteral">"Could not get the expected position of star"</span>);
-<a name="l01763"></a>01763                 cpl_wcs_delete(wcs);
-<a name="l01764"></a>01764                 <span class="keywordflow">return</span> CPL_ERROR_UNSPECIFIED;
-<a name="l01765"></a>01765             }
-<a name="l01766"></a>01766             cpl_msg_info(cpl_func,
-<a name="l01767"></a>01767                          <span class="stringliteral">"Star expected position in detector %d is X=%f Y=%f"</span>,
-<a name="l01768"></a>01768                          idet, hawki_cal_zpoint_config.xcoord[idet - 1],
-<a name="l01769"></a>01769                          hawki_cal_zpoint_config.ycoord[idet - 1]);
-<a name="l01770"></a>01770 
-<a name="l01771"></a>01771             <span class="comment">/* Free */</span>
-<a name="l01772"></a>01772             cpl_wcs_delete(wcs);
-<a name="l01773"></a>01773         }
-<a name="l01774"></a>01774         <span class="keywordflow">else</span>
-<a name="l01775"></a>01775         {
-<a name="l01776"></a>01776             cpl_msg_info(cpl_func,
-<a name="l01777"></a>01777                         <span class="stringliteral">"Using given star position in detector %d: X=%f Y=%f"</span>,
-<a name="l01778"></a>01778                          idet,
-<a name="l01779"></a>01779                          hawki_cal_zpoint_config.xcoord[idet - 1],
-<a name="l01780"></a>01780                          hawki_cal_zpoint_config.ycoord[idet - 1]);
-<a name="l01781"></a>01781 
-<a name="l01782"></a>01782         }
-<a name="l01783"></a>01783     }
-<a name="l01784"></a>01784 
-<a name="l01785"></a>01785     <span class="keywordflow">return</span> 0;
-<a name="l01786"></a>01786 }
-<a name="l01787"></a>01787 
-<a name="l01788"></a>01788 
-<a name="l01789"></a>01789 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_cal_zpoint_output_init(<span class="keywordtype">void</span>)
-<a name="l01790"></a>01790 {
-<a name="l01791"></a>01791     <span class="keywordtype">int</span> idet;
-<a name="l01792"></a>01792 
-<a name="l01793"></a>01793     hawki_cal_zpoint_outputs.starname[0] = (char)0 ;
-<a name="l01794"></a>01794     hawki_cal_zpoint_outputs.sptype[0] = (char)0 ;
-<a name="l01795"></a>01795     hawki_cal_zpoint_outputs.filter[0] = (char)0 ;
-<a name="l01796"></a>01796     hawki_cal_zpoint_outputs.catalog[0] = (char)0 ;
-<a name="l01797"></a>01797     hawki_cal_zpoint_outputs.pixscale = -1.0 ;
-<a name="l01798"></a>01798     hawki_cal_zpoint_outputs.dit = -1.0 ;
-<a name="l01799"></a>01799     hawki_cal_zpoint_outputs.humidity = -1.0 ;
-<a name="l01800"></a>01800     hawki_cal_zpoint_outputs.mean_airmass = -1.0 ;
-<a name="l01801"></a>01801     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l01802"></a>01802     {
-<a name="l01803"></a>01803         hawki_cal_zpoint_outputs.airmass[idet] = -1.0 ;
-<a name="l01804"></a>01804         hawki_cal_zpoint_outputs.zpoint[idet] = -1.0 ;
-<a name="l01805"></a>01805         hawki_cal_zpoint_outputs.atx0[idet] = -1.0 ;
-<a name="l01806"></a>01806         hawki_cal_zpoint_outputs.posx[idet] = -1.0 ;
-<a name="l01807"></a>01807         hawki_cal_zpoint_outputs.posy[idet] = -1.0 ;
-<a name="l01808"></a>01808         hawki_cal_zpoint_outputs.flux[idet] = -1.0 ;
-<a name="l01809"></a>01809         hawki_cal_zpoint_outputs.peak[idet] = -1.0 ;
-<a name="l01810"></a>01810         hawki_cal_zpoint_outputs.bgd[idet] = -1.0 ;
-<a name="l01811"></a>01811         hawki_cal_zpoint_outputs.fwhmx[idet] = -1.0 ;
-<a name="l01812"></a>01812         hawki_cal_zpoint_outputs.fwhmy[idet] = -1.0 ;
-<a name="l01813"></a>01813         hawki_cal_zpoint_outputs.fwhm[idet] = -1.0 ;
-<a name="l01814"></a>01814         hawki_cal_zpoint_outputs.fwhmx_as[idet] = -1.0 ;
-<a name="l01815"></a>01815         hawki_cal_zpoint_outputs.fwhmy_as[idet] = -1.0 ;
-<a name="l01816"></a>01816         hawki_cal_zpoint_outputs .fwhm_as[idet] = -1.0 ;
-<a name="l01817"></a>01817     }
-<a name="l01818"></a>01818 }
-<a name="l01819"></a>01819 
-<a name="l01820"></a>01820 <span class="keywordtype">int</span> hawki_cal_zpoint_retrieve_input_param
-<a name="l01821"></a>01821 (cpl_parameterlist  *  parlist)
-<a name="l01822"></a>01822 {
-<a name="l01823"></a>01823     cpl_parameter   *   par ;
-<a name="l01824"></a>01824     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;
-<a name="l01825"></a>01825 
-<a name="l01826"></a>01826     par = NULL ;
-<a name="l01827"></a>01827 
-<a name="l01828"></a>01828     <span class="comment">/* --ra */</span>
-<a name="l01829"></a>01829     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.ra"</span>) ;
-<a name="l01830"></a>01830     hawki_cal_zpoint_config.target_ra = cpl_parameter_get_double(par) ;
-<a name="l01831"></a>01831     <span class="comment">/* --dec */</span>
-<a name="l01832"></a>01832     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.dec"</span>) ;
-<a name="l01833"></a>01833     hawki_cal_zpoint_config.target_dec = cpl_parameter_get_double(par) ;
-<a name="l01834"></a>01834     <span class="comment">/* --mag */</span>
-<a name="l01835"></a>01835     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.mag"</span>) ;
-<a name="l01836"></a>01836     hawki_cal_zpoint_config.stdstar_given_magnitude = 
-<a name="l01837"></a>01837             cpl_parameter_get_double(par) ;
-<a name="l01838"></a>01838     <span class="comment">/* --detect_sigma */</span>
-<a name="l01839"></a>01839     par = cpl_parameterlist_find(parlist,<span class="stringliteral">"hawki.hawki_cal_zpoint.detect_sigma"</span>);
-<a name="l01840"></a>01840     hawki_cal_zpoint_config.detect_sigma = cpl_parameter_get_double(par) ;
-<a name="l01841"></a>01841     <span class="comment">/* --sx */</span>
-<a name="l01842"></a>01842     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.sx"</span>) ;
-<a name="l01843"></a>01843     hawki_cal_zpoint_config.sx = cpl_parameter_get_int(par) ;
-<a name="l01844"></a>01844     <span class="comment">/* --sy */</span>
-<a name="l01845"></a>01845     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.sy"</span>) ;
-<a name="l01846"></a>01846     hawki_cal_zpoint_config.sy = cpl_parameter_get_int(par) ;
-<a name="l01847"></a>01847     <span class="comment">/* --star_r */</span>
-<a name="l01848"></a>01848     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.star_r"</span>) ;
-<a name="l01849"></a>01849     hawki_cal_zpoint_config.phot_star_radius = cpl_parameter_get_double(par) ;
-<a name="l01850"></a>01850     <span class="comment">/* --bg_r1 */</span>
-<a name="l01851"></a>01851     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r1"</span>) ;
-<a name="l01852"></a>01852     hawki_cal_zpoint_config.phot_bg_r1 = cpl_parameter_get_double(par) ;
-<a name="l01853"></a>01853     <span class="comment">/* --bg_r2 */</span>
-<a name="l01854"></a>01854     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r2"</span>) ;
-<a name="l01855"></a>01855     hawki_cal_zpoint_config.phot_bg_r2 = cpl_parameter_get_double(par) ;
-<a name="l01856"></a>01856     <span class="comment">/* --xcoord */</span>
-<a name="l01857"></a>01857     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.xcoord"</span>);
-<a name="l01858"></a>01858     sval = cpl_parameter_get_string(par);
-<a name="l01859"></a>01859     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,
-<a name="l01860"></a>01860                hawki_cal_zpoint_config.xcoord,
-<a name="l01861"></a>01861                hawki_cal_zpoint_config.xcoord+1,
-<a name="l01862"></a>01862                hawki_cal_zpoint_config.xcoord+2,
-<a name="l01863"></a>01863                hawki_cal_zpoint_config.xcoord+3)!=4)
-<a name="l01864"></a>01864     {
-<a name="l01865"></a>01865         <span class="keywordflow">return</span> -1;
-<a name="l01866"></a>01866     }
-<a name="l01867"></a>01867     <span class="comment">/* --ycoord */</span>
-<a name="l01868"></a>01868     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.ycoord"</span>);
-<a name="l01869"></a>01869     sval = cpl_parameter_get_string(par);
-<a name="l01870"></a>01870     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,
-<a name="l01871"></a>01871                hawki_cal_zpoint_config.ycoord,
-<a name="l01872"></a>01872                hawki_cal_zpoint_config.ycoord+1,
-<a name="l01873"></a>01873                hawki_cal_zpoint_config.ycoord+2,
-<a name="l01874"></a>01874                hawki_cal_zpoint_config.ycoord+3)!=4)
-<a name="l01875"></a>01875     {
-<a name="l01876"></a>01876         <span class="keywordflow">return</span> -1;
-<a name="l01877"></a>01877     }
-<a name="l01878"></a>01878 
-<a name="l01879"></a>01879     <span class="keywordflow">return</span> 0;
-<a name="l01880"></a>01880 }
-<a name="l01881"></a>01881 
-<a name="l01882"></a>01882 <span class="keywordtype">int</span> hawki_cal_zpoint_check_epoch_equinox(cpl_propertylist * plist)
-<a name="l01883"></a>01883 {
-<a name="l01884"></a>01884     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(plist) != 2000. ||
-<a name="l01885"></a>01885        <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(plist) != 2000.)
-<a name="l01886"></a>01886     {
-<a name="l01887"></a>01887         cpl_msg_error(__func__,<span class="stringliteral">"Epoch and equinox must be 2000."</span>);
-<a name="l01888"></a>01888         <span class="keywordflow">return</span> -1;
-<a name="l01889"></a>01889     }
-<a name="l01890"></a>01890     <span class="keywordflow">else</span>
-<a name="l01891"></a>01891         <span class="keywordflow">return</span> 0;
-<a name="l01892"></a>01892 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_cal_zpoint.c,v 1.36 2013/02/01 16:51:43 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/02/01 16:51:43 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.36 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_calib.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "irplib_strehl.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "irplib_stdstar.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "irplib_cat.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "irplib_wcs.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="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#include "hawki_alloc.h"</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="l00057"></a><span class="lineno">   57</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint(cpl_parameterlist *, cpl_frameset *) ;</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="keywordtype">void</span> hawki_cal_zpoint_output_init(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_retrieve_input_param</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_reduce</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> (cpl_frameset    *   <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_table       **  raw_zpoint_stats,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keywordtype">int</span>             *   labels,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  cpl_imagelist   **  images);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_save</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> (cpl_table           **  zpoint_tables,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keywordtype">int</span>                 *   labels,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_imagelist       *   images,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_table           **  raw_zpoint_stats,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>  cpl_frameset        *   zpoint_frames,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>  cpl_frameset        *   calib_frames,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  <span class="keyword">const</span> cpl_frame     *   stars_frame,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  cpl_frameset        *   <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_qc</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> (cpl_propertylist *   qcmainparams, </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  cpl_propertylist **  qcextparams,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>  cpl_frameset     *   <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_photom</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> (cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  cpl_bivector        *   pos,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  <span class="keywordtype">int</span>                 *   labels);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_get_mag(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, hawki_band) ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_keywords</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> (cpl_frameset * <span class="keyword">set</span>, </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>  <span class="keywordtype">int</span>          * labels);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="keyword">static</span> cpl_error_code  hawki_cal_zpoint_get_expected_pos</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> (cpl_frameset * <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>  <span class="keywordtype">int</span>          * labels);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">int</span> hawki_cal_zpoint_check_epoch_equinox(cpl_propertylist * plist);</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="keyword">static</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="comment">/* Inputs */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="keywordtype">double</span>      xcoord[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordtype">double</span>      ycoord[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="keywordtype">double</span>      target_ra;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="keywordtype">double</span>      target_dec;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordtype">double</span>      stdstar_given_magnitude;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="keywordtype">double</span>      detect_sigma ;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keywordtype">int</span>         sx ;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordtype">int</span>         sy ;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordtype">double</span>      phot_star_radius ;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordtype">double</span>      phot_bg_r1 ;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keywordtype">double</span>      phot_bg_r2 ;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> } hawki_cal_zpoint_config;</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="keyword">struct </span>{</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="comment">/* Outputs */</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="keywordtype">double</span>      dit;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="keywordtype">double</span>      pixscale;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="keywordtype">char</span>        filter[512];</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     hawki_band  band;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordtype">char</span>        starname[512];</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordtype">char</span>        sptype[512];</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordtype">char</span>        catalog[512];</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="keywordtype">double</span>      humidity;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="keywordtype">double</span>      airmass[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="keywordtype">double</span>      zpoint[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordtype">double</span>      atx0[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordtype">double</span>      posx[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordtype">double</span>      posy[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordtype">double</span>      flux[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordtype">double</span>      instrmag[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="keywordtype">double</span>      peak[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="keywordtype">double</span>      bgd[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordtype">double</span>      fwhmx[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordtype">double</span>      fwhmy[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordtype">double</span>      fwhm[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="keywordtype">double</span>      fwhmx_as[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordtype">double</span>      fwhmy_as[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keywordtype">double</span>      fwhm_as[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordtype">double</span>      mean_zpoint;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordtype">double</span>      mean_atx0;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordtype">double</span>      mean_airmass;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keywordtype">double</span>      ext_coeff;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keywordtype">double</span>      stdstar_ra;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordtype">double</span>      stdstar_dec;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordtype">double</span>      stdstar_mag_filter;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordtype">double</span>      stdstar_mag_H;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordtype">double</span>      stdstar_mag_J;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keywordtype">double</span>      stdstar_mag_K;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keywordtype">double</span>      stdstar_mag_Y;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordtype">int</span>         stdstar_incat_found;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordtype">int</span>         stdstar_mag_available;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordtype">int</span>         stdstar_image_detected[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keywordtype">int</span>         zpoint_computable[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordtype">int</span>         zpoint_mean_computable;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> } hawki_cal_zpoint_outputs;</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="keyword">static</span> <span class="keywordtype">char</span> hawki_cal_zpoint_description[] =</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="stringliteral">"hawki_cal_zpoint -- Zero point recipe\n"</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_CAL_ZPOINT_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="stringliteral">"stdstars-file.fits "</span>HAWKI_CALPRO_STDSTARS<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="stringliteral">"hawki_cal_zpoint.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): Zero point solution table\n"</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="stringliteral">"hawki_cal_zpoint_check.fits ("</span>HAWKI_CALPRO_ZPOINT_IMA<span class="stringliteral">"): Standard star images corrected (for checking purposes)\n"</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="stringliteral">"hawki_cal_zpoint_stats.fits ("</span>HAWKI_CALPRO_ZPOINT_STATS<span class="stringliteral">"): Statistics of the raw standard star images\n"</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="stringliteral">"or 1 otherwise"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">                                Functions code</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="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe));</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_plugin  *   plugin = &recipe->interface;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                     <span class="stringliteral">"hawki_cal_zpoint"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                     <span class="stringliteral">"Zero point computation recipe"</span>,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                     hawki_cal_zpoint_description,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                     hawki_cal_zpoint_create,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                     hawki_cal_zpoint_exec,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                     hawki_cal_zpoint_destroy) ;</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_pluginlist_append(list, plugin) ;</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 class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_create(cpl_plugin * plugin)</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_recipe      * recipe ;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     recipe->parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="comment">/* --detect_sigma */</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.detect_sigma"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>             CPL_TYPE_DOUBLE, <span class="stringliteral">"the sigma value for object detection"</span>,</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 7.0);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"detect_sigma"</span>) ;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="comment">/* --star_r */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.star_r"</span>,CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>             <span class="stringliteral">"the star radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.0) ;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"star_r"</span>) ;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="comment">/* --bg_r1 */</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r1"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>             <span class="stringliteral">"the internal background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.0) ;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"bg_r1"</span>) ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="comment">/* --bg_r2 */</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r2"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>             <span class="stringliteral">"the external background radius"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, -1.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">"bg_r2"</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>     <span class="comment">/* --ra */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.ra"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>             <span class="stringliteral">"RA in degrees"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 999.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">"ra"</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>     <span class="comment">/* --dec */</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.dec"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>             <span class="stringliteral">"DEC in degrees"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 999.0) ;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dec"</span>) ;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="comment">/* --mag */</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.mag"</span>, CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>             <span class="stringliteral">"magnitude"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 99.0) ;</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">"mag"</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>     <span class="comment">/* --sx */</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.sx"</span>, CPL_TYPE_INT,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>             <span class="stringliteral">"x half-size of the search box"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 100) ;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sx"</span>) ;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="comment">/* --sy */</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.sy"</span>, CPL_TYPE_INT,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>             <span class="stringliteral">"y half-size of the search box"</span>, <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, 100) ;</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">"sy"</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>     <span class="comment">/* --xcoord */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.xcoord"</span>, CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>             <span class="stringliteral">"Coordinates in X where the standard star is located. If -1 use WCS"</span>,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, <span class="stringliteral">"-1., -1., -1., -1."</span>);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcoord"</span>) ;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_parameterlist_append(recipe->parameters, p) ;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="comment">/* --ycoord */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_cal_zpoint.ycoord"</span>, CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>             <span class="stringliteral">"Coordinates in Y where the standard star is located. If -1 use WCS"</span>,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>             <span class="stringliteral">"hawki.hawki_cal_zpoint"</span>, <span class="stringliteral">"-1., -1., -1., -1."</span>) ;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ycoord"</span>) ;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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="comment">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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 the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_cal_zpoint(recipe->parameters, recipe->frames) ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint(</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         cpl_frameset        *   framelist)</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>     cpl_parameter   *   par ;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat ;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm ;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars ;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cpl_frameset    *   zpoint_frames ;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_frameset    *   calib_frames ;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> cpl_frame *   stars_frame;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_table       **  raw_zpoint_stats;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_table       **  zpoint_tables;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     cpl_imagelist   *   std_star_images ;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordtype">int</span>             *   labels;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordtype">int</span>                 idet;</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">/* Initialise Output */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     hawki_cal_zpoint_output_init();</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     zpoint_frames = NULL ;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     par = 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="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordflow">if</span>(hawki_cal_zpoint_retrieve_input_param(parlist))</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>         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</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> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Retrieve calibration data */</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     calib_frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     flat = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_FLAT) ;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     <span class="keywordflow">if</span>(flat)</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT)));</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     bpm = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_BPM) ;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">if</span>(bpm)</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM)));</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">/* STD stars catalog requested */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     stars_frame = cpl_frameset_find_const(framelist, HAWKI_CALPRO_STDSTARS);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">if</span> (stars_frame  == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Cannot find the catalog in the input list (%s)"</span>,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                       HAWKI_CALPRO_STDSTARS);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         <span class="keywordflow">return</span> -1 ;</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>     stdstars = cpl_frame_get_filename(stars_frame);</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keywordflow">if</span> ((zpoint_frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                     HAWKI_CAL_ZPOINT_RAW)) != NULL) {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list (%s)"</span>,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                       HAWKI_CAL_ZPOINT_RAW);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Exactly 4 images are expected */</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (cpl_frameset_get_size(zpoint_frames) != 4) {</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         cpl_msg_error(__func__, </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                       <span class="stringliteral">"4 input raw frames are expected, not %"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                       cpl_frameset_get_size(zpoint_frames)) ;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         cpl_frameset_delete(zpoint_frames) ;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         <span class="keywordflow">return</span> -1 ;</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">/* Create the statistics table */</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     raw_zpoint_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     <span class="keywordflow">for</span>(idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         raw_zpoint_stats[idet] = cpl_table_new(</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>             cpl_frameset_get_size(zpoint_frames));</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>     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_zpoint_stats);</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="comment">/* Compute the zpoint values */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_msg_info(__func__, <span class="stringliteral">"Reduce the data"</span>) ;</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>     labels = cpl_calloc(cpl_frameset_get_size(zpoint_frames), <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)) ;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">if</span> ((zpoint_tables = hawki_cal_zpoint_reduce(zpoint_frames, stdstars, </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>              bpm, flat, raw_zpoint_stats, labels, &std_star_images))==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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce the data"</span>) ;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         cpl_frameset_delete(zpoint_frames) ;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         cpl_free(labels);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         <span class="keywordflow">return</span> -1 ;</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_indent_less() ;</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">/* Save the products */</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <span class="keywordflow">if</span> (hawki_cal_zpoint_save</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>             (zpoint_tables, labels, std_star_images, raw_zpoint_stats, </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>              zpoint_frames, calib_frames, stars_frame,</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>              parlist, framelist) == -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>         cpl_msg_warning(__func__, <span class="stringliteral">"Data could not be saved. "</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                         <span class="stringliteral">"Check permisions or disk space"</span>) ;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_frameset_delete(zpoint_frames);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables) ;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         cpl_imagelist_delete(std_star_images) ;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         cpl_free(labels);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         <span class="keywordflow">return</span> -1 ;</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_msg_indent_less() ;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     cpl_frameset_delete(zpoint_frames);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     cpl_imagelist_delete(std_star_images);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(raw_zpoint_stats);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_free(labels);</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">/* Return */</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_msg_error(__func__,</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         <span class="keywordflow">return</span> -1 ;</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">else</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_reduce</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> (cpl_frameset    *   <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>  cpl_table       **  raw_zpoint_stats,</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>  <span class="keywordtype">int</span>             *   labels,</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>  cpl_imagelist   **  star_images)</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>     cpl_frame           *   cur_frame ;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     cpl_imagelist       *   star_images_frame_order ;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordtype">int</span>                     nima ;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cpl_bivector        *   positions ;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     cpl_image           *   filt_ima ;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     cpl_mask            *   kernel;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordtype">int</span>                     size_x, size_y ;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     <span class="keywordtype">double</span>                  pos_x, pos_y, pos_x_cen, pos_y_cen, dist, min_dist ;</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     cpl_apertures       *   aperts ;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     cpl_table           **  zpoint_tables;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     cpl_image           *   tmp_ima ;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keywordtype">int</span>                     iaper;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordtype">int</span>                     iframe;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordtype">int</span>                     iframe_star = -1;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     <span class="keywordtype">int</span>                     nframes;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordtype">char</span>                    rastr[32];</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordtype">char</span>                    decstr[32];</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     cpl_errorstate          error_prevstate;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordtype">int</span>                     return_code;</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">/* Check inputs */</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     <span class="keywordflow">if</span> (stdstars == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="keywordflow">if</span> (star_images == NULL) <span class="keywordflow">return</span> NULL ;</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="comment">/* Get the filter name, DIT, Target RA and DEC  */</span></div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     error_prevstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, 0) ;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     plist=cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0) ;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">if</span> ((sval = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist)) == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordflow">else</span> sprintf(hawki_cal_zpoint_outputs.filter, sval) ;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">if</span> (hawki_cal_zpoint_config.target_ra > 998.0)</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>         hawki_cal_zpoint_config.target_ra = <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(plist);</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         <span class="comment">//hawki_cal_zpoint_config.target_ra = hawki_pfits_get_ra(plist) -</span></div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         <span class="comment">//hawki_pfits_get_cumoffseta(plist) / 3600.;// Not valid before Nov 2008</span></div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_check_epoch_equinox(plist) == -1)</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_propertylist_delete(plist);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>             <span class="keywordflow">return</span> NULL;</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">if</span> (hawki_cal_zpoint_config.target_dec > 998.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>         hawki_cal_zpoint_config.target_dec = <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(plist);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         <span class="comment">//hawki_cal_zpoint_config.target_dec = hawki_pfits_get_dec(plist) -</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         <span class="comment">//hawki_pfits_get_cumoffsetd(plist) / 3600.;// Not valid before Nov 2008</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_check_epoch_equinox(plist) == -1)</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_propertylist_delete(plist);</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>             <span class="keywordflow">return</span> NULL;</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>     hawki_cal_zpoint_outputs.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     hawki_cal_zpoint_outputs.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist) ;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get keywords from main header:"</span>);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         cpl_msg_error(__func__, <span class="stringliteral">"%s"</span>,cpl_error_get_message());</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>         <span class="keywordflow">return</span> NULL ;</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(__func__,<span class="stringliteral">"Searching catalog stars closest to target:"</span>);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_config.target_ra);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_config.target_dec);</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     cpl_msg_info(__func__,<span class="stringliteral">"RA = %g (%s); DEC = %g (%s)"</span>,</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                  hawki_cal_zpoint_config.target_ra, rastr,</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                  hawki_cal_zpoint_config.target_dec, decstr);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     cpl_msg_info(__func__,<span class="stringliteral">"HAWK-I Filter: %s"</span>, hawki_cal_zpoint_outputs.filter);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_msg_indent_less();</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">/* Get the band */</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keywordflow">if</span> ((hawki_cal_zpoint_outputs.band =</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>                 <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(hawki_cal_zpoint_outputs.filter)) ==</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>             HAWKI_BAND_UNKNOWN) {</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot associate the filter %s to a band"</span>,</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>                 hawki_cal_zpoint_outputs.filter) ;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     <span class="comment">/* Get the standard star information from database */</span></div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     return_code = hawki_cal_zpoint_get_mag(stdstars,</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             hawki_cal_zpoint_config.target_ra,</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             hawki_cal_zpoint_config.target_dec,</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>             hawki_cal_zpoint_outputs.band);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (return_code == -1)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Could not open star database"</span>);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         <span class="keywordflow">return</span> NULL ;</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">else</span> <span class="keywordflow">if</span>(return_code == 1)</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_msg_warning(__func__,<span class="stringliteral">"No suitable star found in catalog"</span>);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         cpl_msg_warning(__func__,<span class="stringliteral">"Using the target coordinates "</span></div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                         <span class="stringliteral">"as the standard star coordinates: "</span>);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         hawki_cal_zpoint_outputs.stdstar_ra = </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                 hawki_cal_zpoint_config.target_ra;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         hawki_cal_zpoint_outputs.stdstar_dec = </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>                 hawki_cal_zpoint_config.target_dec;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_outputs.stdstar_ra);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_outputs.stdstar_dec);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>         cpl_msg_info(__func__, <span class="stringliteral">" RA = %g (%s) ; DEC = %g (%s)"</span>,</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>                      hawki_cal_zpoint_outputs.stdstar_ra, rastr,</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                      hawki_cal_zpoint_outputs.stdstar_dec, decstr);</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">else</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>         cpl_msg_info(__func__, <span class="stringliteral">"Catalog where the star was found: %s"</span>,</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                      hawki_cal_zpoint_outputs.catalog);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         cpl_msg_info(__func__, <span class="stringliteral">"Star name: %s"</span>,</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                      hawki_cal_zpoint_outputs.starname);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)</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_info(__func__, <span class="stringliteral">"Star magnitude in filter %s : %g [mag]"</span>,</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>                     hawki_cal_zpoint_outputs.filter,</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                     hawki_cal_zpoint_outputs.stdstar_mag_filter);</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>         <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(rastr, 32, hawki_cal_zpoint_outputs.stdstar_ra);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(decstr, 32, hawki_cal_zpoint_outputs.stdstar_dec);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>         cpl_msg_info(__func__, <span class="stringliteral">"Star coordinates: RA = %g (%s) ; DEC = %g (%s)"</span>,</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>                      hawki_cal_zpoint_outputs.stdstar_ra, rastr,</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                      hawki_cal_zpoint_outputs.stdstar_dec, decstr);</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> (hawki_cal_zpoint_config.stdstar_given_magnitude < 98.0) </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>         hawki_cal_zpoint_outputs.stdstar_mag_available = 1;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>         hawki_cal_zpoint_outputs.stdstar_mag_filter = </div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                 hawki_cal_zpoint_config.stdstar_given_magnitude;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         cpl_msg_info(__func__, <span class="stringliteral">"Using user defined "</span></div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>                      <span class="stringliteral">"star magnitude in filter %s : %g [mag]"</span>,</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                      hawki_cal_zpoint_outputs.filter,</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                      hawki_cal_zpoint_outputs.stdstar_mag_filter);</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>     cpl_msg_indent_less();</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="comment">/* Labelise frames */</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     cpl_msg_info(__func__, <span class="stringliteral">"Guessing which frame the STD is in for each chip"</span>);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         (<span class="keyword">set</span>, hawki_cal_zpoint_outputs.stdstar_ra,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>          hawki_cal_zpoint_outputs.stdstar_dec, labels);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordflow">if</span> (labels == NULL)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot determine which frame the STD is on"</span>) ;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     <span class="comment">/* Compute the expected position of the star in pixels */</span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="comment">/* This is stored in hawki_cal_zpoint_config.xcoord, ycoord */</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>     <span class="keywordflow">if</span>(hawki_cal_zpoint_get_expected_pos(<span class="keyword">set</span>, labels) != CPL_ERROR_NONE)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not determine where the star is located"</span>);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>         <span class="keywordflow">return</span> 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>     cpl_msg_indent_less();</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="comment">/* Fetch the airmass and humidity */</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     hawki_cal_zpoint_compute_keywords(<span class="keyword">set</span>, labels);</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">/* Create the positions vector */</span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     nima = cpl_frameset_get_size(<span class="keyword">set</span>) ;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     positions = cpl_bivector_new(nima) ;</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">/* Initialize */</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     *star_images = cpl_imagelist_new();</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">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     cpl_msg_info(__func__,<span class="stringliteral">"Loop on the chips"</span>);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>         cpl_imagelist * sky_images;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>         cpl_image     * star_ima = NULL;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         cpl_image     * sky;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>         cpl_image     * flat_im;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         <span class="keywordtype">int</span>             ext_nb;</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_info(__func__, <span class="stringliteral">"Loading the chip %d"</span>, idet+1);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         cpl_msg_indent_more() ;</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="comment">/* Allocate */</span></div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>         sky_images = cpl_imagelist_new();</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>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>         <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++)</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_image * ima_cur;</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">/* Load the image */</span></div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>             ima_cur = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(<span class="keyword">set</span>, iframe, idet+1, CPL_TYPE_FLOAT) ;</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>             <span class="keywordflow">if</span>(ima_cur == 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>                 cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>                 cpl_imagelist_delete(*star_images);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                 cpl_imagelist_delete(sky_images) ;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                 cpl_msg_error(__func__, <span class="stringliteral">"Error reading image"</span>);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                 <span class="keywordflow">return</span> 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="comment">/* Get image statistics */</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>             size_x = cpl_image_get_size_x(ima_cur) ;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>             size_y = cpl_image_get_size_y(ima_cur) ;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>             <span class="keywordflow">if</span>(<a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                 (raw_zpoint_stats,</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>                  ima_cur,</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>                  1,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                  1,</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>                  size_x,</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>                  size_y,</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                  idet,</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>                  iframe) !=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>                 cpl_msg_error(__func__,<span class="stringliteral">"Cannot compute stats on ima %d det %d"</span>,</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>                               iframe+1, idet+1);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>                 cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>                 cpl_imagelist_delete(*star_images);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                 cpl_imagelist_delete(sky_images) ;</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>                 cpl_image_delete(ima_cur);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                 <span class="keywordflow">return</span> NULL ;</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="comment">/* Add the image to either the sky images or the star image */</span></div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>             <span class="keywordflow">if</span>(labels[iframe] == idet + 1)</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>                 star_ima = ima_cur;</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                 iframe_star = iframe;</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">else</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                 cpl_imagelist_set(sky_images, ima_cur,</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>                                   cpl_imagelist_get_size(sky_images));</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_msg_indent_less();</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">/* Create the sky */</span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>         cpl_msg_info(__func__, <span class="stringliteral">"Correct for the sky"</span>);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         sky = cpl_imagelist_collapse_median_create(sky_images);</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         cpl_imagelist_delete(sky_images) ;</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="comment">/* Subtract the sky */</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         cpl_image_subtract(star_ima, sky) ;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         cpl_image_delete(sky) ;</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">/* Divide by the flatfield if one is provided */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>         <span class="keywordflow">if</span> (flat) {</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             cpl_msg_info(__func__, <span class="stringliteral">"Correct for the flat"</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="comment">/* Get the extension with the current chip */</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>             <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(flat, idet + 1)) == -1)</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>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                               idet + 1);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>                 cpl_imagelist_delete(*star_images) ;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>                 cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                 <span class="keywordflow">return</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="comment">/* Load */</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             flat_im = cpl_image_load(flat, CPL_TYPE_FLOAT, 0, ext_nb) ;</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>             cpl_image_divide(star_ima, flat_im) ;</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             cpl_image_delete(flat_im) ;</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>         <span class="comment">/* Correct the bad pixels */</span></div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         <span class="keywordflow">if</span> (bpm) {</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>             cpl_msg_info(__func__, <span class="stringliteral">"Correct for the bad pixels"</span>) ;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>             <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a>(star_ima, bpm, idet + 1) == -1)</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>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct the BPM for chip %d"</span>,</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>                               idet + 1);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                 cpl_imagelist_delete(*star_images) ;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>                 cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>                 <span class="keywordflow">return</span> NULL ;</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>         <span class="comment">/* Put the result in the image list */</span></div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         cpl_imagelist_set(*star_images, star_ima,</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                           cpl_imagelist_get_size(*star_images)) ;</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="comment">/* Object detection */</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         cpl_msg_info(__func__,<span class="stringliteral">"For chip %d the STD should be on frame %d"</span>,</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>                      idet + 1, iframe_star+1);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>         pos_x_cen = pos_y_cen = -1.0 ;</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         size_x = cpl_image_get_size_x(star_ima) ;</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         size_y = cpl_image_get_size_y(star_ima) ;</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">/* Filtering the image*/</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         kernel = cpl_mask_new(3, 3);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         cpl_mask_not(kernel);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         filt_ima = cpl_image_new(cpl_image_get_size_x(star_ima),</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>                                  cpl_image_get_size_y(star_ima),</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                                  cpl_image_get_type(star_ima));</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         cpl_image_filter_mask(filt_ima, star_ima, kernel, CPL_FILTER_MEDIAN, </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                               CPL_BORDER_FILTER);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         cpl_mask_delete(kernel);</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">/* Looking for apertures */</span></div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>         aperts = cpl_apertures_extract_sigma(filt_ima,</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>                 hawki_cal_zpoint_config.detect_sigma) ;</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>         cpl_image_delete(filt_ima) ;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>         <span class="keywordflow">if</span> (aperts == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot find the central object"</span>) ;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>             cpl_imagelist_delete(*star_images) ;</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>             cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             <span class="keywordflow">return</span> NULL ;</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>         min_dist = size_x * size_x + size_y * size_y ;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         <span class="keywordflow">for</span> (iaper=0 ; iaper<cpl_apertures_get_size(aperts) ; iaper++) {</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             pos_x = cpl_apertures_get_centroid_x(aperts, iaper+1) ;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             pos_y = cpl_apertures_get_centroid_y(aperts, iaper+1) ;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             dist = (pos_x-hawki_cal_zpoint_config.xcoord[idet])*</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>                     (pos_x-hawki_cal_zpoint_config.xcoord[idet]) +</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                    (pos_y-hawki_cal_zpoint_config.ycoord[idet])*</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                     (pos_y-hawki_cal_zpoint_config.ycoord[idet]);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>             <span class="keywordflow">if</span> (dist<min_dist) {</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>                 min_dist = dist ;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>                 pos_x_cen = pos_x ;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>                 pos_y_cen = pos_y ;</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>         cpl_apertures_delete(aperts) ;</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_vector_set(cpl_bivector_get_x(positions), iframe_star, pos_x_cen) ;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         cpl_vector_set(cpl_bivector_get_y(positions), iframe_star, pos_y_cen) ;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         cpl_msg_info(__func__, <span class="stringliteral">"Expected star position: %g %g"</span>,</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                 hawki_cal_zpoint_config.xcoord[idet],</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                 hawki_cal_zpoint_config.ycoord[idet]);</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         cpl_msg_info(__func__, <span class="stringliteral">"Bright object position: %g %g"</span>,</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>                 pos_x_cen, pos_y_cen) ;</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="comment">/* Check that the star is within the search window */</span></div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         <span class="keywordflow">if</span>(fabs(pos_x_cen - hawki_cal_zpoint_config.xcoord[idet]) ></div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                 hawki_cal_zpoint_config.sx                        ||</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>            fabs(pos_y_cen - hawki_cal_zpoint_config.ycoord[idet]) ></div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>                 hawki_cal_zpoint_config.sy)</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>             hawki_cal_zpoint_outputs.stdstar_image_detected[idet] = 0;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             cpl_msg_warning(cpl_func,<span class="stringliteral">"No object has been found within the box"</span></div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                             <span class="stringliteral">"limits [%d, %d] around the expected position"</span>,</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                             hawki_cal_zpoint_config.sx,</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                             hawki_cal_zpoint_config.sy);</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">else</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>             hawki_cal_zpoint_outputs.stdstar_image_detected[idet] = 1;</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> </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         cpl_msg_indent_less() ;</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>     cpl_msg_indent_less() ;</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="comment">/* Reorder the images (frame order) */</span></div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     star_images_frame_order = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>     <span class="keywordflow">for</span> (iframe=0 ; iframe< nframes; iframe++)</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>         tmp_ima = cpl_image_duplicate</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>             (cpl_imagelist_get(*star_images, labels[iframe] -1 ));</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>         cpl_imagelist_set(star_images_frame_order, tmp_ima, iframe);</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>     <span class="comment">/* Compute the photometry */</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     cpl_msg_info(__func__, <span class="stringliteral">"Compute the photometry"</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>     <span class="keywordflow">if</span> ((zpoint_tables = hawki_cal_zpoint_photom</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>             (star_images_frame_order, positions, labels))==NULL) {</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot reduce"</span>) ;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>         cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         cpl_imagelist_delete(star_images_frame_order) ;</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         <span class="keywordflow">return</span> NULL ;</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> </div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>     <span class="comment">/* Free and exit */</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>     cpl_bivector_delete(positions) ;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>     cpl_imagelist_delete(star_images_frame_order) ;</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">return</span> zpoint_tables;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span> <span class="keyword">static</span> cpl_table ** hawki_cal_zpoint_photom(</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>         cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>         cpl_bivector        *   pos,</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>         <span class="keywordtype">int</span>                 *   labels)</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>     cpl_table **        zpoint;</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>     <span class="keywordtype">int</span>                 nframes;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>     <span class="keywordtype">double</span>              r, r1, r2;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     <span class="keywordtype">double</span>              stdstar_mag;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>     <span class="keywordtype">double</span>              dit;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     <span class="keywordtype">double</span>              extinction;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>     <span class="keywordtype">double</span>              pixscale;</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>     cpl_image       *   ima ;</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>     <span class="keywordtype">double</span>          *   pos_x ;</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     <span class="keywordtype">double</span>          *   pos_y ;</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>     <span class="keywordtype">double</span>              bgd, fl, zp, peak, fwhm_x, fwhm_y ;</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>     cpl_bivector    *   iqe_res ;</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>     <span class="keywordtype">int</span>                 iframe;</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     <span class="keywordtype">int</span>                 idet;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     <span class="keywordflow">if</span> (pos == NULL) <span class="keywordflow">return</span> NULL ;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     nframes = cpl_imagelist_get_size(ilist) ;</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     stdstar_mag = hawki_cal_zpoint_outputs.stdstar_mag_filter;</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     dit = hawki_cal_zpoint_outputs.dit ;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>     pixscale = hawki_cal_zpoint_outputs.pixscale ;</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="comment">/* Get extinction */</span></div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     <span class="keywordflow">switch</span> (hawki_cal_zpoint_outputs.band) {</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>         <span class="keywordflow">case</span> HAWKI_BAND_J:      extinction = 0.098 ; break ;</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>         <span class="keywordflow">case</span> HAWKI_BAND_H:      extinction = 0.039 ; break ;</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>         <span class="keywordflow">case</span> HAWKI_BAND_K:      extinction = 0.065 ; break ;</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         <span class="keywordflow">case</span> HAWKI_BAND_Y:      extinction = 0.00 ; break ;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>         <span class="keywordflow">default</span>:                extinction = 0.00 ; break ;</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>     hawki_cal_zpoint_outputs.ext_coeff = extinction;</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>     cpl_msg_info(__func__,<span class="stringliteral">"Using tabulated extinction for band %s: %f"</span>,</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>                  hawki_cal_zpoint_outputs.filter, extinction);</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="comment">/* Loop on the images */</span></div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) {</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         idet = labels[iframe]-1;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)</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="comment">/* Get the current image */</span></div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>             ima = cpl_imagelist_get(ilist, iframe) ;</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="comment">/* Get the current position */</span></div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>             pos_x = cpl_bivector_get_x_data(pos) ;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             pos_y = cpl_bivector_get_y_data(pos) ;</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="comment">/* FWHM_X / FWHM_Y */</span></div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>             iqe_res = cpl_image_iqe</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>                     (ima, (<span class="keywordtype">int</span>)(pos_x[iframe]-10.0), (<span class="keywordtype">int</span>)(pos_y[iframe]-10.0),</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>                           (<span class="keywordtype">int</span>)(pos_x[iframe]+10.0), (<span class="keywordtype">int</span>)(pos_y[iframe]+10.0));</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             <span class="keywordflow">if</span> (iqe_res == NULL)</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>                 cpl_msg_debug(__func__,<span class="stringliteral">"Cannot compute FWHM for chip %d"</span>,</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>                         idet + 1);</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>                 fwhm_x = fwhm_y = -1.0 ;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>                 cpl_error_reset() ;</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>             } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                 fwhm_x = cpl_vector_get(cpl_bivector_get_x(iqe_res), 2) ;</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                 fwhm_y = cpl_vector_get(cpl_bivector_get_x(iqe_res), 3) ;</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                 cpl_bivector_delete(iqe_res) ;</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>             <span class="comment">/* Determine the radii */</span></div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>             r = hawki_cal_zpoint_config.phot_star_radius ;</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>             <span class="keywordflow">if</span> (r < 0) {</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                 <span class="keywordflow">if</span> (fwhm_x>0 && fwhm_y>0)   r = 5*(fwhm_x+fwhm_y)/2.0 ;</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>                 <span class="keywordflow">else</span>                        r = HAWKI_PHOT_STAR_RADIUS ;</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>             r1 = hawki_cal_zpoint_config.phot_bg_r1 ;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>             r2 = hawki_cal_zpoint_config.phot_bg_r2 ;</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>             <span class="keywordflow">if</span> (r1 < 0) r1 = r + 10.0 ;</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>             <span class="keywordflow">if</span> (r2 < 0) r2 = r1 + 20.0 ;</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>             <span class="comment">//cpl_msg_info(__func__, "Use radii for star: %g and background: %g, %g",</span></div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>             <span class="comment">//        r, r1, r2) ;</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="comment">/* Compute the photometry */</span></div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>             <span class="comment">/* Background */</span></div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>             bgd = irplib_strehl_ring_background(ima, (<span class="keywordtype">int</span>)(pos_x[iframe]),</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>                (<span class="keywordtype">int</span>)(pos_y[iframe]), (<span class="keywordtype">int</span>)r1, (<span class="keywordtype">int</span>)r2, IRPLIB_BG_METHOD_MEDIAN);</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>             <span class="comment">/* Flux */</span></div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>             fl = irplib_strehl_disk_flux(ima,</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                     (<span class="keywordtype">int</span>)(pos_x[iframe]), (<span class="keywordtype">int</span>)(pos_y[iframe]), (<span class="keywordtype">int</span>)r, bgd);</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>             <span class="comment">//cpl_msg_info(__func__, "Zero point in chip %d:   %g", labels[iframe], zp) ;</span></div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>             <span class="comment">/* Peak */</span></div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>             peak = cpl_image_get_max_window(ima,</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>                     (<span class="keywordtype">int</span>)(pos_x[iframe]-5), (<span class="keywordtype">int</span>)(pos_y[iframe]-5),</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>                     (<span class="keywordtype">int</span>)(pos_x[iframe]+5), (<span class="keywordtype">int</span>)(pos_y[iframe]+5));</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">/* Zero Point */</span></div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>             <span class="keywordflow">if</span> (hawki_cal_zpoint_outputs.stdstar_mag_available == 1)</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> (fl > 0 && dit > 0)</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>                     hawki_cal_zpoint_outputs.zpoint_computable[idet] = 1;</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>                     zp = stdstar_mag + 2.5 * log10(fl) - 2.5 * log10(dit);</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>                     hawki_cal_zpoint_outputs.zpoint[idet] = zp;</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>                     hawki_cal_zpoint_outputs.atx0[idet] = zp + </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>                             extinction * hawki_cal_zpoint_outputs.airmass[idet];</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">else</span></div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>                     hawki_cal_zpoint_outputs.zpoint_computable[idet] = 0;</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>             hawki_cal_zpoint_outputs.posx[idet] = pos_x[iframe];</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>             hawki_cal_zpoint_outputs.posy[idet] = pos_y[iframe];</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>             hawki_cal_zpoint_outputs.flux[idet] = fl;</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>             hawki_cal_zpoint_outputs.instrmag[idet] = 2.5 * log10(fl/dit);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>             hawki_cal_zpoint_outputs.peak[idet] = peak;</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>             hawki_cal_zpoint_outputs.bgd[idet] = bgd;</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>             hawki_cal_zpoint_outputs.fwhmx[idet] = fwhm_x;</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>             hawki_cal_zpoint_outputs.fwhmy[idet] = fwhm_y;</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>             <span class="keywordflow">if</span> (fwhm_x > 0 && fwhm_y > 0)</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>                 hawki_cal_zpoint_outputs.fwhm[idet] = sqrt(fwhm_x*fwhm_y);</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>                 hawki_cal_zpoint_outputs.fwhm[idet] = -1.0;</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>             hawki_cal_zpoint_outputs.fwhmx_as[idet] = fwhm_x * pixscale;</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>             hawki_cal_zpoint_outputs.fwhmy_as[idet] = fwhm_y * pixscale;</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>             <span class="keywordflow">if</span> (fwhm_x > 0 && fwhm_y > 0)</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>                 hawki_cal_zpoint_outputs.fwhm_as[idet] =</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>                         sqrt(fwhm_x*fwhm_y*pixscale*pixscale);</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>                 hawki_cal_zpoint_outputs.fwhm_as[labels[iframe]-1] = -1.0;</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="keywordflow">else</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_msg_warning(cpl_func,<span class="stringliteral">"Standard star not detected in chip %d. "</span></div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>                     <span class="stringliteral">"No zeropoint computed."</span>, idet + 1);</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> </div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     <span class="comment">/* Create the table */</span></div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     zpoint = <a class="code" href="group__hawki__alloc.html#gad7e4f1acdafde6f40fac069f727c9080" title="Allocates a set of four tables.">hawki_table_new</a>(1);</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>     <span class="comment">//tab = cpl_table_new(nframes) ;</span></div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>                              HAWKI_COL_ZPOINT_CHIP, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>                              HAWKI_COL_ZPOINT_STARNAME, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>                              HAWKI_COL_ZPOINT_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>         cpl_table_set_column_unit(zpoint[idet],</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>                                   HAWKI_COL_ZPOINT_POSX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>                              HAWKI_COL_ZPOINT_POSY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_POSY,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>                              HAWKI_COL_ZPOINT_ZPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_ZPOINT,<span class="stringliteral">"mag"</span>);</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>                              HAWKI_COL_ZPOINT_ATX0, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_ATX0,<span class="stringliteral">"mag"</span>);</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                              HAWKI_COL_ZPOINT_AIRMASS, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>                              HAWKI_COL_ZPOINT_FLUX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FLUX,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>                              HAWKI_COL_ZPOINT_INSTRMAG, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>         cpl_table_set_column_unit(zpoint[idet],</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                                   HAWKI_COL_ZPOINT_INSTRMAG,<span class="stringliteral">"log(ADU/s)"</span>);</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>                              HAWKI_COL_ZPOINT_FILTER, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>                              HAWKI_COL_ZPOINT_PEAK, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_PEAK,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>                              HAWKI_COL_ZPOINT_BGD, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_BGD,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                              HAWKI_COL_ZPOINT_FWHMX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                              HAWKI_COL_ZPOINT_FWHMY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMY,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>                              HAWKI_COL_ZPOINT_FWHM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHM,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>                              HAWKI_COL_ZPOINT_FWHMX_AS, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMX_AS,<span class="stringliteral">"arcsec"</span>);</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>                              HAWKI_COL_ZPOINT_FWHMY_AS, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHMY_AS,<span class="stringliteral">"arcsec"</span>);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>                              HAWKI_COL_ZPOINT_FWHM_AS, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_FWHM_AS,<span class="stringliteral">"arcsec"</span>);</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>         cpl_table_new_column(zpoint[idet], </div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>                              HAWKI_COL_ZPOINT_STARMAG, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>         cpl_table_set_column_unit(zpoint[idet],HAWKI_COL_ZPOINT_STARMAG,<span class="stringliteral">"mag"</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_table_set_int(zpoint[idet], HAWKI_COL_ZPOINT_CHIP, 0, idet+1) ;</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         cpl_table_set_string(zpoint[idet], HAWKI_COL_ZPOINT_FILTER, 0,</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                 hawki_cal_zpoint_outputs.filter);</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>         cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_AIRMASS, 0,</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>                 hawki_cal_zpoint_outputs.airmass[idet]) ;</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_incat_found== 1)</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_table_set_string(zpoint[idet], HAWKI_COL_ZPOINT_STARNAME, 0,</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>                     hawki_cal_zpoint_outputs.starname) ;</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available== 1)</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_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_STARMAG, 0,</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>                         hawki_cal_zpoint_outputs.stdstar_mag_filter);</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="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)</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_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_POSX, 0,</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>                     hawki_cal_zpoint_outputs.posx[idet]) ;</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_POSY, 0,</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>                                  hawki_cal_zpoint_outputs.posy[idet]) ;</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FLUX, 0,</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>                                  hawki_cal_zpoint_outputs.flux[idet]) ;</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_INSTRMAG, 0,</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>                                  hawki_cal_zpoint_outputs.instrmag[idet]) ;</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_PEAK, 0,</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>                                  hawki_cal_zpoint_outputs.peak[idet]) ;</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_BGD, 0,</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>                                  hawki_cal_zpoint_outputs.bgd[idet]) ;</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMX, 0,</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>                                  hawki_cal_zpoint_outputs.fwhmx[idet]) ;</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMY, 0,</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>                                  hawki_cal_zpoint_outputs.fwhmy[idet]) ;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHM, 0,</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>                                  hawki_cal_zpoint_outputs.fwhm[idet]) ;</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMX_AS, 0,</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>                                  hawki_cal_zpoint_outputs.fwhmx_as[idet]) ;</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHMY_AS, 0,</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>                                  hawki_cal_zpoint_outputs.fwhmy_as[idet]) ;</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>             cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_FWHM_AS, 0,</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>                                  hawki_cal_zpoint_outputs.fwhm_as[idet]) ;</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)</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>                 cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_ZPOINT, 0,</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                         hawki_cal_zpoint_outputs.zpoint[idet]);</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>                 cpl_table_set_double(zpoint[idet], HAWKI_COL_ZPOINT_ATX0, 0,</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                         hawki_cal_zpoint_outputs.atx0[idet]);</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>         }</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> </div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>     <span class="comment">/* Mean values */</span></div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)</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="keywordtype">int</span> nzpoint = 0;</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>         hawki_cal_zpoint_outputs.mean_zpoint = 0.0 ;</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         hawki_cal_zpoint_outputs.mean_atx0 = 0.0 ;</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>             <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 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>                 hawki_cal_zpoint_outputs.mean_zpoint +=</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>                         hawki_cal_zpoint_outputs.zpoint[idet] ;</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>                 hawki_cal_zpoint_outputs.mean_atx0  +=</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>                         hawki_cal_zpoint_outputs.atx0[idet] ;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>                 nzpoint++;</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>(nzpoint > 0)</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>             hawki_cal_zpoint_outputs.zpoint_mean_computable = 1;</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>             hawki_cal_zpoint_outputs.mean_zpoint /= nzpoint ;</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>             hawki_cal_zpoint_outputs.mean_atx0 /= nzpoint ;</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>     }</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="comment">/* Output results */</span></div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)</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_msg_info(__func__, <span class="stringliteral">"Zero point [at airmass=1] in chip %d:"</span>,</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>                     idet + 1);</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>             cpl_msg_info(__func__,<span class="stringliteral">"   ZP: %g [%g]"</span>,</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>                          hawki_cal_zpoint_outputs.zpoint[idet],</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>                          hawki_cal_zpoint_outputs.atx0[idet]);</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>             cpl_msg_info(__func__,<span class="stringliteral">"   Flux of star: %f"</span>,</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>                          hawki_cal_zpoint_outputs.flux[idet]);</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>             cpl_msg_indent_less();</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="keywordflow">else</span></div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>             cpl_msg_info(__func__, <span class="stringliteral">"Zero point not available for chip %d"</span>,</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>                     idet + 1);</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> </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     <span class="keywordflow">return</span> zpoint;</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="l01245"></a><span class="lineno"> 1245</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_get_mag(</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *       std_file,</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>         <span class="keywordtype">double</span>              pointing_ra,</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>         <span class="keywordtype">double</span>              pointing_dec,</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         hawki_band          band)</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>     cpl_table      * catalogue;</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     <span class="keywordtype">char</span>           * star_name;</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     <span class="keywordtype">char</span>           * used_catname;</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>     <span class="keywordtype">char</span>           * star_type;</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>     <span class="keywordtype">double</span>           stdstar_ra;</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     <span class="keywordtype">double</span>           stdstar_dec;</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>     <span class="keywordtype">double</span>           mag_filter;</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>     <span class="keywordtype">double</span>           mag_J;</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>     <span class="keywordtype">double</span>           mag_H;</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     <span class="keywordtype">double</span>           mag_K;</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     <span class="keywordtype">double</span>           mag_Y;</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>     <span class="keywordtype">int</span>              mag_invalid;</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     <span class="keywordtype">int</span>              star_ind;</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span> </div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>     hawki_cal_zpoint_outputs.stdstar_incat_found = 0;    </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">/* Load the catalog */</span></div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>     <span class="keywordflow">if</span> ((catalogue = irplib_stdstar_load_catalog(std_file, <span class="stringliteral">"all"</span>)) == NULL) {</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot read catalogue file %s"</span>,std_file);</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>     <span class="comment">/* Check that the columns are there */</span></div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>     <span class="keywordflow">if</span> (irplib_stdstar_check_columns_exist(catalogue) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>         cpl_msg_error(cpl_func,<span class="stringliteral">"Note all the columns are present"</span></div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>                       <span class="stringliteral">" in the  catalogue file %s"</span>,std_file);</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Select stars within a given distance */</span></div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>     <span class="keywordflow">if</span> (irplib_stdstar_select_stars_dist(catalogue, </div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>             pointing_ra, pointing_dec, 5.0) == -1) {</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>         cpl_table_delete(catalogue) ;</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         <span class="keywordflow">return</span> 1;</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="comment">/* Take the closest */</span></div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>     <span class="keywordflow">if</span> ((star_ind=irplib_stdstar_find_closest(catalogue, </div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>             pointing_ra, pointing_dec)) < 0) {</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>         cpl_table_delete(catalogue) ;</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>         <span class="keywordflow">return</span> 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>     <span class="comment">/* Retrieve the star information */</span></div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>     hawki_cal_zpoint_outputs.stdstar_incat_found = 1;    </div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>     star_name = cpl_strdup(cpl_table_get_string(catalogue,</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>                                             IRPLIB_STDSTAR_STAR_COL, star_ind));</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>     used_catname = cpl_strdup(cpl_table_get_string</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>                               (catalogue, IRPLIB_STDSTAR_CAT_COL, star_ind));</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>     star_type = cpl_strdup(cpl_table_get_string(catalogue, </div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>             IRPLIB_STDSTAR_TYPE_COL, star_ind));</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>     stdstar_ra  = cpl_table_get_double(catalogue, </div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>             IRPLIB_STDSTAR_RA_COL, star_ind, NULL);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>     stdstar_dec = cpl_table_get_double(catalogue, </div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>             IRPLIB_STDSTAR_DEC_COL, star_ind, NULL);</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>     mag_filter = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(band), </div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>             star_ind, &mag_invalid);</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>     mag_H = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_H),</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>             star_ind, NULL);</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>     mag_J = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_J), </div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>             star_ind, NULL);</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>     mag_K = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_K), </div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>             star_ind, NULL);</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>     mag_Y = cpl_table_get_double(catalogue, <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_Y), </div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>             star_ind, NULL);</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>     <span class="comment">/* Store results */</span></div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>     strncpy(hawki_cal_zpoint_outputs.starname, star_name, 510);</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     strncpy(hawki_cal_zpoint_outputs.sptype, star_type, 510);</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>     strncpy(hawki_cal_zpoint_outputs.catalog, used_catname, 510);</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>     hawki_cal_zpoint_outputs.stdstar_ra = stdstar_ra;</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     hawki_cal_zpoint_outputs.stdstar_dec = stdstar_dec;</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>     <span class="keywordflow">if</span>(mag_invalid == 0)</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>         hawki_cal_zpoint_outputs.stdstar_mag_available = 1;</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>         hawki_cal_zpoint_outputs.stdstar_mag_filter = mag_filter;</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">else</span></div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>         hawki_cal_zpoint_outputs.stdstar_mag_available = 0;</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>     hawki_cal_zpoint_outputs.stdstar_mag_H = mag_H;</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>     hawki_cal_zpoint_outputs.stdstar_mag_J = mag_J;</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>     hawki_cal_zpoint_outputs.stdstar_mag_K = mag_K;</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>     hawki_cal_zpoint_outputs.stdstar_mag_Y = mag_Y;</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>     cpl_free(star_name);</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>     cpl_free(star_type);</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>     cpl_free(used_catname);</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     cpl_table_delete(catalogue);</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">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_save</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> (cpl_table           **  zpoint_tables,</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>  <span class="keywordtype">int</span>                 *   labels,</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>  cpl_imagelist       *   images,</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>  cpl_table           **  raw_zpoint_stats,</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>  cpl_frameset        *   zpoint_frames,</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>  cpl_frameset        *   calib_frames,</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>  <span class="keyword">const</span> cpl_frame     *   stars_frame,</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>  cpl_frameset        *   <span class="keyword">set</span>)</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>     cpl_propertylist    *   qcmainparams;</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>     cpl_propertylist    **  qcextparams;</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>     cpl_propertylist    *   mainheader;</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     cpl_propertylist    **  extheaders;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     cpl_propertylist    **  statsqcextparams;</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>     cpl_propertylist    **  statsextheaders;</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>     cpl_frameset        *   used_frames;</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   ref_filename;</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_cal_zpoint"</span> ;</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>     <span class="keywordtype">int</span>                     iframe;</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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="comment">/* Get the reference frame */</span></div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>     ref_filename = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">set</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">/* Create QC parameters for the zpoint table */</span></div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>     qcmainparams = cpl_propertylist_new();</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>     qcextparams = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>         qcextparams[idet] = cpl_propertylist_new();</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>     <span class="comment">/* Write QC parameters */</span></div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>     hawki_cal_zpoint_compute_qc(qcmainparams, qcextparams, <span class="keyword">set</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>     <span class="comment">/* Create QC parameters for the stats table: Statistics of the raw images */</span></div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>     statsqcextparams = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>         statsqcextparams[idet] = cpl_propertylist_new();</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_zpoint_stats, statsqcextparams);    </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">/* Create the main and extension headers for the zpoint table*/</span></div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>     mainheader = cpl_propertylist_new();</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>     extheaders = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>         extheaders[idet] = cpl_propertylist_new();</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>     <span class="comment">/* Copy QC params to the headers */</span></div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>     cpl_propertylist_append(mainheader, qcmainparams);</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>         cpl_propertylist_append(extheaders[idet], qcextparams[idet]) ;</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="comment">/* Create the  extension headers for the stats table*/</span></div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>     statsextheaders = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>         statsextheaders[idet] = cpl_propertylist_duplicate(statsqcextparams[idet]);</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="comment">/* Write additional keywords to the headers */</span></div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         cpl_propertylist    *   inputlist;</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         cpl_propertylist    *   wcslist;</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>         <span class="keywordtype">int</span>                     this_iframe = -1;</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>         <span class="keywordtype">int</span>                     ext_nb;</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">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(ref_filename, idet+1);</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>         inputlist = cpl_propertylist_load_regexp(ref_filename, ext_nb,</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>         cpl_propertylist_append(extheaders[idet], inputlist);</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>         cpl_propertylist_append(statsextheaders[idet], inputlist);</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>         cpl_propertylist_delete(inputlist);</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">/* Propagate WCS keywords */</span></div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>         <span class="keywordflow">for</span>(iframe=0; iframe<cpl_frameset_get_size(zpoint_frames); iframe++)</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>             <span class="keywordflow">if</span>(labels[iframe] == idet + 1)</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>                 this_iframe = iframe;</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>         wcslist = cpl_propertylist_load_regexp</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>             (cpl_frame_get_filename(cpl_frameset_get_frame(zpoint_frames, this_iframe)),</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>                                     ext_nb, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>         cpl_propertylist_copy_property_regexp</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>             (extheaders[idet], wcslist, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>         cpl_propertylist_delete(wcslist);</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>     </div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>     <span class="comment">/* Write the zpoint table  */</span></div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>     used_frames = cpl_frameset_duplicate(zpoint_frames);</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>     <span class="keywordflow">for</span>(iframe = 0; iframe< cpl_frameset_get_size(calib_frames); ++iframe)</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>         cpl_frameset_insert(used_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                 cpl_frameset_get_frame(calib_frames, iframe)));</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>     cpl_frameset_insert(used_frames, cpl_frame_duplicate(stars_frame));</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                       parlist,</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>                       used_frames,</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>                       (<span class="keyword">const</span> cpl_table **)zpoint_tables,</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                       recipe_name,</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                       HAWKI_CALPRO_ZPOINT_TAB,</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                       HAWKI_PROTYPE_ZPOINT_TAB,</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>                       mainheader,</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>                       (<span class="keyword">const</span> cpl_propertylist **)extheaders,</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>                       <span class="stringliteral">"hawki_cal_zpoint.fits"</span>);</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>     cpl_frameset_delete(used_frames);</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="comment">/* Write the table with the raw zpoint objects statistics */</span></div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>     used_frames = cpl_frameset_duplicate(zpoint_frames);</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>                       parlist,</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                       used_frames,</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>                       (<span class="keyword">const</span> cpl_table **)raw_zpoint_stats,</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                       recipe_name,</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>                       HAWKI_CALPRO_ZPOINT_STATS,</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>                       HAWKI_PROTYPE_ZPOINT_STATS,</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>                       NULL,</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                       (<span class="keyword">const</span> cpl_propertylist **)statsextheaders,</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>                       <span class="stringliteral">"hawki_cal_zpoint_stats.fits"</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>     <span class="comment">/* Write the images  */</span></div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>     <span class="keywordflow">for</span>(iframe = 0; iframe< cpl_frameset_get_size(calib_frames); ++iframe)</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>         cpl_frameset_insert(used_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>                 cpl_frameset_get_frame(calib_frames, iframe)));</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>                          parlist,</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>                          used_frames,</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>                          images,</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>                          recipe_name,</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>                          HAWKI_CALPRO_ZPOINT_IMA,</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>                          HAWKI_PROTYPE_ZPOINT_IMA,</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                          NULL,</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                          NULL,</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>                          <span class="stringliteral">"hawki_cal_zpoint_check.fits"</span>) ;</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>     cpl_frameset_delete(used_frames);</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">/* Free */</span></div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>         cpl_propertylist_delete(extheaders[idet]) ;</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>         cpl_propertylist_delete(qcextparams[idet]) ;</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>         cpl_propertylist_delete(statsqcextparams[idet]);</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>         cpl_propertylist_delete(statsextheaders[idet]);</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(mainheader);</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>     cpl_propertylist_delete(qcmainparams);</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>     cpl_free(extheaders);</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>     cpl_free(qcextparams);</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>     cpl_free(statsqcextparams);</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>     cpl_free(statsextheaders);</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="comment">/* Free */</span></div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>         <span class="keywordflow">return</span> -1;</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="keywordflow">return</span>  0;</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="l01515"></a><span class="lineno"> 1515</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_qc</div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span> (cpl_propertylist *   qcmainparams, </div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>  cpl_propertylist **  qcextparams,</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>  cpl_frameset     *   <span class="keyword">set</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="keywordtype">int</span>  idet;</div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>     <span class="keywordtype">int</span>  nframes;</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>     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;</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>     <span class="comment">/* Check inputs */</span></div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>     <span class="keywordflow">if</span> (qcmainparams == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>         <span class="keywordflow">if</span> (qcextparams[idet] == NULL) <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Write the QC params common to all extensions in the main header */</span></div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>     cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC FILTER OBS"</span>,</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>             hawki_cal_zpoint_outputs.filter);</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC FILTER OBS"</span>,</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>                                  <span class="stringliteral">"Observation filter"</span>);</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>     cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC FILTER REF"</span>,</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>             <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(hawki_cal_zpoint_outputs.band)) ;</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC FILTER REF"</span>,</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                                  <span class="stringliteral">"Reference filter"</span>);</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC AMBI RHUM AVG"</span>,</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>             hawki_cal_zpoint_outputs.humidity);</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC AMBI RHUM AVG"</span>,</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                      <span class="stringliteral">"(percent) ambient relative humidity @ 30/2 m"</span>);</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>             hawki_cal_zpoint_outputs.mean_airmass) ;</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>                                  <span class="stringliteral">"Average airmass"</span>);</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>     cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>                                    nframes);</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>                                  <span class="stringliteral">"Number of files used for the reduction"</span>);</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_incat_found == 1)</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>         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC STDNAME"</span>,</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>                 hawki_cal_zpoint_outputs.starname) ;</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STDNAME"</span>,</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>                                      <span class="stringliteral">"Standard star name"</span>);</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC SPECTYPE"</span>,</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>                                        hawki_cal_zpoint_outputs.sptype) ;</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC SPECTYPE"</span>,</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>                                      <span class="stringliteral">"Standard star spectral type"</span>);</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG H"</span>,</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>                                        hawki_cal_zpoint_outputs.stdstar_mag_H) ;</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG H"</span>,</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>                                      <span class="stringliteral">"Standard star magnitude in H"</span>);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG J"</span>,</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>                                        hawki_cal_zpoint_outputs.stdstar_mag_J) ;</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG J"</span>,</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>                                      <span class="stringliteral">"Standard star magnitude in J"</span>);</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG K"</span>,</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>                                        hawki_cal_zpoint_outputs.stdstar_mag_K) ;</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG K"</span>,</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>                                      <span class="stringliteral">"Standard star magnitude in K"</span>);</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG Y"</span>,</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>                                        hawki_cal_zpoint_outputs.stdstar_mag_Y) ;</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG Y"</span>,</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>                                      <span class="stringliteral">"Standard star magnitude in Y"</span>);</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>         cpl_propertylist_append_string(qcmainparams, <span class="stringliteral">"ESO QC CATNAME"</span>,</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                                        hawki_cal_zpoint_outputs.catalog) ;</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC CATNAME"</span>,</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>                                      <span class="stringliteral">"Standard star catalogue name"</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="keywordflow">if</span>(hawki_cal_zpoint_outputs.stdstar_mag_available == 1)</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>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC STARMAG"</span>,</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>                 hawki_cal_zpoint_outputs.stdstar_mag_filter) ;</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC STARMAG"</span>,</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>                                  <span class="stringliteral">"Standard star magnitude in observed filter"</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>     <span class="keywordflow">if</span>(hawki_cal_zpoint_outputs.zpoint_mean_computable == 1)</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>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT MEAN"</span>,</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>                 hawki_cal_zpoint_outputs.mean_zpoint) ;</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT MEAN"</span>,</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>                             <span class="stringliteral">"Mean measured zero-point for all the chips [mag]"</span>);</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ATX0 MEAN"</span>,</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>                                        hawki_cal_zpoint_outputs.mean_atx0);</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ATX0 MEAN"</span>,</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                <span class="stringliteral">"Mean extinction corrected zero-point for all the chips [mag]"</span>);</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>         cpl_propertylist_append_double(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT EXT COEFF"</span>,</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>                                        hawki_cal_zpoint_outputs.ext_coeff);</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>         cpl_propertylist_set_comment(qcmainparams, <span class="stringliteral">"ESO QC ZPOINT EXT COEFF"</span>,</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>                <span class="stringliteral">"Extinction coefficient used in the computation of ATX0"</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="comment">/* Write QC params that are specific of the extension */</span></div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>(hawki_cal_zpoint_outputs.zpoint_computable[idet] == 1)</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>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>,</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>                     hawki_cal_zpoint_outputs.zpoint[idet]) ;</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>,</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>                                  <span class="stringliteral">"Measured zero-point for a given chip [mag]"</span>);</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ATX0"</span>,</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>                                            hawki_cal_zpoint_outputs.atx0[idet]);</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ATX0"</span>,</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>                      <span class="stringliteral">"Extinction corrected zero-point for a given chip [mag]"</span>);</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">if</span>(hawki_cal_zpoint_outputs.stdstar_image_detected[idet] == 1)</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_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSX"</span>,</div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>                                            hawki_cal_zpoint_outputs.posx[idet]);</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSX"</span>,</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>                                     <span class="stringliteral">"X position of the standard star [pixel]"</span>);</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSY"</span>,</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>                                            hawki_cal_zpoint_outputs.posy[idet]);</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT POSY"</span>,</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>                                     <span class="stringliteral">"Y position of the standard star [pixel]"</span>);</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FLUX"</span>,</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>                                         hawki_cal_zpoint_outputs.flux[idet]);</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FLUX"</span>,</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>                     <span class="stringliteral">"Flux of the standard star [ADU]"</span>);</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT PEAK"</span>,</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>                                            hawki_cal_zpoint_outputs.peak[idet]) ;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT PEAK"</span>,</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>                                          <span class="stringliteral">"Peak of the standard star [ADU]"</span>);</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT BGD"</span>,</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>                                            hawki_cal_zpoint_outputs.bgd[idet]) ;</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT BGD"</span>,</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>                                    <span class="stringliteral">"Background around the standard star [ADU]"</span>);</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX"</span>,</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>                                         hawki_cal_zpoint_outputs.fwhmx[idet]);</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX"</span>,</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>                                          <span class="stringliteral">"X FWHM of the standard star [pixel]"</span>);</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY"</span>,</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                                          hawki_cal_zpoint_outputs.fwhmy[idet]);</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY"</span>,</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                                          <span class="stringliteral">"Y FWHM of the standard star [pixel]"</span>);</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM"</span>,</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>                                            hawki_cal_zpoint_outputs.fwhm[idet]);</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM"</span>,</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                                          <span class="stringliteral">"FWHM of the standard star [pixel]"</span>);</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX_AS"</span>,</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>                                       hawki_cal_zpoint_outputs.fwhmx_as[idet]);</div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMX_AS"</span>,</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>                                        <span class="stringliteral">"X FWHM of the standard star [arcsec]"</span>);</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY_AS"</span>,</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>                                     hawki_cal_zpoint_outputs.fwhmy_as[idet]);</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHMY_AS"</span>,</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>                                       <span class="stringliteral">"Y FWHM of the standard star [arcsec]"</span>);</div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>             cpl_propertylist_append_double(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM_AS"</span>,</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>                                        hawki_cal_zpoint_outputs.fwhm_as[idet]);</div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>             cpl_propertylist_set_comment(qcextparams[idet], <span class="stringliteral">"ESO QC ZPOINT FWHM_AS"</span>,</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>                                          <span class="stringliteral">"FWHM of the standard star [arcsec]"</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>     }</div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_cal_zpoint_compute_keywords(</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>         cpl_frameset    *   <span class="keyword">set</span>,</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>         <span class="keywordtype">int</span>             *   labels)</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">int</span>                     nframes ;</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>     cpl_vector          *   hum_vec ;</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>     cpl_frame           *   cur_frame ;</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>     <span class="keywordtype">int</span>                     iframe;</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>     <span class="comment">/* Test inputs  */</span></div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Initialize */</span></div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>     hawki_cal_zpoint_outputs.mean_airmass   = 0.0 ;</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span> </div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>     hum_vec = cpl_vector_new(nframes) ;</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">for</span> (iframe=0 ; iframe<nframes ; iframe++) {</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>         <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>             cpl_vector_delete(hum_vec) ;</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>             <span class="keywordflow">return</span> -1 ;</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>         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, iframe) ;</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>         plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0) ;</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>         <span class="keywordflow">if</span> (iframe==0) </div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>             hawki_cal_zpoint_outputs.mean_airmass += </div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>                 <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) ; </div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>         <span class="keywordflow">if</span> (iframe==nframes-1) </div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>             hawki_cal_zpoint_outputs.mean_airmass += </div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>         hawki_cal_zpoint_outputs.airmass[labels[iframe] - 1] = </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>             (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) + </div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>              <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist)) / 2.;</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>         cpl_vector_set(hum_vec,  iframe, <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(plist));</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>         cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>         <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>             cpl_vector_delete(hum_vec) ;</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>             cpl_error_reset() ;</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>             <span class="keywordflow">return</span> -1 ;</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>     hawki_cal_zpoint_outputs.humidity  = cpl_vector_get_mean(hum_vec) ;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>     hawki_cal_zpoint_outputs.mean_airmass /= 2 ;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>     cpl_vector_delete(hum_vec) ;</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>     <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span> <span class="keyword">static</span> cpl_error_code hawki_cal_zpoint_get_expected_pos</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span> (cpl_frameset * <span class="keyword">set</span>,</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>  <span class="keywordtype">int</span>          * labels)</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="keyword">const</span> <span class="keywordtype">char</span> *  filename;</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>     <span class="keywordtype">int</span>           iframe;</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">for</span>(iframe=0 ; iframe<HAWKI_NB_DETECTORS ; iframe++)</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_propertylist * wcs_plist;</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>         cpl_wcs          * wcs;</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>         <span class="keywordtype">int</span>                idet;</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>         idet = labels[iframe];</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>         <span class="keywordflow">if</span>(hawki_cal_zpoint_config.xcoord[idet - 1] == -1 ||</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>                 hawki_cal_zpoint_config.ycoord[idet - 1] == -1)</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>             filename = cpl_frame_get_filename</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>                 (cpl_frameset_get_frame_const(<span class="keyword">set</span>, iframe));</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>             wcs_plist = cpl_propertylist_load</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>                 (filename, <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename, idet));</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>             wcs = cpl_wcs_new_from_propertylist(wcs_plist);</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>             cpl_propertylist_delete(wcs_plist);</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>             <span class="keywordflow">if</span>(wcs == 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>                 cpl_msg_error(__func__, <span class="stringliteral">"Could not get WCS info"</span>);</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                 cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                 <span class="keywordflow">return</span> CPL_ERROR_ILLEGAL_INPUT;</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>(irplib_wcs_radectoxy(wcs,</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>                                     hawki_cal_zpoint_outputs.stdstar_ra,</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>                                     hawki_cal_zpoint_outputs.stdstar_dec,</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>                                     &(hawki_cal_zpoint_config.xcoord[idet - 1]),</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>                                     &(hawki_cal_zpoint_config.ycoord[idet - 1]))</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>                     != CPL_ERROR_NONE)</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_error(__func__,<span class="stringliteral">"Could not get the expected position of star"</span>);</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>                 cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>                 <span class="keywordflow">return</span> CPL_ERROR_UNSPECIFIED;</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_msg_info(cpl_func,</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>                          <span class="stringliteral">"Star expected position in detector %d is X=%f Y=%f"</span>,</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                          idet, hawki_cal_zpoint_config.xcoord[idet - 1],</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                          hawki_cal_zpoint_config.ycoord[idet - 1]);</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>             <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>             cpl_wcs_delete(wcs);</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">else</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_msg_info(cpl_func,</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>                         <span class="stringliteral">"Using given star position in detector %d: X=%f Y=%f"</span>,</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>                          idet,</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>                          hawki_cal_zpoint_config.xcoord[idet - 1],</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>                          hawki_cal_zpoint_config.ycoord[idet - 1]);</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>     }</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>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span> <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_cal_zpoint_output_init(<span class="keywordtype">void</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="keywordtype">int</span> idet;</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>     hawki_cal_zpoint_outputs.starname[0] = (char)0 ;</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>     hawki_cal_zpoint_outputs.sptype[0] = (char)0 ;</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>     hawki_cal_zpoint_outputs.filter[0] = (char)0 ;</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>     hawki_cal_zpoint_outputs.catalog[0] = (char)0 ;</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>     hawki_cal_zpoint_outputs.pixscale = -1.0 ;</div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>     hawki_cal_zpoint_outputs.dit = -1.0 ;</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>     hawki_cal_zpoint_outputs.humidity = -1.0 ;</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>     hawki_cal_zpoint_outputs.mean_airmass = -1.0 ;</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         hawki_cal_zpoint_outputs.airmass[idet] = -1.0 ;</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>         hawki_cal_zpoint_outputs.zpoint[idet] = -1.0 ;</div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>         hawki_cal_zpoint_outputs.atx0[idet] = -1.0 ;</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         hawki_cal_zpoint_outputs.posx[idet] = -1.0 ;</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>         hawki_cal_zpoint_outputs.posy[idet] = -1.0 ;</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>         hawki_cal_zpoint_outputs.flux[idet] = -1.0 ;</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>         hawki_cal_zpoint_outputs.peak[idet] = -1.0 ;</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>         hawki_cal_zpoint_outputs.bgd[idet] = -1.0 ;</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>         hawki_cal_zpoint_outputs.fwhmx[idet] = -1.0 ;</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>         hawki_cal_zpoint_outputs.fwhmy[idet] = -1.0 ;</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>         hawki_cal_zpoint_outputs.fwhm[idet] = -1.0 ;</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>         hawki_cal_zpoint_outputs.fwhmx_as[idet] = -1.0 ;</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>         hawki_cal_zpoint_outputs.fwhmy_as[idet] = -1.0 ;</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>         hawki_cal_zpoint_outputs .fwhm_as[idet] = -1.0 ;</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> </div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span> <span class="keywordtype">int</span> hawki_cal_zpoint_retrieve_input_param</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span> (cpl_parameterlist  *  parlist)</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_parameter   *   par ;</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;</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>     par = NULL ;</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="comment">/* --ra */</span></div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.ra"</span>) ;</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>     hawki_cal_zpoint_config.target_ra = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>     <span class="comment">/* --dec */</span></div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.dec"</span>) ;</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>     hawki_cal_zpoint_config.target_dec = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>     <span class="comment">/* --mag */</span></div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.mag"</span>) ;</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>     hawki_cal_zpoint_config.stdstar_given_magnitude = </div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>             cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>     <span class="comment">/* --detect_sigma */</span></div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>     par = cpl_parameterlist_find(parlist,<span class="stringliteral">"hawki.hawki_cal_zpoint.detect_sigma"</span>);</div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>     hawki_cal_zpoint_config.detect_sigma = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>     <span class="comment">/* --sx */</span></div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.sx"</span>) ;</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>     hawki_cal_zpoint_config.sx = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>     <span class="comment">/* --sy */</span></div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.sy"</span>) ;</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>     hawki_cal_zpoint_config.sy = cpl_parameter_get_int(par) ;</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>     <span class="comment">/* --star_r */</span></div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.star_r"</span>) ;</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>     hawki_cal_zpoint_config.phot_star_radius = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     <span class="comment">/* --bg_r1 */</span></div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r1"</span>) ;</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     hawki_cal_zpoint_config.phot_bg_r1 = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     <span class="comment">/* --bg_r2 */</span></div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.bg_r2"</span>) ;</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>     hawki_cal_zpoint_config.phot_bg_r2 = cpl_parameter_get_double(par) ;</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     <span class="comment">/* --xcoord */</span></div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.xcoord"</span>);</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>                hawki_cal_zpoint_config.xcoord,</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>                hawki_cal_zpoint_config.xcoord+1,</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>                hawki_cal_zpoint_config.xcoord+2,</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>                hawki_cal_zpoint_config.xcoord+3)!=4)</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">return</span> -1;</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="comment">/* --ycoord */</span></div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_cal_zpoint.ycoord"</span>);</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%lf,%lf,%lf,%lf"</span>,</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>                hawki_cal_zpoint_config.ycoord,</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>                hawki_cal_zpoint_config.ycoord+1,</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>                hawki_cal_zpoint_config.ycoord+2,</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>                hawki_cal_zpoint_config.ycoord+3)!=4)</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">return</span> -1;</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> </div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span> <span class="keywordtype">int</span> hawki_cal_zpoint_check_epoch_equinox(cpl_propertylist * plist)</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>     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(plist) != 2000. ||</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>        <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(plist) != 2000.)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Epoch and equinox must be 2000."</span>);</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>         <span class="keywordflow">return</span> -1;</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>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</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/hawki__calib_8c_source.html b/html/hawki__calib_8c_source.html
index 0f7b8bc..b6f54de 100644
--- a/html/hawki__calib_8c_source.html
+++ b/html/hawki__calib_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_calib.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,418 +40,419 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_calib.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_calib.c,v 1.6 2010/11/03 18:50: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/11/03 18:50:38 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00054"></a>00054 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00071"></a>00071 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00072"></a>00072 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a>
-<a name="l00073"></a><a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489">00073</a> (cpl_imagelist  *  ilist,
-<a name="l00074"></a>00074  cpl_imagelist  *  flat,
-<a name="l00075"></a>00075  cpl_imagelist  *  dark,
-<a name="l00076"></a>00076  cpl_imagelist  *  bpm)
-<a name="l00077"></a>00077 {
-<a name="l00078"></a>00078     <span class="keywordtype">int</span>   idet;
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="comment">/* Test entries */</span>
-<a name="l00081"></a>00081     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     <span class="comment">/* Dark correction */</span>
-<a name="l00084"></a>00084     <span class="keywordflow">if</span> (dark != NULL)
-<a name="l00085"></a>00085     {
-<a name="l00086"></a>00086         cpl_msg_info(cpl_func, <span class="stringliteral">"Subtracting the dark to each chip image"</span>) ;
-<a name="l00087"></a>00087         <span class="comment">/* Apply the dark correction to the images */</span>
-<a name="l00088"></a>00088         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00089"></a>00089         {
-<a name="l00090"></a>00090             <span class="keywordflow">if</span> (cpl_image_subtract(cpl_imagelist_get(ilist, idet),
-<a name="l00091"></a>00091                                    cpl_imagelist_get(dark, idet))!=CPL_ERROR_NONE) 
-<a name="l00092"></a>00092             {
-<a name="l00093"></a>00093                 cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the dark to chip %d"</span>,
-<a name="l00094"></a>00094                               idet+1);
-<a name="l00095"></a>00095                 <span class="keywordflow">return</span> -1 ;
-<a name="l00096"></a>00096             }
-<a name="l00097"></a>00097         }
-<a name="l00098"></a>00098     }
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     <span class="comment">/* Flat-field correction */</span>
-<a name="l00101"></a>00101     <span class="keywordflow">if</span> (flat != NULL) 
-<a name="l00102"></a>00102     {
-<a name="l00103"></a>00103         cpl_msg_info(cpl_func, <span class="stringliteral">"Dividing the flat to each chip image"</span>) ;
-<a name="l00104"></a>00104         <span class="comment">/* Apply the flat correction to the images */</span>
-<a name="l00105"></a>00105         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00106"></a>00106         {
-<a name="l00107"></a>00107             <span class="keywordflow">if</span> (cpl_image_divide(cpl_imagelist_get(ilist, idet),
-<a name="l00108"></a>00108                                  cpl_imagelist_get(flat, idet))!=CPL_ERROR_NONE) 
-<a name="l00109"></a>00109             {
-<a name="l00110"></a>00110                 cpl_msg_error(__func__,<span class="stringliteral">"Cannot apply the flatfield to chip %d"</span>,
-<a name="l00111"></a>00111                               idet+1);
-<a name="l00112"></a>00112                 <span class="keywordflow">return</span> -1 ;
-<a name="l00113"></a>00113             }
-<a name="l00114"></a>00114         }
-<a name="l00115"></a>00115     }
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     <span class="comment">/* Correct the bad pixels if requested */</span>
-<a name="l00118"></a>00118     <span class="keywordflow">if</span> (bpm != NULL) 
-<a name="l00119"></a>00119     {
-<a name="l00120"></a>00120         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels to each chip image"</span>);
-<a name="l00121"></a>00121         <span class="comment">/* Apply the flat correction to the images */</span>
-<a name="l00122"></a>00122         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00123"></a>00123         {
-<a name="l00124"></a>00124             cpl_mask    * bpm_im_bin ;
-<a name="l00125"></a>00125             <span class="comment">/* Convert the map from integer to binary */</span>
-<a name="l00126"></a>00126             bpm_im_bin = cpl_mask_threshold_image_create
-<a name="l00127"></a>00127                 (cpl_imagelist_get(bpm, idet), -0.5, 0.5) ;
-<a name="l00128"></a>00128             cpl_mask_not(bpm_im_bin) ;
-<a name="l00129"></a>00129             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, idet), bpm_im_bin);
-<a name="l00130"></a>00130             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected
-<a name="l00131"></a>00131                     (cpl_imagelist_get(ilist, idet)) != CPL_ERROR_NONE) 
-<a name="l00132"></a>00132             {
-<a name="l00133"></a>00133                     cpl_msg_error
-<a name="l00134"></a>00134                         (cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in chip %d"</span>,
-<a name="l00135"></a>00135                          idet+1);
-<a name="l00136"></a>00136                     cpl_mask_delete(bpm_im_bin) ;
-<a name="l00137"></a>00137                     <span class="keywordflow">return</span> -1 ;
-<a name="l00138"></a>00138             }
-<a name="l00139"></a>00139             cpl_mask_delete(bpm_im_bin) ;
-<a name="l00140"></a>00140         }
-<a name="l00141"></a>00141     }
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143     <span class="comment">/* Return */</span>
-<a name="l00144"></a>00144     <span class="keywordflow">return</span> 0 ;
-<a name="l00145"></a>00145 }
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00160"></a>00160 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00161"></a><a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c">00161</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c" title="Apply the calibration to the images.">hawki_flat_bpm_imglist_calib</a>(
-<a name="l00162"></a>00162         cpl_imagelist       *   ilist,
-<a name="l00163"></a>00163         cpl_imagelist       *   flat,
-<a name="l00164"></a>00164         cpl_imagelist       *   bpm)
-<a name="l00165"></a>00165 {
-<a name="l00166"></a>00166     <span class="keywordtype">int</span>                 idet;
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     <span class="comment">/* Test entries */</span>
-<a name="l00169"></a>00169     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     <span class="comment">/* Flat-field correction */</span>
-<a name="l00172"></a>00172     <span class="keywordflow">if</span> (flat != NULL) 
-<a name="l00173"></a>00173     {
-<a name="l00174"></a>00174         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</span>) ;
-<a name="l00175"></a>00175         <span class="comment">/* Apply the flat correction to the images */</span>
-<a name="l00176"></a>00176         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00177"></a>00177         {
-<a name="l00178"></a>00178             <span class="keywordflow">if</span> (cpl_image_divide(cpl_imagelist_get(ilist, idet),
-<a name="l00179"></a>00179                                  cpl_imagelist_get(flat, idet))!=CPL_ERROR_NONE) 
-<a name="l00180"></a>00180             {
-<a name="l00181"></a>00181                 cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</span>);
-<a name="l00182"></a>00182                 <span class="keywordflow">return</span> -1 ;
-<a name="l00183"></a>00183             }
-<a name="l00184"></a>00184         }
-<a name="l00185"></a>00185     }
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="comment">/* Correct the bad pixels if requested */</span>
-<a name="l00188"></a>00188     <span class="keywordflow">if</span> (bpm != NULL) 
-<a name="l00189"></a>00189     {
-<a name="l00190"></a>00190         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</span>) ;
-<a name="l00191"></a>00191         <span class="comment">/* Apply the flat correction to the images */</span>
-<a name="l00192"></a>00192         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00193"></a>00193         {
-<a name="l00194"></a>00194             cpl_mask        *   bpm_im_bin ;
-<a name="l00195"></a>00195             <span class="comment">/* Convert the map from integer to binary */</span>
-<a name="l00196"></a>00196             bpm_im_bin = cpl_mask_threshold_image_create
-<a name="l00197"></a>00197                 (cpl_imagelist_get(bpm, idet), -0.5, 0.5) ;
-<a name="l00198"></a>00198             cpl_mask_not(bpm_im_bin) ;
-<a name="l00199"></a>00199             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, idet), bpm_im_bin);
-<a name="l00200"></a>00200             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected
-<a name="l00201"></a>00201                     (cpl_imagelist_get(ilist, idet)) != CPL_ERROR_NONE) 
-<a name="l00202"></a>00202             {
-<a name="l00203"></a>00203                     cpl_msg_error
-<a name="l00204"></a>00204                         (cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in detector %d"</span>,
-<a name="l00205"></a>00205                          idet+1);
-<a name="l00206"></a>00206                     cpl_mask_delete(bpm_im_bin) ;
-<a name="l00207"></a>00207                     <span class="keywordflow">return</span> -1 ;
-<a name="l00208"></a>00208             }
-<a name="l00209"></a>00209             cpl_mask_delete(bpm_im_bin) ;
-<a name="l00210"></a>00210         }
-<a name="l00211"></a>00211     }
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00224"></a>00224 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00225"></a>00225 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>
-<a name="l00226"></a><a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75">00226</a> (cpl_imagelist *       ilist,
-<a name="l00227"></a>00227  cpl_imagelist *       bkg)
-<a name="l00228"></a>00228 {
-<a name="l00229"></a>00229     <span class="keywordtype">int</span>                 idet;
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     <span class="comment">/* Test entries */</span>
-<a name="l00232"></a>00232     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234     <span class="comment">/* Background correction */</span>
-<a name="l00235"></a>00235     <span class="keywordflow">if</span> (bkg != NULL) 
-<a name="l00236"></a>00236     {
-<a name="l00237"></a>00237         cpl_msg_info(cpl_func, <span class="stringliteral">"Subtract the images by the bkg"</span>) ;
-<a name="l00238"></a>00238         <span class="comment">/* Apply the bkg correction to the images */</span>
-<a name="l00239"></a>00239         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00240"></a>00240         {
-<a name="l00241"></a>00241             <span class="keywordflow">if</span> (cpl_image_subtract(cpl_imagelist_get(ilist, idet),
-<a name="l00242"></a>00242                                    cpl_imagelist_get(bkg, idet))!=CPL_ERROR_NONE) 
-<a name="l00243"></a>00243             {
-<a name="l00244"></a>00244                 cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the bkg to the images"</span>);
-<a name="l00245"></a>00245                 <span class="keywordflow">return</span> -1 ;
-<a name="l00246"></a>00246             }
-<a name="l00247"></a>00247         }
-<a name="l00248"></a>00248     }
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/* Return */</span>
-<a name="l00251"></a>00251     <span class="keywordflow">return</span> 0 ;
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253 }
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00275"></a>00275 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00276"></a><a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d">00276</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>(
-<a name="l00277"></a>00277         cpl_imagelist       *   ilist,
-<a name="l00278"></a>00278         cpl_image           *   flat,
-<a name="l00279"></a>00279         cpl_image           *   dark,
-<a name="l00280"></a>00280         cpl_image           *   bpm)
-<a name="l00281"></a>00281 {
-<a name="l00282"></a>00282     cpl_mask        *   bpm_im_bin ;
-<a name="l00283"></a>00283     <span class="keywordtype">int</span>                 i ;
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     <span class="comment">/* Test entries */</span>
-<a name="l00286"></a>00286     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="comment">/* Dark correction */</span>
-<a name="l00289"></a>00289     <span class="keywordflow">if</span> (dark != NULL) 
-<a name="l00290"></a>00290     {
-<a name="l00291"></a>00291         cpl_msg_info(cpl_func, <span class="stringliteral">"Subtract the images by the dark"</span>) ;
-<a name="l00292"></a>00292         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(ilist, dark)!=CPL_ERROR_NONE) 
-<a name="l00293"></a>00293         {
-<a name="l00294"></a>00294             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the dark to the images"</span>);
-<a name="l00295"></a>00295             <span class="keywordflow">return</span> -1 ;
-<a name="l00296"></a>00296         }
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     <span class="comment">/* Flat-field correction */</span>
-<a name="l00300"></a>00300     <span class="keywordflow">if</span> (flat != NULL) {
-<a name="l00301"></a>00301         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</span>) ;
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303         <span class="comment">/* Apply the flatfield correction to the images */</span>
-<a name="l00304"></a>00304         <span class="keywordflow">if</span> (cpl_imagelist_divide_image(ilist, flat)!=CPL_ERROR_NONE) {
-<a name="l00305"></a>00305             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</span>);
-<a name="l00306"></a>00306             <span class="keywordflow">return</span> -1 ;
-<a name="l00307"></a>00307         }
-<a name="l00308"></a>00308     }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="comment">/* Correct the bad pixels if requested */</span>
-<a name="l00311"></a>00311     <span class="keywordflow">if</span> (bpm != NULL) {
-<a name="l00312"></a>00312         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</span>) ;
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314         <span class="comment">/* Convert the map from integer to binary */</span>
-<a name="l00315"></a>00315         bpm_im_bin = cpl_mask_threshold_image_create(bpm, -0.5, 0.5) ;
-<a name="l00316"></a>00316         cpl_mask_not(bpm_im_bin) ;
-<a name="l00317"></a>00317         <span class="comment">/* Apply the bad pixels cleaning */</span>
-<a name="l00318"></a>00318         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(ilist) ; i++) {
-<a name="l00319"></a>00319             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, i), bpm_im_bin);
-<a name="l00320"></a>00320             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(
-<a name="l00321"></a>00321                         cpl_imagelist_get(ilist, i)) != CPL_ERROR_NONE) {
-<a name="l00322"></a>00322                 cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in obj %d"</span>,
-<a name="l00323"></a>00323                         i+1);
-<a name="l00324"></a>00324                 cpl_mask_delete(bpm_im_bin) ;
-<a name="l00325"></a>00325                 <span class="keywordflow">return</span> -1 ;
-<a name="l00326"></a>00326             }
-<a name="l00327"></a>00327         }
-<a name="l00328"></a>00328         cpl_mask_delete(bpm_im_bin) ;
-<a name="l00329"></a>00329     }
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331     <span class="comment">/* Return */</span>
-<a name="l00332"></a>00332     <span class="keywordflow">return</span> 0 ;
-<a name="l00333"></a>00333 }
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00353"></a>00353 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00354"></a><a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571">00354</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a>(
-<a name="l00355"></a>00355         cpl_imagelist       *   ilist,
-<a name="l00356"></a>00356         cpl_image           *   flat,
-<a name="l00357"></a>00357         cpl_image           *   bpm)
-<a name="l00358"></a>00358 {
-<a name="l00359"></a>00359     cpl_mask        *   bpm_im_bin ;
-<a name="l00360"></a>00360     <span class="keywordtype">int</span>                 i ;
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     <span class="comment">/* Test entries */</span>
-<a name="l00363"></a>00363     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365     <span class="comment">/* Flat-field correction */</span>
-<a name="l00366"></a>00366     <span class="keywordflow">if</span> (flat != NULL) {
-<a name="l00367"></a>00367         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</span>) ;
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369         <span class="comment">/* Apply the flatfield correction to the images */</span>
-<a name="l00370"></a>00370         <span class="keywordflow">if</span> (cpl_imagelist_divide_image(ilist, flat)!=CPL_ERROR_NONE) {
-<a name="l00371"></a>00371             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</span>);
-<a name="l00372"></a>00372             <span class="keywordflow">return</span> -1 ;
-<a name="l00373"></a>00373         }
-<a name="l00374"></a>00374     }
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="comment">/* Correct the bad pixels if requested */</span>
-<a name="l00377"></a>00377     <span class="keywordflow">if</span> (bpm != NULL) {
-<a name="l00378"></a>00378         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</span>) ;
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380         <span class="comment">/* Convert the map from integer to binary */</span>
-<a name="l00381"></a>00381         bpm_im_bin = cpl_mask_threshold_image_create(bpm, -0.5, 0.5) ;
-<a name="l00382"></a>00382         cpl_mask_not(bpm_im_bin) ;
-<a name="l00383"></a>00383         <span class="comment">/* Apply the bad pixels cleaning */</span>
-<a name="l00384"></a>00384         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(ilist) ; i++) {
-<a name="l00385"></a>00385             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, i), bpm_im_bin);
-<a name="l00386"></a>00386             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(
-<a name="l00387"></a>00387                         cpl_imagelist_get(ilist, i)) != CPL_ERROR_NONE) {
-<a name="l00388"></a>00388                 cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in obj %d"</span>,
-<a name="l00389"></a>00389                         i+1);
-<a name="l00390"></a>00390                 cpl_mask_delete(bpm_im_bin) ;
-<a name="l00391"></a>00391                 <span class="keywordflow">return</span> -1 ;
-<a name="l00392"></a>00392             }
-<a name="l00393"></a>00393         }
-<a name="l00394"></a>00394         cpl_mask_delete(bpm_im_bin) ;
-<a name="l00395"></a>00395     }
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/* Return */</span>
-<a name="l00398"></a>00398     <span class="keywordflow">return</span> 0 ;
-<a name="l00399"></a>00399 }
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00412"></a>00412 cpl_imagelist *  <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>
-<a name="l00413"></a><a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f">00413</a> (cpl_imagelist       *   imalist,
-<a name="l00414"></a>00414  <span class="keywordtype">int</span>                     nborder)
-<a name="l00415"></a>00415 {
-<a name="l00416"></a>00416     <span class="keywordtype">int</span> i = 0;
-<a name="l00417"></a>00417     <span class="comment">/* Discard the pixels on the sides */</span>
-<a name="l00418"></a>00418     cpl_imagelist * trimmed_images = cpl_imagelist_new();
-<a name="l00419"></a>00419     <span class="keywordflow">while</span>(cpl_imagelist_get_size(imalist) > 0)
-<a name="l00420"></a>00420     {
-<a name="l00421"></a>00421         cpl_image * non_trimmed;
-<a name="l00422"></a>00422         cpl_image * trimmed;
-<a name="l00423"></a>00423         <span class="keywordtype">int</span>         nx;
-<a name="l00424"></a>00424         <span class="keywordtype">int</span>         ny;
-<a name="l00425"></a>00425         
-<a name="l00426"></a>00426         non_trimmed = cpl_imagelist_unset(imalist, 0);
-<a name="l00427"></a>00427         nx = cpl_image_get_size_x(non_trimmed);
-<a name="l00428"></a>00428         ny = cpl_image_get_size_y(non_trimmed);
-<a name="l00429"></a>00429         trimmed = cpl_image_extract(non_trimmed, 
-<a name="l00430"></a>00430                                     nborder+1, nborder+1, 
-<a name="l00431"></a>00431                                     nx-nborder, ny-nborder);
-<a name="l00432"></a>00432         cpl_imagelist_set(trimmed_images, trimmed, i);
-<a name="l00433"></a>00433         ++i;
-<a name="l00434"></a>00434         cpl_image_delete(non_trimmed);
-<a name="l00435"></a>00435     }
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     <span class="keywordflow">return</span> trimmed_images;
-<a name="l00438"></a>00438 }
-<a name="l00439"></a>00439 
-<a name="l00440"></a>00440 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00449"></a>00449 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00450"></a><a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b">00450</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a>(
-<a name="l00451"></a>00451         cpl_image           *   ima,
-<a name="l00452"></a>00452         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   bpm,
-<a name="l00453"></a>00453         <span class="keywordtype">int</span>                     idet)
-<a name="l00454"></a>00454 {
-<a name="l00455"></a>00455     cpl_mask        *   bpm_im_bin ;
-<a name="l00456"></a>00456     cpl_image       *   bpm_im_int ;
-<a name="l00457"></a>00457     <span class="keywordtype">int</span>                 ext_nb ;
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="comment">/* Test entries */</span>
-<a name="l00460"></a>00460     <span class="keywordflow">if</span> (ima == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00461"></a>00461     <span class="keywordflow">if</span> (idet < 1 || idet > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> -1 ;
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (bpm == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/* Get the extension number for this detector */</span>
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(bpm, idet)) == -1) {
-<a name="l00466"></a>00466         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with detector %d"</span>, idet) ;
-<a name="l00467"></a>00467         <span class="keywordflow">return</span> -1 ;
-<a name="l00468"></a>00468     }
-<a name="l00469"></a>00469      <span class="comment">/* Load the bad pixels image */</span>
-<a name="l00470"></a>00470     <span class="keywordflow">if</span> ((bpm_im_int = cpl_image_load(bpm, CPL_TYPE_INT, 0, ext_nb)) == NULL) {
-<a name="l00471"></a>00471         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load the bad pixel map %s"</span>, bpm) ;
-<a name="l00472"></a>00472         <span class="keywordflow">return</span> -1 ;
-<a name="l00473"></a>00473     }
-<a name="l00474"></a>00474     <span class="comment">/* Convert the map from integer to binary */</span>
-<a name="l00475"></a>00475     bpm_im_bin = cpl_mask_threshold_image_create(bpm_im_int, -0.5, 0.5) ;
-<a name="l00476"></a>00476     cpl_mask_not(bpm_im_bin) ;
-<a name="l00477"></a>00477     cpl_image_delete(bpm_im_int) ;
-<a name="l00478"></a>00478     <span class="comment">/* Apply the bad pixels cleaning */</span>
-<a name="l00479"></a>00479     cpl_image_reject_from_mask(ima, bpm_im_bin);
-<a name="l00480"></a>00480     <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(ima) != CPL_ERROR_NONE) {
-<a name="l00481"></a>00481         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels"</span>);
-<a name="l00482"></a>00482         cpl_mask_delete(bpm_im_bin) ;
-<a name="l00483"></a>00483         <span class="keywordflow">return</span> -1 ;
-<a name="l00484"></a>00484     }
-<a name="l00485"></a>00485     cpl_mask_delete(bpm_im_bin) ;
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="comment">/* Return */</span>
-<a name="l00488"></a>00488     <span class="keywordflow">return</span> 0 ;
-<a name="l00489"></a>00489 }
-<a name="l00490"></a>00490 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_calib.c,v 1.6 2010/11/03 18:50: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/11/03 18:50: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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_load.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">/*----------------------------------------------------------------------------*/</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> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a></div>
+<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489">   73</a></span> (cpl_imagelist  *  ilist,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_imagelist  *  flat,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_imagelist  *  dark,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_imagelist  *  bpm)</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">int</span>   idet;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Dark correction */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordflow">if</span> (dark != NULL)</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_msg_info(cpl_func, <span class="stringliteral">"Subtracting the dark to each chip image"</span>) ;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         <span class="comment">/* Apply the dark correction to the images */</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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">if</span> (cpl_image_subtract(cpl_imagelist_get(ilist, idet),</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                    cpl_imagelist_get(dark, idet))!=CPL_ERROR_NONE) </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_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the dark to chip %d"</span>,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                               idet+1);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                 <span class="keywordflow">return</span> -1 ;</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> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="comment">/* Flat-field correction */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordflow">if</span> (flat != NULL) </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_msg_info(cpl_func, <span class="stringliteral">"Dividing the flat to each chip image"</span>) ;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         <span class="comment">/* Apply the flat correction to the images */</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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="keywordflow">if</span> (cpl_image_divide(cpl_imagelist_get(ilist, idet),</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                  cpl_imagelist_get(flat, idet))!=CPL_ERROR_NONE) </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_msg_error(__func__,<span class="stringliteral">"Cannot apply the flatfield to chip %d"</span>,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                               idet+1);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                 <span class="keywordflow">return</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>         }</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="comment">/* Correct the bad pixels if requested */</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordflow">if</span> (bpm != 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>         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels to each chip image"</span>);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         <span class="comment">/* Apply the flat correction to the images */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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_mask    * bpm_im_bin ;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             <span class="comment">/* Convert the map from integer to binary */</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>             bpm_im_bin = cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                 (cpl_imagelist_get(bpm, idet), -0.5, 0.5) ;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>             cpl_mask_not(bpm_im_bin) ;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, idet), bpm_im_bin);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     (cpl_imagelist_get(ilist, idet)) != CPL_ERROR_NONE) </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_msg_error</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                         (cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in chip %d"</span>,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                          idet+1);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     cpl_mask_delete(bpm_im_bin) ;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     <span class="keywordflow">return</span> -1 ;</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_mask_delete(bpm_im_bin) ;</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> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c">  161</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c" title="Apply the calibration to the images.">hawki_flat_bpm_imglist_calib</a>(</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>         cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         cpl_imagelist       *   flat,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_imagelist       *   bpm)</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="keywordtype">int</span>                 idet;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keywordflow">if</span> (ilist == NULL) <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">/* Flat-field correction */</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="keywordflow">if</span> (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>         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</span>) ;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="comment">/* Apply the flat correction to the images */</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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_image_divide(cpl_imagelist_get(ilist, idet),</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                  cpl_imagelist_get(flat, idet))!=CPL_ERROR_NONE) </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_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</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>         }</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">/* Correct the bad pixels if requested */</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordflow">if</span> (bpm != NULL) </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_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</span>) ;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         <span class="comment">/* Apply the flat correction to the images */</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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_mask        *   bpm_im_bin ;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>             <span class="comment">/* Convert the map from integer to binary */</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>             bpm_im_bin = cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                 (cpl_imagelist_get(bpm, idet), -0.5, 0.5) ;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>             cpl_mask_not(bpm_im_bin) ;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, idet), bpm_im_bin);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                     (cpl_imagelist_get(ilist, idet)) != CPL_ERROR_NONE) </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_msg_error</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                         (cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in detector %d"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                          idet+1);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                     cpl_mask_delete(bpm_im_bin) ;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                     <span class="keywordflow">return</span> -1 ;</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_mask_delete(bpm_im_bin) ;</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 class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a></div>
+<div class="line"><a name="l00226"></a><span class="lineno"><a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75">  226</a></span> (cpl_imagelist *       ilist,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>  cpl_imagelist *       bkg)</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">int</span>                 idet;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Background correction */</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <span class="keywordflow">if</span> (bkg != 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>         cpl_msg_info(cpl_func, <span class="stringliteral">"Subtract the images by the bkg"</span>) ;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>         <span class="comment">/* Apply the bkg correction to the images */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS ; ++idet)</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">if</span> (cpl_image_subtract(cpl_imagelist_get(ilist, idet),</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                    cpl_imagelist_get(bkg, idet))!=CPL_ERROR_NONE) </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_error(cpl_func,<span class="stringliteral">"Cannot apply the bkg to the images"</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>         }</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordflow">return</span> 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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d">  276</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>(</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>         cpl_image           *   flat,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         cpl_image           *   dark,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         cpl_image           *   bpm)</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_mask        *   bpm_im_bin ;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="keywordtype">int</span>                 i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Dark correction */</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">if</span> (dark != NULL) </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(cpl_func, <span class="stringliteral">"Subtract the images by the dark"</span>) ;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(ilist, dark)!=CPL_ERROR_NONE) </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>             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the dark to the images"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>             <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Flat-field correction */</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">if</span> (flat != NULL) {</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</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">/* Apply the flatfield correction to the images */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         <span class="keywordflow">if</span> (cpl_imagelist_divide_image(ilist, flat)!=CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</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>     }</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">/* Correct the bad pixels if requested */</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">if</span> (bpm != NULL) {</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</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">/* Convert the map from integer to binary */</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         bpm_im_bin = cpl_mask_threshold_image_create(bpm, -0.5, 0.5) ;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         cpl_mask_not(bpm_im_bin) ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         <span class="comment">/* Apply the bad pixels cleaning */</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(ilist) ; i++) {</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, i), bpm_im_bin);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                         cpl_imagelist_get(ilist, i)) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in obj %d"</span>,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                         i+1);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                 cpl_mask_delete(bpm_im_bin) ;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                 <span class="keywordflow">return</span> -1 ;</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>         cpl_mask_delete(bpm_im_bin) ;</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571">  354</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a>(</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         cpl_image           *   flat,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         cpl_image           *   bpm)</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>     cpl_mask        *   bpm_im_bin ;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keywordtype">int</span>                 i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Flat-field correction */</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">if</span> (flat != NULL) {</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Divide the images by the flatfield"</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">/* Apply the flatfield correction to the images */</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         <span class="keywordflow">if</span> (cpl_imagelist_divide_image(ilist, flat)!=CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>             cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot apply the flatfield to the images"</span>);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>             <span class="keywordflow">return</span> -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>     }</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">/* Correct the bad pixels if requested */</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">if</span> (bpm != NULL) {</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Correct the bad pixels in the images"</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="comment">/* Convert the map from integer to binary */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>         bpm_im_bin = cpl_mask_threshold_image_create(bpm, -0.5, 0.5) ;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>         cpl_mask_not(bpm_im_bin) ;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         <span class="comment">/* Apply the bad pixels cleaning */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(ilist) ; i++) {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>             cpl_image_reject_from_mask(cpl_imagelist_get(ilist, i), bpm_im_bin);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>             <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                         cpl_imagelist_get(ilist, i)) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels in obj %d"</span>,</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>                         i+1);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                 cpl_mask_delete(bpm_im_bin) ;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                 <span class="keywordflow">return</span> -1 ;</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>         cpl_mask_delete(bpm_im_bin) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">return</span> 0 ;</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="l00412"></a><span class="lineno">  412</span> cpl_imagelist *  <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a></div>
+<div class="line"><a name="l00413"></a><span class="lineno"><a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f">  413</a></span> (cpl_imagelist       *   imalist,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>  <span class="keywordtype">int</span>                     nborder)</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="keywordtype">int</span> i = 0;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="comment">/* Discard the pixels on the sides */</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_imagelist * trimmed_images = cpl_imagelist_new();</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="keywordflow">while</span>(cpl_imagelist_get_size(imalist) > 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>         cpl_image * non_trimmed;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         cpl_image * trimmed;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keywordtype">int</span>         nx;</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         <span class="keywordtype">int</span>         ny;</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>         non_trimmed = cpl_imagelist_unset(imalist, 0);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         nx = cpl_image_get_size_x(non_trimmed);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         ny = cpl_image_get_size_y(non_trimmed);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         trimmed = cpl_image_extract(non_trimmed, </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                                     nborder+1, nborder+1, </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>                                     nx-nborder, ny-nborder);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         cpl_imagelist_set(trimmed_images, trimmed, i);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         ++i;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         cpl_image_delete(non_trimmed);</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> </div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordflow">return</span> trimmed_images;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b">  450</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a>(</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         cpl_image           *   ima,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   bpm,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         <span class="keywordtype">int</span>                     idet)</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_mask        *   bpm_im_bin ;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     cpl_image       *   bpm_im_int ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordtype">int</span>                 ext_nb ;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="keywordflow">if</span> (ima == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">if</span> (idet < 1 || idet > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (bpm == NULL) <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="comment">/* Get the extension number for this detector */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(bpm, idet)) == -1) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with detector %d"</span>, idet) ;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         <span class="keywordflow">return</span> -1 ;</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">/* Load the bad pixels image */</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordflow">if</span> ((bpm_im_int = cpl_image_load(bpm, CPL_TYPE_INT, 0, ext_nb)) == NULL) {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load the bad pixel map %s"</span>, bpm) ;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Convert the map from integer to binary */</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     bpm_im_bin = cpl_mask_threshold_image_create(bpm_im_int, -0.5, 0.5) ;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_mask_not(bpm_im_bin) ;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_image_delete(bpm_im_int) ;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="comment">/* Apply the bad pixels cleaning */</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cpl_image_reject_from_mask(ima, bpm_im_bin);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">if</span> (cpl_detector_interpolate_rejected(ima) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot clean the bad pixels"</span>);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         cpl_mask_delete(bpm_im_bin) ;</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_mask_delete(bpm_im_bin) ;</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">return</span> 0 ;</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><!-- 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/hawki__calib_8h_source.html b/html/hawki__calib_8h_source.html
index 9188a54..6bbefbc 100644
--- a/html/hawki__calib_8h_source.html
+++ b/html/hawki__calib_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_calib.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,90 +40,91 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_calib.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_calib.h,v 1.6 2010/11/03 18:50:47 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/11/03 18:50:47 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_CALIB_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALIB_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                Function definitions</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a>
-<a name="l00042"></a>00042 (cpl_image *           ima,
-<a name="l00043"></a>00043  <span class="keyword">const</span> <span class="keywordtype">char</span> *          bpm,
-<a name="l00044"></a>00044  <span class="keywordtype">int</span>                   idet);
-<a name="l00045"></a>00045 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a>
-<a name="l00046"></a>00046 (cpl_imagelist       *   ilist,
-<a name="l00047"></a>00047  cpl_image           *   flat,
-<a name="l00048"></a>00048  cpl_image           *   bpm);
-<a name="l00049"></a>00049 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>
-<a name="l00050"></a>00050 (cpl_imagelist       *   ilist,
-<a name="l00051"></a>00051  cpl_image           *   flat,
-<a name="l00052"></a>00052  cpl_image           *   dark,
-<a name="l00053"></a>00053  cpl_image           *   bpm);
-<a name="l00054"></a>00054 cpl_imagelist *  <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a>
-<a name="l00055"></a>00055 (cpl_imagelist       *   ilist,
-<a name="l00056"></a>00056  <span class="keywordtype">int</span>                     nborder);
-<a name="l00057"></a>00057 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a>
-<a name="l00058"></a>00058 (cpl_imagelist *       ilist,
-<a name="l00059"></a>00059  cpl_imagelist *       flat,
-<a name="l00060"></a>00060  cpl_imagelist *       dark,
-<a name="l00061"></a>00061  cpl_imagelist *       bpm);
-<a name="l00062"></a>00062 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c" title="Apply the calibration to the images.">hawki_flat_bpm_imglist_calib</a>
-<a name="l00063"></a>00063 (cpl_imagelist *       ilist,
-<a name="l00064"></a>00064  cpl_imagelist *       flat,
-<a name="l00065"></a>00065  cpl_imagelist *       bpm);
-<a name="l00066"></a>00066 <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>
-<a name="l00067"></a>00067 (cpl_imagelist *       ilist,
-<a name="l00068"></a>00068  cpl_imagelist *       bkg);
-<a name="l00069"></a>00069 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_calib.h,v 1.6 2010/11/03 18:50: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/11/03 18:50:47 $</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: hawki-1_8_12 $</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 HAWKI_CALIB_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALIB_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                Function definitions</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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">int</span> <a class="code" href="group__hawki__calib.html#gacab5ec7e7db02bd1f46661c443a6c16b" title="Apply the BPM correction to an image.">hawki_bpm_calib</a></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> (cpl_image *           ima,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *          bpm,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>  <span class="keywordtype">int</span>                   idet);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga07a2392c998d129862af73b06e1d0571" title="Apply the calibration to the images.">hawki_flat_bpm_detector_calib</a></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> (cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>  cpl_image           *   flat,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>  cpl_image           *   bpm);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> (cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>  cpl_image           *   flat,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>  cpl_image           *   dark,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>  cpl_image           *   bpm);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> cpl_imagelist *  <a class="code" href="group__hawki__calib.html#ga5013786f602800e5899b011b21f9547f" title="Trim a list of hawki images (usually from one detector)">hawki_trim_detector_calib</a></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> (cpl_imagelist       *   ilist,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>  <span class="keywordtype">int</span>                     nborder);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> (cpl_imagelist *       ilist,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  cpl_imagelist *       flat,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  cpl_imagelist *       dark,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  cpl_imagelist *       bpm);</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#gabf25546801362d0be3ac42779e8fb29c" title="Apply the calibration to the images.">hawki_flat_bpm_imglist_calib</a></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> (cpl_imagelist *       ilist,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  cpl_imagelist *       flat,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  cpl_imagelist *       bpm);</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> (cpl_imagelist *       ilist,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  cpl_imagelist *       bkg);</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</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/hawki__combine_8c_source.html b/html/hawki__combine_8c_source.html
index 465e56c..7fc450e 100644
--- a/html/hawki__combine_8c_source.html
+++ b/html/hawki__combine_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_combine.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,68 +40,69 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_combine.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_combine.c,v 1.1.1.1 2007/02/13 16:03:30 yjung 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: yjung $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/02/13 16:03:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1.1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "hawki_combine.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00042"></a>00042 <span class="comment">                                Functions prototypes</span>
-<a name="l00043"></a>00043 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_combine.c,v 1.1.1.1 2007/02/13 16:03:30 yjung 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: yjung $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007/02/13 16:03:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1.1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "hawki_combine.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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">                                Functions prototypes</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="l00045"></a><span class="lineno">   45</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> </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/hawki__combine_8h_source.html b/html/hawki__combine_8h_source.html
index f4a6af8..0a36ad6 100644
--- a/html/hawki__combine_8h_source.html
+++ b/html/hawki__combine_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_combine.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,56 +40,57 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_combine.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_combine.h,v 1.1.1.1 2007/02/13 16:03:30 yjung 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: yjung $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/02/13 16:03:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1.1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_COMBINE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COMBINE_H</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">                                Functions prototypes</span>
-<a name="l00033"></a>00033 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_combine.h,v 1.1.1.1 2007/02/13 16:03:30 yjung 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: yjung $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007/02/13 16:03:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1.1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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 HAWKI_COMBINE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COMBINE_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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment">                                Functions prototypes</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">#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/hawki__dfs_8c_source.html b/html/hawki__dfs_8c_source.html
index db13b22..daaf4fc 100644
--- a/html/hawki__dfs_8c_source.html
+++ b/html/hawki__dfs_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_dfs.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,124 +40,125 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_dfs.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_dfs.c,v 1.29 2012/12/07 09:36:29 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/07 09:36:29 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.29 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00053"></a>00053 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00059"></a>00059 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00060"></a><a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b">00060</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(cpl_frameset * <span class="keyword">set</span>)
-<a name="l00061"></a>00061 {
-<a name="l00062"></a>00062     cpl_frame   *   cur_frame ;
-<a name="l00063"></a>00063     <span class="keyword">const</span> <span class="keywordtype">char</span>  *   tag ;
-<a name="l00064"></a>00064     <span class="keywordtype">int</span>             nframes ;
-<a name="l00065"></a>00065     <span class="keywordtype">int</span>             i ;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="comment">/* Check entries */</span>
-<a name="l00068"></a>00068     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070     <span class="comment">/* Initialize */</span>
-<a name="l00071"></a>00071     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <span class="comment">/* Loop on frames */</span>
-<a name="l00074"></a>00074     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {
-<a name="l00075"></a>00075         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, i) ;
-<a name="l00076"></a>00076         tag = cpl_frame_get_tag(cur_frame) ;
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078         <span class="comment">/* RAW frames */</span>
-<a name="l00079"></a>00079         <span class="keywordflow">if</span> (!strcmp(tag, HAWKI_COMMAND_LINE)                       ||
-<a name="l00080"></a>00080                 !strcmp(tag, HAWKI_CAL_DARK_RAW)                   ||
-<a name="l00081"></a>00081                 !strcmp(tag, HAWKI_TEC_FLAT_RAW)                   ||
-<a name="l00082"></a>00082                 !strcmp(tag, HAWKI_CAL_FLAT_RAW)                   ||
-<a name="l00083"></a>00083                 !strcmp(tag, HAWKI_CAL_ZPOINT_RAW)                 ||
-<a name="l00084"></a>00084                 !strcmp(tag, HAWKI_CAL_ILLUM_RAW)                  ||
-<a name="l00085"></a>00085                 !strcmp(tag, HAWKI_CAL_DISTOR_RAW)                 ||
-<a name="l00086"></a>00086                 !strcmp(tag, HAWKI_IMG_JITTER_SKY_RAW)             ||
-<a name="l00087"></a>00087                 !strcmp(tag, HAWKI_IMG_JITTER_RAW)                 ||
-<a name="l00088"></a>00088                 !strcmp(tag, HAWKI_CAL_LINGAIN_LAMP_RAW)           ||
-<a name="l00089"></a>00089                 !strcmp(tag, HAWKI_CAL_LINGAIN_DARK_RAW)           ||
-<a name="l00090"></a>00090                 !strcmp(tag, HAWKI_CALPRO_BASICCALIBRATED)         ||
-<a name="l00091"></a>00091                 !strcmp(tag, HAWKI_CALPRO_SKY_BASICCALIBRATED)     ||
-<a name="l00092"></a>00092                 !strcmp(tag, HAWKI_CALPRO_BKGIMAGE)                ||
-<a name="l00093"></a>00093                 !strcmp(tag, HAWKI_CALPRO_BKG_SUBTRACTED)          ||
-<a name="l00094"></a>00094                 !strcmp(tag, HAWKI_CALPRO_DIST_CORRECTED)          ||
-<a name="l00095"></a>00095                 !strcmp(tag, HAWKI_CALPRO_COMBINED)                ||
-<a name="l00096"></a>00096                 !strcmp(tag, HAWKI_CALPRO_OBJ_MASK)                ||
-<a name="l00097"></a>00097                 !strcmp(tag, HAWKI_CALPRO_ZPOINT_TAB))
-<a name="l00098"></a>00098             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;
-<a name="l00099"></a>00099         <span class="comment">/* CALIB frames */</span>
-<a name="l00100"></a>00100         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(tag, HAWKI_CALPRO_BPM)          ||
-<a name="l00101"></a>00101                 !strcmp(tag, HAWKI_UTIL_STDSTARS_RAW)    ||
-<a name="l00102"></a>00102                 !strcmp(tag, HAWKI_UTIL_DISTMAP_RAW)     ||
-<a name="l00103"></a>00103                 !strcmp(tag, HAWKI_CALPRO_BPM_HOT)       ||
-<a name="l00104"></a>00104                 !strcmp(tag, HAWKI_CALPRO_BPM_COLD)      ||
-<a name="l00105"></a>00105                 !strcmp(tag, HAWKI_CALPRO_FLAT)          ||
-<a name="l00106"></a>00106                 !strcmp(tag, HAWKI_CALPRO_DARK)          ||
-<a name="l00107"></a>00107                 !strcmp(tag, HAWKI_CALPRO_STDSTARS)      ||
-<a name="l00108"></a>00108                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_X)  ||
-<a name="l00109"></a>00109                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_Y)  ||
-<a name="l00110"></a>00110                 !strcmp(tag, HAWKI_CALPRO_DISTORTION))
-<a name="l00111"></a>00111             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB) ;
-<a name="l00112"></a>00112     }
-<a name="l00113"></a>00113     <span class="keywordflow">return</span> 0 ;
-<a name="l00114"></a>00114 }
-<a name="l00115"></a>00115 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_dfs.c,v 1.29 2012/12/07 09:36:29 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/07 09:36:29 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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> </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="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_dfs.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="comment">/*----------------------------------------------------------------------------*/</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="l00053"></a><span class="lineno">   53</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b">   60</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(cpl_frameset * <span class="keyword">set</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_frame   *   cur_frame ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *   tag ;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="keywordtype">int</span>             nframes ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">int</span>             i ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Initialize */</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</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="comment">/* Loop on frames */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, i) ;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         tag = cpl_frame_get_tag(cur_frame) ;</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">/* RAW frames */</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         <span class="keywordflow">if</span> (!strcmp(tag, HAWKI_COMMAND_LINE)                       ||</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                 !strcmp(tag, HAWKI_CAL_DARK_RAW)                   ||</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                 !strcmp(tag, HAWKI_TEC_FLAT_RAW)                   ||</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                 !strcmp(tag, HAWKI_CAL_FLAT_RAW)                   ||</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                 !strcmp(tag, HAWKI_CAL_ZPOINT_RAW)                 ||</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                 !strcmp(tag, HAWKI_CAL_ILLUM_RAW)                  ||</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                 !strcmp(tag, HAWKI_CAL_DISTOR_RAW)                 ||</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                 !strcmp(tag, HAWKI_IMG_JITTER_SKY_RAW)             ||</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                 !strcmp(tag, HAWKI_IMG_JITTER_RAW)                 ||</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                 !strcmp(tag, HAWKI_CAL_LINGAIN_LAMP_RAW)           ||</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                 !strcmp(tag, HAWKI_CAL_LINGAIN_DARK_RAW)           ||</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                 !strcmp(tag, HAWKI_CALPRO_BASICCALIBRATED)         ||</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                 !strcmp(tag, HAWKI_CALPRO_SKY_BASICCALIBRATED)     ||</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                 !strcmp(tag, HAWKI_CALPRO_BKGIMAGE)                ||</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                 !strcmp(tag, HAWKI_CALPRO_BKG_SUBTRACTED)          ||</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                 !strcmp(tag, HAWKI_CALPRO_DIST_CORRECTED)          ||</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                 !strcmp(tag, HAWKI_CALPRO_COMBINED)                ||</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                 !strcmp(tag, HAWKI_CALPRO_OBJ_MASK)                ||</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                 !strcmp(tag, HAWKI_CALPRO_ZPOINT_TAB))</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>         <span class="comment">/* CALIB frames */</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(tag, HAWKI_CALPRO_BPM)          ||</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                 !strcmp(tag, HAWKI_UTIL_STDSTARS_RAW)    ||</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                 !strcmp(tag, HAWKI_UTIL_DISTMAP_RAW)     ||</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                 !strcmp(tag, HAWKI_CALPRO_BPM_HOT)       ||</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                 !strcmp(tag, HAWKI_CALPRO_BPM_COLD)      ||</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                 !strcmp(tag, HAWKI_CALPRO_FLAT)          ||</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                 !strcmp(tag, HAWKI_CALPRO_DARK)          ||</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                 !strcmp(tag, HAWKI_CALPRO_STDSTARS)      ||</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_X)  ||</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_Y)  ||</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                 !strcmp(tag, HAWKI_CALPRO_DISTORTION))</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB) ;</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">return</span> 0 ;</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><!-- 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/hawki__dfs_8h_source.html b/html/hawki__dfs_8h_source.html
index 905fcf4..3222560 100644
--- a/html/hawki__dfs_8h_source.html
+++ b/html/hawki__dfs_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_dfs.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,528 +40,529 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_dfs.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_dfs.h,v 1.57 2012/12/05 14:56:34 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/05 14:56:34 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.57 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_DFS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DFS_H</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">                                Define</span>
-<a name="l00033"></a>00033 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="comment">/******************************************/</span>
-<a name="l00036"></a>00036 <span class="comment">/* DEFINE HERE THE DIFFERENT COLUMN NAMES */</span>
-<a name="l00037"></a>00037 <span class="comment">/******************************************/</span>
-<a name="l00038"></a>00038 <span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_ALT               "TEL_ALT"</span>
-<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AZ                "TEL_AZ"</span>
-<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM         "TEL_AMBI_RHUM"</span>
-<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0         "TEL_AMBI_TAU0"</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP         "TEL_AMBI_TEMP"</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR      "TEL_AMBI_WINDDIR"</span>
-<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP       "TEL_AMBI_WINDSP"</span>
-<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM           "TEL_IA_FWHM"</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START      "ADA_ABSROT_START"</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END        "ADA_ABSROT_END"</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA      "ADA_ABSROT_DELTA"</span>
-<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START        "TEL_AIRM_START"</span>
-<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END          "TEL_AIRM_END"</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM              "TEL_AIRM"</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START   "TEL_AMBI_FWHM_START"</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END     "TEL_AMBI_FWHM_END"</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM         "TEL_AMBI_FWHM"</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START   "TEL_AMBI_PRES_START"</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END     "TEL_AMBI_PRES_END"</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES         "TEL_AMBI_PRES"</span>
-<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START      "TEL_PARANG_START"</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END        "TEL_PARANG_END"</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG            "TEL_PARANG"</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA      "TEL_PARANG_DELTA"</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA        "SEQ_CUMOFFSETA"</span>
-<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD        "SEQ_CUMOFFSETD"</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX        "SEQ_CUMOFFSETX"</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY        "SEQ_CUMOFFSETY"</span>
-<a name="l00066"></a>00066 <span class="preprocessor"></span>
-<a name="l00067"></a>00067 <span class="preprocessor">#define HAWKI_COL_STAT_MIN     "MINIMUM"</span>
-<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MAX     "MAXIMUM"</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MED     "MEDIAN"</span>
-<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MEAN    "MEAN"</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_RMS     "RMS"</span>
-<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_USED    "USED"</span>
-<a name="l00073"></a>00073 <span class="preprocessor"></span>
-<a name="l00074"></a>00074 <span class="preprocessor">#define HAWKI_COL_ZPOINT_MAG          "MAG"</span>
-<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_STARNAME     "STARNAME"</span>
-<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_CHIP         "CHIP"</span>
-<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ERRMAG       "MAG_ERR"</span>
-<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FILTER       "FILTER"</span>
-<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_AIRMASS      "AIRMASS"</span>
-<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_POSX         "POSX"</span>
-<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_POSY         "POSY"</span>
-<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ZPOINT       "ZPOINT"</span>
-<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ZPOINT_ERR   "ZPOINT_ERR"</span>
-<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ATX0         "ATX0"</span>
-<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FLUX         "FLUX"</span>
-<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FLUX_ERR     "FLUX_ERR"</span>
-<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_INSTRMAG     "INSTRMAG"</span>
-<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_INSTRMAG_ERR "INSTRMAG_ERR"</span>
-<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_PEAK         "PEAK"</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_BGD          "BGD"</span>
-<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMX        "FWHMX"</span>
-<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMY        "FWHMY"</span>
-<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHM         "FWHM"</span>
-<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMX_AS     "FWHMX_AS"</span>
-<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMY_AS     "FWHMY_AS"</span>
-<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHM_AS      "FWHM_AS"</span>
-<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_STARMAG      "STAR_CAT_MAG"</span>
-<a name="l00098"></a>00098 <span class="preprocessor"></span>
-<a name="l00099"></a>00099 <span class="preprocessor">#define HAWKI_COL_PHOT_FILTER       "FILTER"</span>
-<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_EXTCOEFF     "EXT"</span>
-<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DEXTCOEFF    "DEXT"</span>
-<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_ZEROPOINT    "ZPOINT"</span>
-<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DZEROPOINT   "DZPOINT"</span>
-<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_COLORTERM    "COL"</span>
-<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DCOLORTERM   "DCOL"</span>
-<a name="l00106"></a>00106 <span class="preprocessor"></span>
-<a name="l00107"></a>00107 <span class="preprocessor">#define HAWKI_COL_OBJ_POSX          "POS_X"</span>
-<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_POSY          "POS_Y"</span>
-<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FWHM_MAJAX    "FWHM_MAJAX"</span>
-<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FWHM_MINAX    "FWHM_MINAX"</span>
-<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_ELLIP         "ELLIP"</span>
-<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_ANGLE         "ANGLE"</span>
-<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FLUX          "FLUX"</span>
-<a name="l00114"></a>00114 <span class="preprocessor"></span>
-<a name="l00115"></a>00115 <span class="preprocessor">#define HAWKI_COL_ILLUM_POSX        "POSX"</span>
-<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ILLUM_POSY        "POSY"</span>
-<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ILLUM_FLUX        "FLUX"</span>
-<a name="l00118"></a>00118 <span class="preprocessor"></span>
-<a name="l00119"></a>00119 <span class="preprocessor">#define HAWKI_COL_DIST_DXGC         "DXGC"</span>
-<a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_DYGC         "DYGC"</span>
-<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_I            "I"</span>
-<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_J            "J"</span>
-<a name="l00123"></a>00123 <span class="preprocessor"></span>
-<a name="l00124"></a>00124 <span class="preprocessor">#define HAWKI_COL_OFFSET_X          "X_OFFSET"</span>
-<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OFFSET_Y          "Y_OFFSET"</span>
-<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_CORRELATION       "CORRELATION"</span>
-<a name="l00127"></a>00127 <span class="preprocessor"></span>
-<a name="l00128"></a>00128 <span class="preprocessor">#define HAWKI_COL_2MASS_RA          "RA"</span>
-<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_DEC         "Dec"</span>
-<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_J_MAG       "j_m"</span>
-<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_J_MAGSIG    "j_msig"</span>
-<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_H_MAG       "h_m"</span>
-<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_H_MAGSIG    "h_msig"</span>
-<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_K_MAG       "k_m"</span>
-<a name="l00135"></a>00135 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_K_MAGSIG    "k_msig"</span>
-<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_XPREDICT    "xpredict"</span>
-<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_YPREDICT    "ypredict"</span>
-<a name="l00138"></a>00138 <span class="preprocessor"></span>
-<a name="l00139"></a>00139 <span class="preprocessor">#define HAWKI_COL_MATCHING_SETS     "MATCHING_SETS"</span>
-<a name="l00140"></a>00140 <span class="preprocessor"></span>
-<a name="l00141"></a>00141 <span class="comment">/*************************************/</span>
-<a name="l00142"></a>00142 <span class="comment">/* DEFINE HERE THE PRO.CATG KEYWORDS */</span>
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144 <span class="comment">/* Type HAWKI_PROTYPE_COMBINED */</span>
-<a name="l00145"></a>00145 <span class="preprocessor">#define HAWKI_CALPRO_COMBINED                "COMBINED"</span>
-<a name="l00146"></a>00146 <span class="preprocessor"></span>
-<a name="l00147"></a>00147 <span class="comment">/* Type HAWKI_PROTYPE_COMB_CONTRIB_MAP */</span>
-<a name="l00148"></a>00148 <span class="preprocessor">#define HAWKI_CALPRO_COMB_CONTRIB_MAP        "COMBINED_CONTRIB_MAP"</span>
-<a name="l00149"></a>00149 <span class="preprocessor"></span>
-<a name="l00150"></a>00150 <span class="comment">/* Type HAWKI_PROTYPE_STITCHED */</span>
-<a name="l00151"></a>00151 <span class="preprocessor">#define HAWKI_CALPRO_STITCHED                "STITCHED"</span>
-<a name="l00152"></a>00152 <span class="preprocessor"></span>
-<a name="l00153"></a>00153 <span class="comment">/* Type HAWKI_PROTYPE_DIST_CORRECTED */</span>
-<a name="l00154"></a>00154 <span class="preprocessor">#define HAWKI_CALPRO_DIST_CORRECTED          "DIST_CORRECTED"</span>
-<a name="l00155"></a>00155 <span class="preprocessor"></span>
-<a name="l00156"></a>00156 <span class="comment">/* Type HAWKI_PROTYPE_ILLUM */</span>
-<a name="l00157"></a>00157 <span class="preprocessor">#define HAWKI_CALPRO_ILLUM                   "ILLUM"</span>
-<a name="l00158"></a>00158 <span class="preprocessor"></span>
-<a name="l00159"></a>00159 <span class="comment">/* Type HAWKI_PROTYPE_BKGIMAGE */</span>
-<a name="l00160"></a>00160 <span class="preprocessor">#define HAWKI_CALPRO_BKGIMAGE                "BKG_IM"</span>
-<a name="l00161"></a>00161 <span class="preprocessor"></span>
-<a name="l00162"></a>00162 <span class="comment">/* Type HAWKI_PROTYPE_BKGBPM */</span>
-<a name="l00163"></a>00163 <span class="preprocessor">#define HAWKI_CALPRO_BKGBPM                  "BKG_BPM"</span>
-<a name="l00164"></a>00164 <span class="preprocessor"></span>
-<a name="l00165"></a>00165 <span class="comment">/* Type HAWKI_PROTYPE_OBJ_PARAM */</span>
-<a name="l00166"></a>00166 <span class="preprocessor">#define HAWKI_CALPRO_OBJ_PARAM               "OBJ_PARAM"</span>
-<a name="l00167"></a>00167 <span class="preprocessor"></span>
-<a name="l00168"></a>00168 <span class="comment">/* Type HAWKI_PROTYPE_OBJ_MASK */</span>
-<a name="l00169"></a>00169 <span class="preprocessor">#define HAWKI_CALPRO_OBJ_MASK                "OBJ_MASK"</span>
-<a name="l00170"></a>00170 <span class="preprocessor"></span>
-<a name="l00171"></a>00171 <span class="comment">/* Type HAWKI_PROTYPE_SCIENCE_PCS */</span>
-<a name="l00172"></a>00172 <span class="preprocessor">#define HAWKI_CALPRO_SCIENCE_PCS             "SCIENCE_PCS"</span>
-<a name="l00173"></a>00173 <span class="preprocessor"></span>
-<a name="l00174"></a>00174 <span class="comment">/* Type HAWKI_PROTYPE_ERRMAP */</span>
-<a name="l00175"></a>00175 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_ERRMAP             "FLAT_ERRMAP"</span>
-<a name="l00176"></a>00176 <span class="preprocessor"></span>
-<a name="l00177"></a>00177 <span class="comment">/* Type HAWKI_PROTYPE_BPM */</span>
-<a name="l00178"></a>00178 <span class="preprocessor">#define HAWKI_CALPRO_BPM                     "BPM"</span>
-<a name="l00179"></a>00179 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_BPM_HOT                 "BPM_HOT"</span>
-<a name="l00180"></a>00180 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_BPM_COLD                "BPM_COLD"</span>
-<a name="l00181"></a>00181 <span class="preprocessor"></span>
-<a name="l00182"></a>00182 <span class="comment">/* Type HAWKI_PROTYPE_FLAT */</span>
-<a name="l00183"></a>00183 <span class="preprocessor">#define HAWKI_CALPRO_FLAT                    "FLAT_IM"</span>
-<a name="l00184"></a>00184 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_FLAT_ERR                "FLAT_ERR"</span>
-<a name="l00185"></a>00185 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_FLAT_RECOMPUTED         "FLAT_RECOMPUTED"</span>
-<a name="l00186"></a>00186 <span class="preprocessor"></span>
-<a name="l00187"></a>00187 <span class="comment">/* Type HAWKI_PROTYPE_DARK */</span>
-<a name="l00188"></a>00188 <span class="preprocessor">#define HAWKI_CALPRO_DARK                    "DARK_IM"</span>
-<a name="l00189"></a>00189 <span class="preprocessor"></span>
-<a name="l00190"></a>00190 <span class="comment">/* Type HAWKI_PROTYPE_DARK_ERR */</span>
-<a name="l00191"></a>00191 <span class="preprocessor">#define HAWKI_CALPRO_DARK_ERR                "DARK_ERR"</span>
-<a name="l00192"></a>00192 <span class="preprocessor"></span>
-<a name="l00193"></a>00193 <span class="comment">/* Type HAWKI_PROTYPE_ILLUM_PHOTOM */</span>
-<a name="l00194"></a>00194 <span class="preprocessor">#define HAWKI_CALPRO_ILLUM_PHOTOM            "ILLUM_PHOTOM"</span>
-<a name="l00195"></a>00195 <span class="preprocessor"></span>
-<a name="l00196"></a>00196 <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS */</span>
-<a name="l00197"></a>00197 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS              "FLAT_STATS"</span>
-<a name="l00198"></a>00198 <span class="preprocessor"></span>
-<a name="l00199"></a>00199 <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_EVEN_COL */</span>
-<a name="l00200"></a>00200 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_EVEN_COL     "FLAT_STATS_EVEN_COL"</span>
-<a name="l00201"></a>00201 <span class="preprocessor"></span>
-<a name="l00202"></a>00202 <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_ODD_COL */</span>
-<a name="l00203"></a>00203 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_ODD_COL      "FLAT_STATS_ODD_COL"</span>
-<a name="l00204"></a>00204 <span class="preprocessor"></span>
-<a name="l00205"></a>00205 <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW */</span>
-<a name="l00206"></a>00206 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_EVEN_ROW     "FLAT_STATS_EVEN_ROW"</span>
-<a name="l00207"></a>00207 <span class="preprocessor"></span>
-<a name="l00208"></a>00208 <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_ODD_ROW */</span>
-<a name="l00209"></a>00209 <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_ODD_ROW      "FLAT_STATS_ODD_ROW"</span>
-<a name="l00210"></a>00210 <span class="preprocessor"></span>
-<a name="l00211"></a>00211 <span class="comment">/* Type HAWKI_PROTYPE_DARK_STATS */</span>
-<a name="l00212"></a>00212 <span class="preprocessor">#define HAWKI_CALPRO_DARK_STATS              "DARK_STATS"</span>
-<a name="l00213"></a>00213 <span class="preprocessor"></span>
-<a name="l00214"></a>00214 <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_STATS */</span>
-<a name="l00215"></a>00215 <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_STATS            "ZPOINT_STATS"</span>
-<a name="l00216"></a>00216 <span class="preprocessor"></span>
-<a name="l00217"></a>00217 <span class="comment">/* Type HAWKI_PROTYPE_JITTER_STATS */</span>
-<a name="l00218"></a>00218 <span class="preprocessor">#define HAWKI_CALPRO_JITTER_STATS            "JITTER_STATS"</span>
-<a name="l00219"></a>00219 <span class="preprocessor"></span>
-<a name="l00220"></a>00220 <span class="comment">/* Type HAWKI_PROTYPE_JITTER_BKG_STATS */</span>
-<a name="l00221"></a>00221 <span class="preprocessor">#define HAWKI_CALPRO_JITTER_BKG_STATS        "BKG_STATS"</span>
-<a name="l00222"></a>00222 <span class="preprocessor"></span>
-<a name="l00223"></a>00223 <span class="comment">/* Type HAWKI_PROTYPE_STDSTARS */</span>
-<a name="l00224"></a>00224 <span class="preprocessor">#define HAWKI_CALPRO_STDSTARS                "STDSTARS_CATS"</span>
-<a name="l00225"></a>00225 <span class="preprocessor"></span>
-<a name="l00226"></a>00226 <span class="comment">/* Type HAWKI_PROTYPE_DISTORTION */</span>
-<a name="l00227"></a>00227 <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION              "DISTORTION"</span>
-<a name="l00228"></a>00228 <span class="preprocessor"></span>
-<a name="l00229"></a>00229 <span class="comment">/* Type HAWKI_PROTYPE_DISTORTION_X */</span>
-<a name="l00230"></a>00230 <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION_X            "DISTORTION_X"</span>
-<a name="l00231"></a>00231 <span class="preprocessor"></span>
-<a name="l00232"></a>00232 <span class="comment">/* Type HAWKI_PROTYPE_DISTORTION_Y */</span>
-<a name="l00233"></a>00233 <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION_Y            "DISTORTION_Y"</span>
-<a name="l00234"></a>00234 <span class="preprocessor"></span>
-<a name="l00235"></a>00235 <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_TAB */</span>
-<a name="l00236"></a>00236 <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_TAB              "ZPOINT_RES"</span>
-<a name="l00237"></a>00237 <span class="preprocessor"></span>
-<a name="l00238"></a>00238 <span class="comment">/* Type HAWKI_PROTYPE_PHOT_TAB */</span>
-<a name="l00239"></a>00239 <span class="preprocessor">#define HAWKI_CALPRO_PHOT_TAB              "PHOT_COEFF"</span>
-<a name="l00240"></a>00240 <span class="preprocessor"></span>
-<a name="l00241"></a>00241 <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_IMA */</span>
-<a name="l00242"></a>00242 <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_IMA              "ZPOINT_IMA"</span>
-<a name="l00243"></a>00243 <span class="preprocessor"></span>
-<a name="l00244"></a>00244 <span class="comment">/* Type HAWKI_PROTYPE_COEFFS */</span>
-<a name="l00245"></a>00245 <span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_LIN             "LINGAIN_LIN"</span>
-<a name="l00246"></a>00246 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_GAIN            "LINGAIN_GAIN"</span>
-<a name="l00247"></a>00247 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_COEFFS          "LINGAIN_COEFFS"</span>
-<a name="l00248"></a>00248 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_BPM             "LINGAIN_BPM"</span>
-<a name="l00249"></a>00249 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_CORR            "LINGAIN_CORR"</span>
-<a name="l00250"></a>00250 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_DIFF            "LINGAIN_DIFF"</span>
-<a name="l00251"></a>00251 <span class="preprocessor"></span>
-<a name="l00252"></a>00252 <span class="comment">/* Type HAWKI_PROTYPE_BETSFOCUS */</span>
-<a name="l00253"></a>00253 <span class="preprocessor">#define HAWKI_CALPRO_BESTFOCUS               "BEST_FOCUS"</span>
-<a name="l00254"></a>00254 <span class="preprocessor"></span>
-<a name="l00255"></a>00255 <span class="comment">/* Type HAWKI_PROTYPE_BASICCALIBRATED */</span>
-<a name="l00256"></a>00256 <span class="preprocessor">#define HAWKI_CALPRO_BASICCALIBRATED         "BASIC_CALIBRATED"</span>
-<a name="l00257"></a>00257 <span class="preprocessor"></span>
-<a name="l00258"></a>00258 <span class="comment">/* Type HAWKI_PROTYPE_SKY_BASICCALIBRATED */</span>
-<a name="l00259"></a>00259 <span class="preprocessor">#define HAWKI_CALPRO_SKY_BASICCALIBRATED     "SKY_BASIC_CALIBRATED"</span>
-<a name="l00260"></a>00260 <span class="preprocessor"></span>
-<a name="l00261"></a>00261 <span class="comment">/* Type HAWKI_PROTYPE_BKG_SUBTRACTED */</span>
-<a name="l00262"></a>00262 <span class="preprocessor">#define HAWKI_CALPRO_BKG_SUBTRACTED          "BKG_SUBTRACTED"</span>
-<a name="l00263"></a>00263 <span class="preprocessor"></span>
-<a name="l00264"></a>00264 <span class="comment">/* Type HAWKI_PROTYPE_FILTERPOSCHECK_STATS */</span>
-<a name="l00265"></a>00265 <span class="preprocessor">#define HAWKI_CALPRO_FILTERPOSCHECK_STATS    "FILTERPOS_CHECK_STATS"</span>
-<a name="l00266"></a>00266 <span class="preprocessor"></span>
-<a name="l00267"></a>00267 <span class="comment">/* Type HAWKI_PROTYPE_OFFSETS */</span>
-<a name="l00268"></a>00268 <span class="preprocessor">#define HAWKI_CALPRO_OFFSETS                 "OFFSETS_REFINED"</span>
-<a name="l00269"></a>00269 <span class="preprocessor"></span>
-<a name="l00270"></a>00270 <span class="comment">/*************************************/</span>
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272 <span class="comment">/*************************************/</span>
-<a name="l00273"></a>00273 <span class="comment">/* DEFINE HERE THE PRO.TYPE KEYWORDS */</span>
-<a name="l00274"></a>00274 <span class="comment">/* Images */</span>
-<a name="l00275"></a>00275 <span class="preprocessor">#define HAWKI_PROTYPE_BPM                      "BPM"</span>
-<a name="l00276"></a>00276 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DARK                     "DARK"</span>
-<a name="l00277"></a>00277 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DARK_ERR                 "DARK_ERR"</span>
-<a name="l00278"></a>00278 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_FLAT                     "FLAT"</span>
-<a name="l00279"></a>00279 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_IMA               "ZPOINT_IMA"</span>
-<a name="l00280"></a>00280 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_COMBINED                 "COMBINED"</span>
-<a name="l00281"></a>00281 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_COMB_CONTRIB_MAP         "COMBINED_CONTRIB_MAP"</span>
-<a name="l00282"></a>00282 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_STITCHED                 "STITCHED"</span>
-<a name="l00283"></a>00283 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ILLUM                    "ILLUM"</span>
-<a name="l00284"></a>00284 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DIST_CORRECTED           "DIST_CORRECTED"</span>
-<a name="l00285"></a>00285 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKGIMAGE                 "BKG_IM"</span>
-<a name="l00286"></a>00286 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKGBPM                   "BKG_BPM"</span>
-<a name="l00287"></a>00287 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ERRMAP                   "ERRMAP"</span>
-<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BESTFOCUS                "BEST_FOCUS"</span>
-<a name="l00289"></a>00289 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BASICCALIBRATED          "BASIC_CALIBRATED"</span>
-<a name="l00290"></a>00290 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_SKY_BASICCALIBRATED      "SKY_BASIC_CALIBRATED"</span>
-<a name="l00291"></a>00291 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKG_SUBTRACTED           "BKG_SUBTRACTED"</span>
-<a name="l00292"></a>00292 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_OBJ_MASK                 "OBJ_MASK"</span>
-<a name="l00293"></a>00293 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION_X             "DISTORTION_X"</span>
-<a name="l00294"></a>00294 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION_Y             "DISTORTION_Y"</span>
-<a name="l00295"></a>00295 <span class="preprocessor"></span>
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297 <span class="comment">/* Tables */</span>
-<a name="l00298"></a>00298 <span class="comment">/* Col: HAWKI_COL_OBJ_POSX */</span>
-<a name="l00299"></a>00299 <span class="comment">/*      HAWKI_COL_OBJ_POSY */</span>
-<a name="l00300"></a>00300 <span class="comment">/*      HAWKI_COL_OBJ_FWHMX */</span>
-<a name="l00301"></a>00301 <span class="comment">/*      HAWKI_COL_OBJ_FWHMY */</span>
-<a name="l00302"></a>00302 <span class="comment">/*      HAWKI_COL_OBJ_ANGLE */</span>
-<a name="l00303"></a>00303 <span class="comment">/*      HAWKI_COL_OBJ_FLUX */</span>
-<a name="l00304"></a>00304 <span class="preprocessor">#define HAWKI_PROTYPE_OBJ_PARAM                "OBJ_PARAM"</span>
-<a name="l00305"></a>00305 <span class="preprocessor"></span>
-<a name="l00306"></a>00306 <span class="comment">/* Col: HAWKI_COL_ILLUM_POSX */</span>
-<a name="l00307"></a>00307 <span class="comment">/*      HAWKI_COL_ILLUM_POSY */</span>
-<a name="l00308"></a>00308 <span class="comment">/*      HAWKI_COL_ILLUM_FLUX */</span>
-<a name="l00309"></a>00309 <span class="preprocessor">#define HAWKI_PROTYPE_ILLUM_PHOTOM             "ILLUM_PHOTOM"</span>
-<a name="l00310"></a>00310 <span class="preprocessor"></span>
-<a name="l00311"></a>00311 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00312"></a>00312 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00313"></a>00313 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00314"></a>00314 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00315"></a>00315 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00316"></a>00316 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00317"></a>00317 <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS               "FLAT_STATS"</span>
-<a name="l00318"></a>00318 <span class="preprocessor"></span>
-<a name="l00319"></a>00319 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00320"></a>00320 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00321"></a>00321 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00322"></a>00322 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00323"></a>00323 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00324"></a>00324 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00325"></a>00325 <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_EVEN_COL      "FLAT_STATS_EVEN_COL"</span>
-<a name="l00326"></a>00326 <span class="preprocessor"></span>
-<a name="l00327"></a>00327 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00328"></a>00328 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00329"></a>00329 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00330"></a>00330 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00331"></a>00331 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00332"></a>00332 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00333"></a>00333 <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_ODD_COL       "FLAT_STATS_ODD_COL"</span>
-<a name="l00334"></a>00334 <span class="preprocessor"></span>
-<a name="l00335"></a>00335 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00336"></a>00336 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00337"></a>00337 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00338"></a>00338 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00339"></a>00339 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00340"></a>00340 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00341"></a>00341 <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW      "FLAT_STATS_EVEN_ROW"</span>
-<a name="l00342"></a>00342 <span class="preprocessor"></span>
-<a name="l00343"></a>00343 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00344"></a>00344 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00345"></a>00345 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00346"></a>00346 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00347"></a>00347 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00348"></a>00348 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00349"></a>00349 <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_ODD_ROW       "FLAT_STATS_ODD_ROW"</span>
-<a name="l00350"></a>00350 <span class="preprocessor"></span>
-<a name="l00351"></a>00351 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00352"></a>00352 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00353"></a>00353 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00354"></a>00354 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00355"></a>00355 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00356"></a>00356 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00357"></a>00357 <span class="preprocessor">#define HAWKI_PROTYPE_DARK_STATS               "DARK_STATS"</span>
-<a name="l00358"></a>00358 <span class="preprocessor"></span>
-<a name="l00359"></a>00359 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00360"></a>00360 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00361"></a>00361 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00362"></a>00362 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00363"></a>00363 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00364"></a>00364 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00365"></a>00365 <span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_STATS             "ZPOINT_STATS"</span>
-<a name="l00366"></a>00366 <span class="preprocessor"></span>
-<a name="l00367"></a>00367 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00368"></a>00368 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00369"></a>00369 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00370"></a>00370 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00371"></a>00371 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00372"></a>00372 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00373"></a>00373 <span class="preprocessor">#define HAWKI_PROTYPE_JITTER_STATS             "JITTER_STATS"</span>
-<a name="l00374"></a>00374 <span class="preprocessor"></span>
-<a name="l00375"></a>00375 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00376"></a>00376 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00377"></a>00377 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00378"></a>00378 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00379"></a>00379 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00380"></a>00380 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00381"></a>00381 <span class="preprocessor">#define HAWKI_PROTYPE_JITTER_BKG_STATS         "BKG_STATS"</span>
-<a name="l00382"></a>00382 <span class="preprocessor"></span>
-<a name="l00383"></a>00383 <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span>
-<a name="l00384"></a>00384 <span class="comment">/*      HAWKI_COL_STAT_MAX */</span>
-<a name="l00385"></a>00385 <span class="comment">/*      HAWKI_COL_STAT_MED */</span>
-<a name="l00386"></a>00386 <span class="comment">/*      HAWKI_COL_STAT_RMS */</span>
-<a name="l00387"></a>00387 <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span>
-<a name="l00388"></a>00388 <span class="comment">/*      HAWKI_COL_STAT_USED */</span>
-<a name="l00389"></a>00389 <span class="preprocessor">#define HAWKI_PROTYPE_FILTERPOSCHECK_STATS     "FILTERPOS_CHECK_STATS"</span>
-<a name="l00390"></a>00390 <span class="preprocessor"></span>
-<a name="l00391"></a>00391 <span class="comment">/* Col: IRPLIB_STDSTAR_STAR_COL */</span>
-<a name="l00392"></a>00392 <span class="comment">/*      IRPLIB_STDSTAR_TYPE_COL */</span>
-<a name="l00393"></a>00393 <span class="comment">/*      IRPLIB_STDSTAR_RA_COL */</span>
-<a name="l00394"></a>00394 <span class="comment">/*      IRPLIB_STDSTAR_DEC_COL */</span>
-<a name="l00395"></a>00395 <span class="comment">/*      Filters .... */</span>
-<a name="l00396"></a>00396 <span class="preprocessor">#define HAWKI_PROTYPE_STDSTARS                 "STDSTARS"</span>
-<a name="l00397"></a>00397 <span class="preprocessor"></span>
-<a name="l00398"></a>00398 <span class="comment">/* Col: HAWKI_COL_DIST_DXGC */</span>
-<a name="l00399"></a>00399 <span class="comment">/*      HAWKI_COL_DIST_DYGC */</span>
-<a name="l00400"></a>00400 <span class="comment">/*      HAWKI_COL_DIST_I */</span>
-<a name="l00401"></a>00401 <span class="comment">/*      HAWKI_COL_DIST_J */</span>
-<a name="l00402"></a>00402 <span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION               "DISTORTION"</span>
-<a name="l00403"></a>00403 <span class="preprocessor"></span>
-<a name="l00404"></a>00404 <span class="comment">/* Col: HAWKI_COL_ZPOINT_CHIP */</span>
-<a name="l00405"></a>00405 <span class="comment">/*      HAWKI_COL_ZPOINT_POSX */</span>
-<a name="l00406"></a>00406 <span class="comment">/*      HAWKI_COL_ZPOINT_POSY */</span>
-<a name="l00407"></a>00407 <span class="comment">/*      HAWKI_COL_ZPOINT_ZPOINT */</span>
-<a name="l00408"></a>00408 <span class="comment">/*      HAWKI_COL_ZPOINT_ATX0 */</span>
-<a name="l00409"></a>00409 <span class="comment">/*      HAWKI_COL_ZPOINT_FLUX */</span>
-<a name="l00410"></a>00410 <span class="comment">/*      HAWKI_COL_ZPOINT_PEAK */</span>
-<a name="l00411"></a>00411 <span class="comment">/*      HAWKI_COL_ZPOINT_BGD */</span>
-<a name="l00412"></a>00412 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMX */</span>
-<a name="l00413"></a>00413 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMY */</span>
-<a name="l00414"></a>00414 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHM */</span>
-<a name="l00415"></a>00415 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMX_AS */</span>
-<a name="l00416"></a>00416 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMY_AS */</span>
-<a name="l00417"></a>00417 <span class="comment">/*      HAWKI_COL_ZPOINT_FWHM_AS */</span>
-<a name="l00418"></a>00418 <span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_TAB               "ZPOINT_TAB"</span>
-<a name="l00419"></a>00419 <span class="preprocessor"></span>
-<a name="l00420"></a>00420 <span class="comment">/* Col: HAWKI_COL_PHOT_FILTER */</span>
-<a name="l00421"></a>00421 <span class="comment">/*      HAWKI_COL_PHOT_EXTCOEFF  */</span>
-<a name="l00422"></a>00422 <span class="comment">/*      HAWKI_COL_PHOT_DEXTCOEFF  */</span>
-<a name="l00423"></a>00423 <span class="comment">/*      HAWKI_COL_PHOT_ZEROPOINT   */</span>
-<a name="l00424"></a>00424 <span class="comment">/*      HAWKI_COL_PHOT_DZEROPOINT    */</span>
-<a name="l00425"></a>00425 <span class="comment">/*      HAWKI_COL_PHOT_COLORTERM    */</span>
-<a name="l00426"></a>00426 <span class="comment">/*      HAWKI_COL_PHOT_DCOLORTERM  */</span>
-<a name="l00427"></a>00427 <span class="preprocessor">#define HAWKI_PROTYPE_PHOT_TAB                 "PHOT_COEFF"</span>
-<a name="l00428"></a>00428 <span class="preprocessor"></span>
-<a name="l00429"></a>00429 <span class="comment">/* Col: HAWKI_COL_RAW_JITTER_QC_TEL_ALT */</span>
-<a name="l00430"></a>00430 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AZ  */</span>
-<a name="l00431"></a>00431 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM */</span>
-<a name="l00432"></a>00432 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0 */</span>
-<a name="l00433"></a>00433 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP */</span>
-<a name="l00434"></a>00434 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR */</span>
-<a name="l00435"></a>00435 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP */</span>
-<a name="l00436"></a>00436 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM  */</span>
-<a name="l00437"></a>00437 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START  */</span>
-<a name="l00438"></a>00438 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END */</span>
-<a name="l00439"></a>00439 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA */</span>
-<a name="l00440"></a>00440 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START */</span>
-<a name="l00441"></a>00441 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END */</span>
-<a name="l00442"></a>00442 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM */</span>
-<a name="l00443"></a>00443 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START */</span>
-<a name="l00444"></a>00444 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END */</span>
-<a name="l00445"></a>00445 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM */</span>
-<a name="l00446"></a>00446 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START */</span>
-<a name="l00447"></a>00447 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END */</span>
-<a name="l00448"></a>00448 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES */</span>
-<a name="l00449"></a>00449 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START */</span>
-<a name="l00450"></a>00450 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END */</span>
-<a name="l00451"></a>00451 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG */</span>
-<a name="l00452"></a>00452 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA */</span>
-<a name="l00453"></a>00453 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA */</span>
-<a name="l00454"></a>00454 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD */</span>
-<a name="l00455"></a>00455 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX */</span>
-<a name="l00456"></a>00456 <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY */</span>
-<a name="l00457"></a>00457 <span class="preprocessor">#define HAWKI_PROTYPE_SCIENCE_PCS              "SCIENCE_PCS"</span>
-<a name="l00458"></a>00458 <span class="preprocessor"></span>
-<a name="l00459"></a>00459 <span class="comment">/*      HAWKI_COL_OFFSET_X */</span>
-<a name="l00460"></a>00460 <span class="comment">/*      HAWKI_COL_OFFSET_Y */</span>
-<a name="l00461"></a>00461 <span class="comment">/*      HAWKI_COL_CORRELATION */</span>
-<a name="l00462"></a>00462 <span class="preprocessor">#define HAWKI_PROTYPE_OFFSETS                  "OFFSETS_REFINED"</span>
-<a name="l00463"></a>00463 <span class="preprocessor"></span>
-<a name="l00464"></a>00464 <span class="comment">/* TODO: This is to be deprecated */</span>
-<a name="l00465"></a>00465 <span class="preprocessor">#define HAWKI_PROTYPE_COEFFS                   "COEFFS"</span>
-<a name="l00466"></a>00466 <span class="preprocessor"></span>
-<a name="l00467"></a>00467 <span class="preprocessor">#define HAWKI_PROTYPE_LIN_STATS                "LIN_STATS"</span>
-<a name="l00468"></a>00468 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LIN_COEFFS               "LIN_COEFFS"</span>
-<a name="l00469"></a>00469 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_GAIN_STATS               "GAIN_STATS"</span>
-<a name="l00470"></a>00470 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BPM_LEVELS               "BPM_LEVELS"</span>
-<a name="l00471"></a>00471 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LINGAIN_CORR             "LINGAIN_CORR"</span>
-<a name="l00472"></a>00472 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LINGAIN_DIFF             "LINGAIN_DIFF"</span>
-<a name="l00473"></a>00473 <span class="preprocessor"></span>
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476 <span class="comment">/************************************/</span>
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478 <span class="comment">/************************************/</span>
-<a name="l00479"></a>00479 <span class="comment">/* Define here the DO.CATG keywords */</span>
-<a name="l00480"></a>00480 <span class="preprocessor">#define HAWKI_COMMAND_LINE          "COMMAND_LINE"</span>
-<a name="l00481"></a>00481 <span class="preprocessor"></span>
-<a name="l00482"></a>00482 <span class="preprocessor">#define HAWKI_CAL_DARK_RAW          "DARK"</span>
-<a name="l00483"></a>00483 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_TEC_FLAT_RAW          "TEC_FLAT"</span>
-<a name="l00484"></a>00484 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_FLAT_RAW          "FLAT"</span>
-<a name="l00485"></a>00485 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_FOCUS_RAW         "FOCUS"</span>
-<a name="l00486"></a>00486 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_ZPOINT_RAW        "ZPOINT"</span>
-<a name="l00487"></a>00487 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_ILLUM_RAW         "TEC_STD"</span>
-<a name="l00488"></a>00488 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMG_JITTER_RAW        "JITTER_OBS"</span>
-<a name="l00489"></a>00489 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMG_JITTER_SKY_RAW    "JITTER_SKY"</span>
-<a name="l00490"></a>00490 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_LINGAIN_LAMP_RAW  "DETLIN_LAMP"</span>
-<a name="l00491"></a>00491 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_LINGAIN_DARK_RAW  "DETLIN_DARK"</span>
-<a name="l00492"></a>00492 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_DISTOR_RAW        "DISTOR_OBS"</span>
-<a name="l00493"></a>00493 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_DISTOR_SKY_RAW    "DISTOR_SKY"</span>
-<a name="l00494"></a>00494 <span class="preprocessor"></span>
-<a name="l00495"></a>00495 <span class="preprocessor">#define HAWKI_UTIL_STDSTARS_RAW     "STDSTAR_CAT"</span>
-<a name="l00496"></a>00496 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_UTIL_DISTMAP_RAW      "DIST_MAP"</span>
-<a name="l00497"></a>00497 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_UTIL_CAT_2MASS        "CAT_2MASS"</span>
-<a name="l00498"></a>00498 <span class="preprocessor"></span><span class="comment">/************************************/</span>
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00501"></a>00501 <span class="comment">                                Functions prototypes</span>
-<a name="l00502"></a>00502 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00503"></a>00503 CPL_BEGIN_DECLS
-<a name="l00504"></a>00504 <span class="keywordtype">int</span> <a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(cpl_frameset *) ;
-<a name="l00505"></a>00505 CPL_END_DECLS
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_dfs.h,v 1.57 2012/12/05 14:56:34 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/05 14:56:34 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.57 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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 HAWKI_DFS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment">                                Define</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="comment">/******************************************/</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="comment">/* DEFINE HERE THE DIFFERENT COLUMN NAMES */</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="comment">/******************************************/</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_ALT               "TEL_ALT"</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AZ                "TEL_AZ"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM         "TEL_AMBI_RHUM"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0         "TEL_AMBI_TAU0"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP         "TEL_AMBI_TEMP"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR      "TEL_AMBI_WINDDIR"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP       "TEL_AMBI_WINDSP"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM           "TEL_IA_FWHM"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START      "ADA_ABSROT_START"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END        "ADA_ABSROT_END"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA      "ADA_ABSROT_DELTA"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START        "TEL_AIRM_START"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END          "TEL_AIRM_END"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AIRM              "TEL_AIRM"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START   "TEL_AMBI_FWHM_START"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END     "TEL_AMBI_FWHM_END"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM         "TEL_AMBI_FWHM"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START   "TEL_AMBI_PRES_START"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END     "TEL_AMBI_PRES_END"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES         "TEL_AMBI_PRES"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START      "TEL_PARANG_START"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END        "TEL_PARANG_END"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG            "TEL_PARANG"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA      "TEL_PARANG_DELTA"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA        "SEQ_CUMOFFSETA"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD        "SEQ_CUMOFFSETD"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX        "SEQ_CUMOFFSETX"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY        "SEQ_CUMOFFSETY"</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">#define HAWKI_COL_STAT_MIN     "MINIMUM"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MAX     "MAXIMUM"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MED     "MEDIAN"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_MEAN    "MEAN"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_RMS     "RMS"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_STAT_USED    "USED"</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">#define HAWKI_COL_ZPOINT_MAG          "MAG"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_STARNAME     "STARNAME"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_CHIP         "CHIP"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ERRMAG       "MAG_ERR"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FILTER       "FILTER"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_AIRMASS      "AIRMASS"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_POSX         "POSX"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_POSY         "POSY"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ZPOINT       "ZPOINT"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ZPOINT_ERR   "ZPOINT_ERR"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_ATX0         "ATX0"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FLUX         "FLUX"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FLUX_ERR     "FLUX_ERR"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_INSTRMAG     "INSTRMAG"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_INSTRMAG_ERR "INSTRMAG_ERR"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_PEAK         "PEAK"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_BGD          "BGD"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMX        "FWHMX"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMY        "FWHMY"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHM         "FWHM"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMX_AS     "FWHMX_AS"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHMY_AS     "FWHMY_AS"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_FWHM_AS      "FWHM_AS"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ZPOINT_STARMAG      "STAR_CAT_MAG"</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 HAWKI_COL_PHOT_FILTER       "FILTER"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_EXTCOEFF     "EXT"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DEXTCOEFF    "DEXT"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_ZEROPOINT    "ZPOINT"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DZEROPOINT   "DZPOINT"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_COLORTERM    "COL"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_PHOT_DCOLORTERM   "DCOL"</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">#define HAWKI_COL_OBJ_POSX          "POS_X"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_POSY          "POS_Y"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FWHM_MAJAX    "FWHM_MAJAX"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FWHM_MINAX    "FWHM_MINAX"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_ELLIP         "ELLIP"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_ANGLE         "ANGLE"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OBJ_FLUX          "FLUX"</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">#define HAWKI_COL_ILLUM_POSX        "POSX"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ILLUM_POSY        "POSY"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_ILLUM_FLUX        "FLUX"</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="preprocessor">#define HAWKI_COL_DIST_DXGC         "DXGC"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_DYGC         "DYGC"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_I            "I"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_DIST_J            "J"</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">#define HAWKI_COL_OFFSET_X          "X_OFFSET"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_OFFSET_Y          "Y_OFFSET"</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_CORRELATION       "CORRELATION"</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="preprocessor">#define HAWKI_COL_2MASS_RA          "RA"</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_DEC         "Dec"</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_J_MAG       "j_m"</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_J_MAGSIG    "j_msig"</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_H_MAG       "h_m"</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_H_MAGSIG    "h_msig"</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_K_MAG       "k_m"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_K_MAGSIG    "k_msig"</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_XPREDICT    "xpredict"</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_COL_2MASS_YPREDICT    "ypredict"</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> <span class="preprocessor">#define HAWKI_COL_MATCHING_SETS     "MATCHING_SETS"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor"></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">/* DEFINE HERE THE PRO.CATG KEYWORDS */</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="comment">/* Type HAWKI_PROTYPE_COMBINED */</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">#define HAWKI_CALPRO_COMBINED                "COMBINED"</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="comment">/* Type HAWKI_PROTYPE_COMB_CONTRIB_MAP */</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">#define HAWKI_CALPRO_COMB_CONTRIB_MAP        "COMBINED_CONTRIB_MAP"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">/* Type HAWKI_PROTYPE_STITCHED */</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">#define HAWKI_CALPRO_STITCHED                "STITCHED"</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="comment">/* Type HAWKI_PROTYPE_DIST_CORRECTED */</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">#define HAWKI_CALPRO_DIST_CORRECTED          "DIST_CORRECTED"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">/* Type HAWKI_PROTYPE_ILLUM */</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">#define HAWKI_CALPRO_ILLUM                   "ILLUM"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">/* Type HAWKI_PROTYPE_BKGIMAGE */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">#define HAWKI_CALPRO_BKGIMAGE                "BKG_IM"</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> <span class="comment">/* Type HAWKI_PROTYPE_BKGBPM */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">#define HAWKI_CALPRO_BKGBPM                  "BKG_BPM"</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">/* Type HAWKI_PROTYPE_OBJ_PARAM */</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">#define HAWKI_CALPRO_OBJ_PARAM               "OBJ_PARAM"</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">/* Type HAWKI_PROTYPE_OBJ_MASK */</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">#define HAWKI_CALPRO_OBJ_MASK                "OBJ_MASK"</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="comment">/* Type HAWKI_PROTYPE_SCIENCE_PCS */</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">#define HAWKI_CALPRO_SCIENCE_PCS             "SCIENCE_PCS"</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="comment">/* Type HAWKI_PROTYPE_ERRMAP */</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_ERRMAP             "FLAT_ERRMAP"</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="comment">/* Type HAWKI_PROTYPE_BPM */</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">#define HAWKI_CALPRO_BPM                     "BPM"</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_BPM_HOT                 "BPM_HOT"</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_BPM_COLD                "BPM_COLD"</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> <span class="comment">/* Type HAWKI_PROTYPE_FLAT */</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT                    "FLAT_IM"</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_FLAT_ERR                "FLAT_ERR"</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_FLAT_RECOMPUTED         "FLAT_RECOMPUTED"</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">/* Type HAWKI_PROTYPE_DARK */</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor">#define HAWKI_CALPRO_DARK                    "DARK_IM"</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">/* Type HAWKI_PROTYPE_DARK_ERR */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">#define HAWKI_CALPRO_DARK_ERR                "DARK_ERR"</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">/* Type HAWKI_PROTYPE_ILLUM_PHOTOM */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="preprocessor">#define HAWKI_CALPRO_ILLUM_PHOTOM            "ILLUM_PHOTOM"</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS */</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS              "FLAT_STATS"</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="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_EVEN_COL */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_EVEN_COL     "FLAT_STATS_EVEN_COL"</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="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_ODD_COL */</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_ODD_COL      "FLAT_STATS_ODD_COL"</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW */</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_EVEN_ROW     "FLAT_STATS_EVEN_ROW"</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">/* Type HAWKI_PROTYPE_FLAT_STATS_ODD_ROW */</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="preprocessor">#define HAWKI_CALPRO_FLAT_STATS_ODD_ROW      "FLAT_STATS_ODD_ROW"</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">/* Type HAWKI_PROTYPE_DARK_STATS */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="preprocessor">#define HAWKI_CALPRO_DARK_STATS              "DARK_STATS"</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_STATS */</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_STATS            "ZPOINT_STATS"</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">/* Type HAWKI_PROTYPE_JITTER_STATS */</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="preprocessor">#define HAWKI_CALPRO_JITTER_STATS            "JITTER_STATS"</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> <span class="comment">/* Type HAWKI_PROTYPE_JITTER_BKG_STATS */</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="preprocessor">#define HAWKI_CALPRO_JITTER_BKG_STATS        "BKG_STATS"</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="comment">/* Type HAWKI_PROTYPE_STDSTARS */</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="preprocessor">#define HAWKI_CALPRO_STDSTARS                "STDSTARS_CATS"</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="comment">/* Type HAWKI_PROTYPE_DISTORTION */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION              "DISTORTION"</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">/* Type HAWKI_PROTYPE_DISTORTION_X */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION_X            "DISTORTION_X"</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="comment">/* Type HAWKI_PROTYPE_DISTORTION_Y */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="preprocessor">#define HAWKI_CALPRO_DISTORTION_Y            "DISTORTION_Y"</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_TAB */</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_TAB              "ZPOINT_RES"</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment">/* Type HAWKI_PROTYPE_PHOT_TAB */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="preprocessor">#define HAWKI_CALPRO_PHOT_TAB              "PHOT_COEFF"</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">/* Type HAWKI_PROTYPE_ZPOINT_IMA */</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="preprocessor">#define HAWKI_CALPRO_ZPOINT_IMA              "ZPOINT_IMA"</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> <span class="comment">/* Type HAWKI_PROTYPE_COEFFS */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_LIN             "LINGAIN_LIN"</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_GAIN            "LINGAIN_GAIN"</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_COEFFS          "LINGAIN_COEFFS"</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_BPM             "LINGAIN_BPM"</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_CORR            "LINGAIN_CORR"</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CALPRO_LINGAIN_DIFF            "LINGAIN_DIFF"</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="comment">/* Type HAWKI_PROTYPE_BETSFOCUS */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <span class="preprocessor">#define HAWKI_CALPRO_BESTFOCUS               "BEST_FOCUS"</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">/* Type HAWKI_PROTYPE_BASICCALIBRATED */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="preprocessor">#define HAWKI_CALPRO_BASICCALIBRATED         "BASIC_CALIBRATED"</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment">/* Type HAWKI_PROTYPE_SKY_BASICCALIBRATED */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="preprocessor">#define HAWKI_CALPRO_SKY_BASICCALIBRATED     "SKY_BASIC_CALIBRATED"</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> <span class="comment">/* Type HAWKI_PROTYPE_BKG_SUBTRACTED */</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="preprocessor">#define HAWKI_CALPRO_BKG_SUBTRACTED          "BKG_SUBTRACTED"</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">/* Type HAWKI_PROTYPE_FILTERPOSCHECK_STATS */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> <span class="preprocessor">#define HAWKI_CALPRO_FILTERPOSCHECK_STATS    "FILTERPOS_CHECK_STATS"</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment">/* Type HAWKI_PROTYPE_OFFSETS */</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <span class="preprocessor">#define HAWKI_CALPRO_OFFSETS                 "OFFSETS_REFINED"</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="preprocessor"></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="comment">/*************************************/</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="comment">/* DEFINE HERE THE PRO.TYPE KEYWORDS */</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="comment">/* Images */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="preprocessor">#define HAWKI_PROTYPE_BPM                      "BPM"</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DARK                     "DARK"</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DARK_ERR                 "DARK_ERR"</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_FLAT                     "FLAT"</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_IMA               "ZPOINT_IMA"</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_COMBINED                 "COMBINED"</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_COMB_CONTRIB_MAP         "COMBINED_CONTRIB_MAP"</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_STITCHED                 "STITCHED"</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ILLUM                    "ILLUM"</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DIST_CORRECTED           "DIST_CORRECTED"</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKGIMAGE                 "BKG_IM"</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKGBPM                   "BKG_BPM"</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_ERRMAP                   "ERRMAP"</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BESTFOCUS                "BEST_FOCUS"</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BASICCALIBRATED          "BASIC_CALIBRATED"</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_SKY_BASICCALIBRATED      "SKY_BASIC_CALIBRATED"</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BKG_SUBTRACTED           "BKG_SUBTRACTED"</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_OBJ_MASK                 "OBJ_MASK"</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION_X             "DISTORTION_X"</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION_Y             "DISTORTION_Y"</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> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <span class="comment">/* Tables */</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> <span class="comment">/* Col: HAWKI_COL_OBJ_POSX */</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="comment">/*      HAWKI_COL_OBJ_POSY */</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="comment">/*      HAWKI_COL_OBJ_FWHMX */</span></div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> <span class="comment">/*      HAWKI_COL_OBJ_FWHMY */</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="comment">/*      HAWKI_COL_OBJ_ANGLE */</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment">/*      HAWKI_COL_OBJ_FLUX */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="preprocessor">#define HAWKI_PROTYPE_OBJ_PARAM                "OBJ_PARAM"</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">/* Col: HAWKI_COL_ILLUM_POSX */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">/*      HAWKI_COL_ILLUM_POSY */</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="comment">/*      HAWKI_COL_ILLUM_FLUX */</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="preprocessor">#define HAWKI_PROTYPE_ILLUM_PHOTOM             "ILLUM_PHOTOM"</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="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS               "FLAT_STATS"</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> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_EVEN_COL      "FLAT_STATS_EVEN_COL"</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_ODD_COL       "FLAT_STATS_ODD_COL"</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_EVEN_ROW      "FLAT_STATS_EVEN_ROW"</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="preprocessor">#define HAWKI_PROTYPE_FLAT_STATS_ODD_ROW       "FLAT_STATS_ODD_ROW"</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="preprocessor">#define HAWKI_PROTYPE_DARK_STATS               "DARK_STATS"</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> <span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_STATS             "ZPOINT_STATS"</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="preprocessor">#define HAWKI_PROTYPE_JITTER_STATS             "JITTER_STATS"</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="preprocessor">#define HAWKI_PROTYPE_JITTER_BKG_STATS         "BKG_STATS"</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> <span class="comment">/* Col: HAWKI_COL_STAT_MIN */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment">/*      HAWKI_COL_STAT_MAX */</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment">/*      HAWKI_COL_STAT_MED */</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">/*      HAWKI_COL_STAT_RMS */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">/*      HAWKI_COL_STAT_MEAN */</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">/*      HAWKI_COL_STAT_USED */</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="preprocessor">#define HAWKI_PROTYPE_FILTERPOSCHECK_STATS     "FILTERPOS_CHECK_STATS"</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> <span class="comment">/* Col: IRPLIB_STDSTAR_STAR_COL */</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">/*      IRPLIB_STDSTAR_TYPE_COL */</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment">/*      IRPLIB_STDSTAR_RA_COL */</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment">/*      IRPLIB_STDSTAR_DEC_COL */</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">/*      Filters .... */</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="preprocessor">#define HAWKI_PROTYPE_STDSTARS                 "STDSTARS"</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">/* Col: HAWKI_COL_DIST_DXGC */</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">/*      HAWKI_COL_DIST_DYGC */</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">/*      HAWKI_COL_DIST_I */</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">/*      HAWKI_COL_DIST_J */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="preprocessor">#define HAWKI_PROTYPE_DISTORTION               "DISTORTION"</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">/* Col: HAWKI_COL_ZPOINT_CHIP */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">/*      HAWKI_COL_ZPOINT_POSX */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> <span class="comment">/*      HAWKI_COL_ZPOINT_POSY */</span></div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> <span class="comment">/*      HAWKI_COL_ZPOINT_ZPOINT */</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> <span class="comment">/*      HAWKI_COL_ZPOINT_ATX0 */</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FLUX */</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="comment">/*      HAWKI_COL_ZPOINT_PEAK */</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="comment">/*      HAWKI_COL_ZPOINT_BGD */</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMX */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMY */</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHM */</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMX_AS */</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHMY_AS */</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">/*      HAWKI_COL_ZPOINT_FWHM_AS */</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="preprocessor">#define HAWKI_PROTYPE_ZPOINT_TAB               "ZPOINT_TAB"</span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> <span class="comment">/* Col: HAWKI_COL_PHOT_FILTER */</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment">/*      HAWKI_COL_PHOT_EXTCOEFF  */</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">/*      HAWKI_COL_PHOT_DEXTCOEFF  */</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="comment">/*      HAWKI_COL_PHOT_ZEROPOINT   */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> <span class="comment">/*      HAWKI_COL_PHOT_DZEROPOINT    */</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> <span class="comment">/*      HAWKI_COL_PHOT_COLORTERM    */</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> <span class="comment">/*      HAWKI_COL_PHOT_DCOLORTERM  */</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> <span class="preprocessor">#define HAWKI_PROTYPE_PHOT_TAB                 "PHOT_COEFF"</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> <span class="comment">/* Col: HAWKI_COL_RAW_JITTER_QC_TEL_ALT */</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AZ  */</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM */</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0 */</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP */</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR */</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM  */</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START  */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END */</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA */</span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START */</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END */</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AIRM */</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START */</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END */</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START */</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END */</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START */</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END */</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG */</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA */</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA */</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD */</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX */</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> <span class="comment">/*      HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY */</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="preprocessor">#define HAWKI_PROTYPE_SCIENCE_PCS              "SCIENCE_PCS"</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="comment">/*      HAWKI_COL_OFFSET_X */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> <span class="comment">/*      HAWKI_COL_OFFSET_Y */</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> <span class="comment">/*      HAWKI_COL_CORRELATION */</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> <span class="preprocessor">#define HAWKI_PROTYPE_OFFSETS                  "OFFSETS_REFINED"</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> <span class="comment">/* TODO: This is to be deprecated */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="preprocessor">#define HAWKI_PROTYPE_COEFFS                   "COEFFS"</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> <span class="preprocessor">#define HAWKI_PROTYPE_LIN_STATS                "LIN_STATS"</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LIN_COEFFS               "LIN_COEFFS"</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_GAIN_STATS               "GAIN_STATS"</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_BPM_LEVELS               "BPM_LEVELS"</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LINGAIN_CORR             "LINGAIN_CORR"</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROTYPE_LINGAIN_DIFF             "LINGAIN_DIFF"</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> <span class="preprocessor"></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="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">/* Define here the DO.CATG keywords */</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> <span class="preprocessor">#define HAWKI_COMMAND_LINE          "COMMAND_LINE"</span></div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> <span class="preprocessor">#define HAWKI_CAL_DARK_RAW          "DARK"</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_TEC_FLAT_RAW          "TEC_FLAT"</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_FLAT_RAW          "FLAT"</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_FOCUS_RAW         "FOCUS"</span></div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_ZPOINT_RAW        "ZPOINT"</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_ILLUM_RAW         "TEC_STD"</span></div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMG_JITTER_RAW        "JITTER_OBS"</span></div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMG_JITTER_SKY_RAW    "JITTER_SKY"</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_LINGAIN_LAMP_RAW  "DETLIN_LAMP"</span></div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_LINGAIN_DARK_RAW  "DETLIN_DARK"</span></div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_DISTOR_RAW        "DISTOR_OBS"</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_CAL_DISTOR_SKY_RAW    "DISTOR_SKY"</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="preprocessor">#define HAWKI_UTIL_STDSTARS_RAW     "STDSTAR_CAT"</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_UTIL_DISTMAP_RAW      "DIST_MAP"</span></div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_UTIL_CAT_2MASS        "CAT_2MASS"</span></div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> <span class="preprocessor"></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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> <span class="comment">                                Functions prototypes</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(cpl_frameset *) ;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> CPL_END_DECLS</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="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/hawki__distortion_8c_source.html b/html/hawki__distortion_8c_source.html
index cac0a24..d60be56 100644
--- a/html/hawki__distortion_8c_source.html
+++ b/html/hawki__distortion_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_distortion.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,1071 +40,1072 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_distortion.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_distortion.c,v 1.32 2011/02/23 11:49:37 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/02/23 11:49:37 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.32 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">//Minimization algorithm hard-coded constants</span>
-<a name="l00033"></a>00033 <span class="preprocessor">#define HAWKI_DISTORTION_MAX_ITER 10000</span>
-<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_TOLERANCE 0.001</span>
-<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_MAX_ITER2 100000</span>
-<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_TOLERANCE2 0.0001</span>
-<a name="l00037"></a>00037 <span class="preprocessor"></span>
-<a name="l00038"></a>00038 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00039"></a>00039 <span class="comment">                                   Includes</span>
-<a name="l00040"></a>00040 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include <math.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <cxdeque.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#ifdef HAVE_LIBGSL</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#include <gsl/gsl_multimin.h></span>
-<a name="l00047"></a>00047 <span class="preprocessor">#endif</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00060"></a>00060 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00061"></a>00061 
-<a name="l00069"></a><a class="code" href="struct__hawki__distortion__obj__function__args__.html">00069</a> <span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a>
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071     <span class="keyword">const</span> cpl_table   ** ref_catalogues;
-<a name="l00072"></a>00072     <span class="keyword">const</span> cpl_table    * matching_sets;
-<a name="l00073"></a>00073     cpl_bivector       * offsets;
-<a name="l00074"></a>00074     hawki_distortion   * distortion;
-<a name="l00075"></a>00075     <span class="keywordtype">int</span>                  ncats;
-<a name="l00076"></a>00076 };
-<a name="l00077"></a>00077     
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="comment">//Private functions</span>
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l00082"></a>00082 (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00083"></a>00083  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00084"></a>00084  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00085"></a>00085  <span class="keywordtype">double</span>                 * x_dist, 
-<a name="l00086"></a>00086  <span class="keywordtype">double</span>                 * y_dist);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keywordtype">double</span> <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>
-<a name="l00089"></a>00089 (<span class="keyword">const</span> cpl_table    ** ref_catalogues,
-<a name="l00090"></a>00090  <span class="keyword">const</span> cpl_bivector  * cat_offsets,
-<a name="l00091"></a>00091  <span class="keyword">const</span> cpl_table     * matching_sets,
-<a name="l00092"></a>00092  <span class="keywordtype">int</span>                   ncats,
-<a name="l00093"></a>00093  hawki_distortion    * distortion);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="preprocessor">#ifdef HAVE_LIBGSL</span>
-<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="keywordtype">double</span> hawki_distortion_gsl_obj_function
-<a name="l00097"></a>00097 (<span class="keyword">const</span> gsl_vector * dist_param,
-<a name="l00098"></a>00098  <span class="keywordtype">void</span>             * args);
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="keywordtype">int</span> hawki_distortion_update_solution_from_param
-<a name="l00101"></a>00101 (hawki_distortion * distortion,
-<a name="l00102"></a>00102  <span class="keyword">const</span> gsl_vector * dist_param);
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104 <span class="keywordtype">int</span> hawki_distortion_update_offsets_from_param
-<a name="l00105"></a>00105 (cpl_bivector      * offsets,
-<a name="l00106"></a>00106  <span class="keyword">const</span> gsl_vector  * dist_param);
-<a name="l00107"></a>00107 
-<a name="l00108"></a>00108 <span class="keywordtype">int</span> hawki_distortion_update_param_from_solution
-<a name="l00109"></a>00109 (gsl_vector             * dist_param,
-<a name="l00110"></a>00110  <span class="keyword">const</span> hawki_distortion * distortion);
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112 <span class="keywordtype">int</span> hawki_distortion_update_param_from_offsets
-<a name="l00113"></a>00113 (gsl_vector              * dist_param,
-<a name="l00114"></a>00114  <span class="keyword">const</span> cpl_bivector      * offsets);
-<a name="l00115"></a>00115 <span class="preprocessor">#endif</span>
-<a name="l00116"></a>00116 <span class="preprocessor"></span>
-<a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a>
-<a name="l00118"></a>00118 (<span class="keywordtype">double</span> * x_val, <span class="keywordtype">double</span> * y_val, <span class="keywordtype">int</span> *pos_flag,
-<a name="l00119"></a>00119  <span class="keywordtype">int</span> nvals, <span class="keywordtype">int</span> *nvalid, <span class="keywordtype">double</span> *var_x, <span class="keywordtype">double</span> *var_y);
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00130"></a>00130 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00131"></a>00131 hawki_distortion * <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a>
-<a name="l00132"></a><a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d">00132</a> (<span class="keywordtype">int</span> detector_nx, 
-<a name="l00133"></a>00133  <span class="keywordtype">int</span> detector_ny, 
-<a name="l00134"></a>00134  <span class="keywordtype">int</span> grid_size)
-<a name="l00135"></a>00135 {
-<a name="l00136"></a>00136     hawki_distortion * distortion;
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <span class="comment">//Allocate the structure</span>
-<a name="l00139"></a>00139     distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));
-<a name="l00140"></a>00140     
-<a name="l00141"></a>00141     <span class="comment">//Allocate the images</span>
-<a name="l00142"></a>00142     distortion->dist_x = cpl_image_new
-<a name="l00143"></a>00143         (grid_size, grid_size, CPL_TYPE_FLOAT);
-<a name="l00144"></a>00144     distortion->dist_y = cpl_image_new
-<a name="l00145"></a>00145         (grid_size, grid_size, CPL_TYPE_FLOAT);
-<a name="l00146"></a>00146     
-<a name="l00147"></a>00147     <span class="comment">//Create the transformation between distortion images and the detector</span>
-<a name="l00148"></a>00148     distortion->x_cdelt = detector_nx / (double)grid_size; 
-<a name="l00149"></a>00149     distortion->y_cdelt = detector_ny / (double)grid_size;
-<a name="l00150"></a>00150     distortion->x_crval  = 0.5 + 0.5 * distortion->x_cdelt;
-<a name="l00151"></a>00151     distortion->y_crval  = 0.5 + 0.5 * distortion->y_cdelt;
-<a name="l00152"></a>00152     
-<a name="l00153"></a>00153     <span class="keywordflow">return</span> distortion;
-<a name="l00154"></a>00154 }
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00161"></a>00161 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00162"></a>00162 <span class="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>
-<a name="l00163"></a><a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712">00163</a> (hawki_distortion * distortion)
-<a name="l00164"></a>00164 {
-<a name="l00165"></a>00165     <span class="keywordflow">if</span>(distortion == NULL)
-<a name="l00166"></a>00166         <span class="keywordflow">return</span>;
-<a name="l00167"></a>00167     cpl_image_delete(distortion->dist_x);
-<a name="l00168"></a>00168     cpl_image_delete(distortion->dist_y);
-<a name="l00169"></a>00169     cpl_free(distortion);
-<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>00181 hawki_distortion * <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a>
-<a name="l00182"></a><a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7">00182</a> (<span class="keyword">const</span> cpl_frame * dist_x,
-<a name="l00183"></a>00183  <span class="keyword">const</span> cpl_frame * dist_y,
-<a name="l00184"></a>00184  <span class="keywordtype">int</span>               idet)
-<a name="l00185"></a>00185 {
-<a name="l00186"></a>00186     <span class="keyword">const</span> <span class="keywordtype">char</span>       * file_dist_x;
-<a name="l00187"></a>00187     <span class="keyword">const</span> <span class="keywordtype">char</span>       * file_dist_y;
-<a name="l00188"></a>00188     hawki_distortion * distortion;
-<a name="l00189"></a>00189     <span class="keywordtype">int</span>                iext;
-<a name="l00190"></a>00190     cpl_propertylist * plist;
-<a name="l00191"></a>00191     
-<a name="l00192"></a>00192     <span class="comment">//Allocate the structure</span>
-<a name="l00193"></a>00193     distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));
-<a name="l00194"></a>00194     
-<a name="l00195"></a>00195     <span class="comment">//Read the images</span>
-<a name="l00196"></a>00196     file_dist_x = cpl_frame_get_filename(dist_x);
-<a name="l00197"></a>00197     file_dist_y = cpl_frame_get_filename(dist_y);
-<a name="l00198"></a>00198     distortion->dist_x = <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>
-<a name="l00199"></a>00199         (dist_x, idet, CPL_TYPE_FLOAT);
-<a name="l00200"></a>00200     distortion->dist_y = <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>
-<a name="l00201"></a>00201         (dist_y, idet, CPL_TYPE_FLOAT);
-<a name="l00202"></a>00202     
-<a name="l00203"></a>00203     <span class="comment">//Read the WCS keywords</span>
-<a name="l00204"></a>00204     iext = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(file_dist_x, idet);
-<a name="l00205"></a>00205     plist = cpl_propertylist_load(file_dist_x, iext);
-<a name="l00206"></a>00206     distortion->x_crval = cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</span>);
-<a name="l00207"></a>00207     distortion->x_cdelt = cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT1"</span>);
-<a name="l00208"></a>00208     distortion->y_crval = cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</span>);
-<a name="l00209"></a>00209     distortion->y_cdelt = cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT2"</span>);
-<a name="l00210"></a>00210     <span class="keywordflow">if</span>(cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</span>) != 1 ||
-<a name="l00211"></a>00211        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</span>) != 1)
-<a name="l00212"></a>00212     {
-<a name="l00213"></a>00213         cpl_error_set_message_macro(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00214"></a>00214                                     __FILE__, __LINE__,<span class="stringliteral">"Wrong CRPIX? keywords"</span>);
-<a name="l00215"></a>00215         cpl_image_delete(distortion->dist_x);
-<a name="l00216"></a>00216         cpl_image_delete(distortion->dist_y);
-<a name="l00217"></a>00217         cpl_propertylist_delete(plist);
-<a name="l00218"></a>00218         cpl_free(distortion);
-<a name="l00219"></a>00219         <span class="keywordflow">return</span> NULL;
-<a name="l00220"></a>00220     }
-<a name="l00221"></a>00221     cpl_propertylist_delete(plist);
-<a name="l00222"></a>00222     <span class="comment">//Check that the keywords in X and Y are compatibles;</span>
-<a name="l00223"></a>00223     plist = cpl_propertylist_load(file_dist_y, iext);
-<a name="l00224"></a>00224     <span class="keywordflow">if</span>(distortion->x_crval != cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</span>) ||
-<a name="l00225"></a>00225        distortion->x_cdelt != cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT1"</span>) ||
-<a name="l00226"></a>00226        distortion->y_crval != cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</span>) ||
-<a name="l00227"></a>00227        distortion->y_cdelt != cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT2"</span>) ||
-<a name="l00228"></a>00228        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</span>) != 1 ||
-<a name="l00229"></a>00229        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</span>) != 1)
-<a name="l00230"></a>00230     {
-<a name="l00231"></a>00231         cpl_error_set_message_macro(cpl_func, CPL_ERROR_ILLEGAL_INPUT, __FILE__,
-<a name="l00232"></a>00232                 __LINE__,<span class="stringliteral">"WCS keywords mismatch in X and Y distortions"</span>);
-<a name="l00233"></a>00233         cpl_image_delete(distortion->dist_x);
-<a name="l00234"></a>00234         cpl_image_delete(distortion->dist_y);
-<a name="l00235"></a>00235         cpl_propertylist_delete(plist);
-<a name="l00236"></a>00236         cpl_free(distortion);
-<a name="l00237"></a>00237         <span class="keywordflow">return</span> NULL;
-<a name="l00238"></a>00238     }
-<a name="l00239"></a>00239     cpl_propertylist_delete(plist);
-<a name="l00240"></a>00240     
-<a name="l00241"></a>00241     <span class="keywordflow">return</span> distortion;
-<a name="l00242"></a>00242 }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00250"></a>00250 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00251"></a>00251 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a>
-<a name="l00252"></a><a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345">00252</a> (<span class="keyword">const</span> hawki_distortion * distortion)
-<a name="l00253"></a>00253 {
-<a name="l00254"></a>00254     <span class="keywordflow">if</span>(distortion == NULL)
-<a name="l00255"></a>00255     {
-<a name="l00256"></a>00256         cpl_error_set(__func__,CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00257"></a>00257     }
-<a name="l00258"></a>00258     <span class="keywordflow">return</span> cpl_image_get_size_x(distortion->dist_x);
-<a name="l00259"></a>00259 }
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00267"></a>00267 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00268"></a>00268 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a>
-<a name="l00269"></a><a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c">00269</a> (<span class="keyword">const</span> hawki_distortion * distortion)
-<a name="l00270"></a>00270 {
-<a name="l00271"></a>00271     <span class="keywordflow">if</span>(distortion == NULL)
-<a name="l00272"></a>00272     {
-<a name="l00273"></a>00273         cpl_error_set(__func__,CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00274"></a>00274     }
-<a name="l00275"></a>00275     <span class="keywordflow">return</span> cpl_image_get_size_y(distortion->dist_x);
-<a name="l00276"></a>00276 }
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00285"></a>00285 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00286"></a>00286 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a>
-<a name="l00287"></a><a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484">00287</a> (cpl_image        ** ilist,
-<a name="l00288"></a>00288  <span class="keyword">const</span> cpl_frame   * frame_dist_x,
-<a name="l00289"></a>00289  <span class="keyword">const</span> cpl_frame   * frame_dist_y)
-<a name="l00290"></a>00290 {
-<a name="l00291"></a>00291     cpl_image        *   corr[HAWKI_NB_DETECTORS];
-<a name="l00292"></a>00292     hawki_distortion *   distortion;
-<a name="l00293"></a>00293     cpl_image        *   dist_x;
-<a name="l00294"></a>00294     cpl_image        *   dist_y;
-<a name="l00295"></a>00295     <span class="keywordtype">int</span>                  idet, j ;
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="comment">/* Test entries */</span>
-<a name="l00298"></a>00298     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00299"></a>00299     <span class="keywordflow">if</span> (frame_dist_x == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00300"></a>00300     <span class="keywordflow">if</span> (frame_dist_y == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="comment">/* Loop on the 4 chips */</span>
-<a name="l00303"></a>00303     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00304"></a>00304     {
-<a name="l00305"></a>00305         <span class="keywordtype">int</span> nx;
-<a name="l00306"></a>00306         <span class="keywordtype">int</span> ny;
-<a name="l00307"></a>00307         
-<a name="l00308"></a>00308         <span class="comment">/* Get the image size */</span>
-<a name="l00309"></a>00309         nx = cpl_image_get_size_x(ilist[idet]);
-<a name="l00310"></a>00310         ny = cpl_image_get_size_y(ilist[idet]);
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312         <span class="comment">/* Load the distortion */</span>
-<a name="l00313"></a>00313         <span class="keywordflow">if</span> ((distortion = <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a>
-<a name="l00314"></a>00314                  (frame_dist_x, frame_dist_y, idet + 1)) == NULL) 
-<a name="l00315"></a>00315         {
-<a name="l00316"></a>00316             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the distortion for chip %d"</span>, 
-<a name="l00317"></a>00317                     idet+1) ;
-<a name="l00318"></a>00318             <span class="keywordflow">for</span> (j=0 ; j<idet ; j++) cpl_image_delete(corr[j]) ;
-<a name="l00319"></a>00319             <span class="keywordflow">return</span> -1 ;
-<a name="l00320"></a>00320         }
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322         <span class="comment">/* Create the offsets images */</span>
-<a name="l00323"></a>00323         dist_x = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
-<a name="l00324"></a>00324         dist_y = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
-<a name="l00325"></a>00325         <span class="keywordflow">if</span> (hawki_distortion_create_maps_detector
-<a name="l00326"></a>00326                 (distortion, dist_x, dist_y))
-<a name="l00327"></a>00327         {
-<a name="l00328"></a>00328             cpl_msg_error(__func__, <span class="stringliteral">"Cannot create the distortion maps"</span>) ;
-<a name="l00329"></a>00329             cpl_image_delete(dist_x);
-<a name="l00330"></a>00330             cpl_image_delete(dist_y);
-<a name="l00331"></a>00331             <span class="keywordflow">for</span> (j=0 ; j<idet ; j++) cpl_image_delete(corr[j]) ;
-<a name="l00332"></a>00332             <span class="keywordflow">return</span> -1;
-<a name="l00333"></a>00333         }
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335         <span class="comment">/* Correct this image */</span>
-<a name="l00336"></a>00336         corr[idet] = <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>(ilist[idet], dist_x, dist_y);
-<a name="l00337"></a>00337         <span class="keywordflow">if</span>(corr[idet] == NULL)
-<a name="l00338"></a>00338         {
-<a name="l00339"></a>00339             cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct the distortion"</span>) ;
-<a name="l00340"></a>00340             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);
-<a name="l00341"></a>00341             cpl_image_delete(dist_x);
-<a name="l00342"></a>00342             cpl_image_delete(dist_y);
-<a name="l00343"></a>00343             <span class="keywordflow">for</span> (j=0 ; j<idet; j++) cpl_image_delete(corr[j]) ;
-<a name="l00344"></a>00344             <span class="keywordflow">return</span> -1 ;
-<a name="l00345"></a>00345         }
-<a name="l00346"></a>00346         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);
-<a name="l00347"></a>00347         cpl_image_delete(dist_x) ;
-<a name="l00348"></a>00348         cpl_image_delete(dist_y);
-<a name="l00349"></a>00349     }
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <span class="comment">/* Store the results */</span>
-<a name="l00352"></a>00352     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00353"></a>00353     {
-<a name="l00354"></a>00354         cpl_image_delete(ilist[idet]) ;
-<a name="l00355"></a>00355         ilist[idet] = corr[idet] ;
-<a name="l00356"></a>00356     }
-<a name="l00357"></a>00357     
-<a name="l00358"></a>00358     <span class="comment">/* Return */</span>
-<a name="l00359"></a>00359     <span class="keywordflow">return</span> 0 ;
-<a name="l00360"></a>00360 }
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00369"></a>00369 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00370"></a>00370 cpl_image *  <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>
-<a name="l00371"></a><a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c">00371</a> (cpl_image       *  image,
-<a name="l00372"></a>00372  cpl_image       *  dist_x,
-<a name="l00373"></a>00373  cpl_image       *  dist_y)
-<a name="l00374"></a>00374 {
-<a name="l00375"></a>00375     cpl_image       *   corr;
-<a name="l00376"></a>00376     cpl_vector      *   profile ;
-<a name="l00377"></a>00377     
-<a name="l00378"></a>00378     <span class="comment">/* Test entries */</span>
-<a name="l00379"></a>00379     <span class="keywordflow">if</span> (image  == NULL) <span class="keywordflow">return</span> NULL;
-<a name="l00380"></a>00380     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> NULL;
-<a name="l00381"></a>00381     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> NULL;
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="comment">/* Create the output image */</span>
-<a name="l00384"></a>00384     corr = cpl_image_new(cpl_image_get_size_x(image),
-<a name="l00385"></a>00385                          cpl_image_get_size_y(image), CPL_TYPE_FLOAT) ;
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387     <span class="comment">/* Create the interpolation profile */</span>
-<a name="l00388"></a>00388     profile = cpl_vector_new(CPL_KERNEL_DEF_SAMPLES) ;
-<a name="l00389"></a>00389     cpl_vector_fill_kernel_profile(profile, CPL_KERNEL_DEFAULT,
-<a name="l00390"></a>00390                                    CPL_KERNEL_DEF_WIDTH) ;
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     <span class="comment">/* Apply the distortion */</span>
-<a name="l00393"></a>00393     <span class="keywordflow">if</span> (cpl_image_warp(corr, image, dist_x, dist_y, profile, 
-<a name="l00394"></a>00394                        CPL_KERNEL_DEF_WIDTH, profile, 
-<a name="l00395"></a>00395                        CPL_KERNEL_DEF_WIDTH) != CPL_ERROR_NONE) 
-<a name="l00396"></a>00396     {
-<a name="l00397"></a>00397         cpl_msg_error(__func__, <span class="stringliteral">"Cannot warp the image"</span>) ;
-<a name="l00398"></a>00398         cpl_image_delete(corr) ;
-<a name="l00399"></a>00399         cpl_vector_delete(profile) ;
-<a name="l00400"></a>00400         <span class="keywordflow">return</span> NULL;
-<a name="l00401"></a>00401      }
-<a name="l00402"></a>00402     cpl_vector_delete(profile) ;
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     <span class="comment">/* Return */</span>
-<a name="l00405"></a>00405     <span class="keywordflow">return</span> corr;
-<a name="l00406"></a>00406 }
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00421"></a>00421 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00422"></a>00422 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e" title="Apply the distortion correction to one detector position.">hawki_distortion_correct_coords</a>
-<a name="l00423"></a><a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e">00423</a> (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00424"></a>00424  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00425"></a>00425  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00426"></a>00426  <span class="keywordtype">double</span>                 * x_pos_distcorr, 
-<a name="l00427"></a>00427  <span class="keywordtype">double</span>                 * y_pos_distcorr)
-<a name="l00428"></a>00428 {
-<a name="l00429"></a>00429     <span class="keywordtype">double</span> x_dist;
-<a name="l00430"></a>00430     <span class="keywordtype">double</span> y_dist;
-<a name="l00431"></a>00431     
-<a name="l00432"></a>00432     <span class="keywordflow">if</span>(distortion == NULL)
-<a name="l00433"></a>00433     {
-<a name="l00434"></a>00434         cpl_error_set(<span class="stringliteral">"hawki_distortion_correct_coords"</span>, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00435"></a>00435         <span class="keywordflow">return</span> -1;
-<a name="l00436"></a>00436     }
-<a name="l00437"></a>00437     
-<a name="l00438"></a>00438     <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l00439"></a>00439         (distortion, x_pos, y_pos, &x_dist, &y_dist);
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     *x_pos_distcorr = x_pos - x_dist;
-<a name="l00442"></a>00442     *y_pos_distcorr = y_pos - y_dist;
-<a name="l00443"></a>00443     
-<a name="l00444"></a>00444     <span class="keywordflow">return</span> 0;
-<a name="l00445"></a>00445 }
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     
-<a name="l00448"></a>00448 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00465"></a>00465 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00466"></a>00466 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3" title="Apply the inverse distortion correction to one detector position.">hawki_distortion_inverse_correct_coords</a>
-<a name="l00467"></a><a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3">00467</a> (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00468"></a>00468  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00469"></a>00469  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00470"></a>00470  <span class="keywordtype">double</span>                 * x_pos_distinvcorr, 
-<a name="l00471"></a>00471  <span class="keywordtype">double</span>                 * y_pos_distinvcorr)
-<a name="l00472"></a>00472 {
-<a name="l00473"></a>00473     <span class="keywordtype">double</span> x_dist = 0;
-<a name="l00474"></a>00474     <span class="keywordtype">double</span> y_dist = 0;
-<a name="l00475"></a>00475     <span class="keywordtype">int</span>    i;
-<a name="l00476"></a>00476     <span class="keywordtype">int</span>    niter = 3;
-<a name="l00477"></a>00477     
-<a name="l00478"></a>00478     <span class="keywordflow">if</span>(distortion == NULL)
-<a name="l00479"></a>00479     {
-<a name="l00480"></a>00480         cpl_error_set(<span class="stringliteral">"hawki_distortion_inverse_correct_coords"</span>, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00481"></a>00481         <span class="keywordflow">return</span> -1;
-<a name="l00482"></a>00482     }
-<a name="l00483"></a>00483     <span class="keywordflow">for</span>(i = 0; i < niter; ++i)
-<a name="l00484"></a>00484     {
-<a name="l00485"></a>00485         <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l00486"></a>00486             (distortion, x_pos + x_dist, y_pos + y_dist, &x_dist, &y_dist);
-<a name="l00487"></a>00487     }
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     
-<a name="l00490"></a>00490     <span class="comment">/* Apply the correction in the inverse direction */</span>
-<a name="l00491"></a>00491     *x_pos_distinvcorr = x_pos + x_dist;
-<a name="l00492"></a>00492     *y_pos_distinvcorr = y_pos + y_dist;
-<a name="l00493"></a>00493     
-<a name="l00494"></a>00494     <span class="keywordflow">return</span> 0;
-<a name="l00495"></a>00495 }
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00524"></a>00524 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00525"></a>00525 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l00526"></a><a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d">00526</a> (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00527"></a>00527  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00528"></a>00528  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00529"></a>00529  <span class="keywordtype">double</span>                 * x_dist, 
-<a name="l00530"></a>00530  <span class="keywordtype">double</span>                 * y_dist)
-<a name="l00531"></a>00531 {
-<a name="l00532"></a>00532     <span class="keywordtype">int</span>             ix1;
-<a name="l00533"></a>00533     <span class="keywordtype">int</span>             ix2;
-<a name="l00534"></a>00534     <span class="keywordtype">int</span>             iy1;
-<a name="l00535"></a>00535     <span class="keywordtype">int</span>             iy2;
-<a name="l00536"></a>00536     <span class="keywordtype">int</span>             nx;
-<a name="l00537"></a>00537     <span class="keywordtype">int</span>             ny;
-<a name="l00538"></a>00538     <span class="keywordtype">double</span>          x1_pos;
-<a name="l00539"></a>00539     <span class="keywordtype">double</span>          x2_pos;
-<a name="l00540"></a>00540     <span class="keywordtype">double</span>          y1_pos;
-<a name="l00541"></a>00541     <span class="keywordtype">double</span>          y2_pos;
-<a name="l00542"></a>00542     <span class="keywordtype">double</span>          dx11;
-<a name="l00543"></a>00543     <span class="keywordtype">double</span>          dx12;
-<a name="l00544"></a>00544     <span class="keywordtype">double</span>          dx21;
-<a name="l00545"></a>00545     <span class="keywordtype">double</span>          dx22;
-<a name="l00546"></a>00546     <span class="keywordtype">double</span>          dy11;
-<a name="l00547"></a>00547     <span class="keywordtype">double</span>          dy12;
-<a name="l00548"></a>00548     <span class="keywordtype">double</span>          dy21;
-<a name="l00549"></a>00549     <span class="keywordtype">double</span>          dy22;
-<a name="l00550"></a>00550     <span class="keywordtype">int</span>             isnull;
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552     <span class="comment">/* Get the size of the distortion images */</span>
-<a name="l00553"></a>00553     nx = cpl_image_get_size_x(distortion->dist_x);
-<a name="l00554"></a>00554     ny = cpl_image_get_size_y(distortion->dist_x);
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="comment">//This uses bilinear interpolation</span>
-<a name="l00557"></a>00557     <span class="comment">//Get lower left corner. This assumes CRPIX? =1 and ix, iy start with 0</span>
-<a name="l00558"></a>00558     ix1 = (int)floor((x_pos - distortion->x_crval)/distortion->x_cdelt);
-<a name="l00559"></a>00559     iy1 = (int)floor((y_pos - distortion->y_crval)/distortion->y_cdelt);
-<a name="l00560"></a>00560     <span class="comment">//Handle extrapolation</span>
-<a name="l00561"></a>00561     <span class="keywordflow">if</span>(ix1 < 0)
-<a name="l00562"></a>00562         ix1 = 0;
-<a name="l00563"></a>00563     <span class="keywordflow">if</span>(ix1 >= nx - 1)
-<a name="l00564"></a>00564         ix1 = nx - 2;
-<a name="l00565"></a>00565     <span class="keywordflow">if</span>(iy1 < 0)
-<a name="l00566"></a>00566         iy1 = 0;
-<a name="l00567"></a>00567     <span class="keywordflow">if</span>(iy1 >= ny - 1)
-<a name="l00568"></a>00568         iy1 = ny - 2;
-<a name="l00569"></a>00569     <span class="comment">//Get upper right corner</span>
-<a name="l00570"></a>00570     ix2 = ix1 + 1;
-<a name="l00571"></a>00571     iy2 = iy1 + 1;
-<a name="l00572"></a>00572     
-<a name="l00573"></a>00573     <span class="comment">//Get the position values</span>
-<a name="l00574"></a>00574     <span class="comment">//This implies that CRPIX? = 1 and that ix, iy start at 0.</span>
-<a name="l00575"></a>00575     x1_pos = ix1 * distortion->x_cdelt + distortion->x_crval; 
-<a name="l00576"></a>00576     x2_pos = ix2 * distortion->x_cdelt + distortion->x_crval; 
-<a name="l00577"></a>00577     y1_pos = iy1 * distortion->y_cdelt + distortion->y_crval; 
-<a name="l00578"></a>00578     y2_pos = iy2 * distortion->y_cdelt + distortion->y_crval; 
-<a name="l00579"></a>00579     
-<a name="l00580"></a>00580     <span class="comment">//Get the values used to interpolate</span>
-<a name="l00581"></a>00581     <span class="comment">//The +1 is because cpl_image_get uses FITS convention</span>
-<a name="l00582"></a>00582     dx11 = cpl_image_get(distortion->dist_x, ix1 + 1, iy1 + 1, &isnull);  
-<a name="l00583"></a>00583     dx21 = cpl_image_get(distortion->dist_x, ix2 + 1, iy1 + 1, &isnull);  
-<a name="l00584"></a>00584     dx12 = cpl_image_get(distortion->dist_x, ix1 + 1, iy2 + 1, &isnull);  
-<a name="l00585"></a>00585     dx22 = cpl_image_get(distortion->dist_x, ix2 + 1, iy2 + 1, &isnull);  
-<a name="l00586"></a>00586     dy11 = cpl_image_get(distortion->dist_y, ix1 + 1, iy1 + 1, &isnull);  
-<a name="l00587"></a>00587     dy21 = cpl_image_get(distortion->dist_y, ix2 + 1, iy1 + 1, &isnull);  
-<a name="l00588"></a>00588     dy12 = cpl_image_get(distortion->dist_y, ix1 + 1, iy2 + 1, &isnull);  
-<a name="l00589"></a>00589     dy22 = cpl_image_get(distortion->dist_y, ix2 + 1, iy2 + 1, &isnull);  
-<a name="l00590"></a>00590     
-<a name="l00591"></a>00591     
-<a name="l00592"></a>00592     <span class="comment">//Compute the final values</span>
-<a name="l00593"></a>00593     *x_dist = dx11 * (x2_pos - x_pos) * (y2_pos - y_pos) +
-<a name="l00594"></a>00594               dx21 * (x_pos - x1_pos) * (y2_pos - y_pos) +
-<a name="l00595"></a>00595               dx12 * (x2_pos - x_pos) * (y_pos - y1_pos) +
-<a name="l00596"></a>00596               dx22 * (x_pos - x1_pos) * (y_pos - y1_pos);
-<a name="l00597"></a>00597     *x_dist = *x_dist / (x2_pos -x1_pos) / (y2_pos -y1_pos);
-<a name="l00598"></a>00598     *y_dist = dy11 * (x2_pos - x_pos) * (y2_pos - y_pos) +
-<a name="l00599"></a>00599               dy21 * (x_pos - x1_pos) * (y2_pos - y_pos) +
-<a name="l00600"></a>00600               dy12 * (x2_pos - x_pos) * (y_pos - y1_pos) +
-<a name="l00601"></a>00601               dy22 * (x_pos - x1_pos) * (y_pos - y1_pos);
-<a name="l00602"></a>00602     *y_dist = *y_dist / (x2_pos -x1_pos) / (y2_pos -y1_pos);
-<a name="l00603"></a>00603 
-<a name="l00604"></a>00604     <span class="keywordflow">return</span> 0;
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606 }
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00615"></a>00615 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00616"></a>00616 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a>
-<a name="l00617"></a><a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f">00617</a> (cpl_imagelist   *   ilist, 
-<a name="l00618"></a>00618  cpl_image       **  dist_x,
-<a name="l00619"></a>00619  cpl_image       **  dist_y)
-<a name="l00620"></a>00620 {
-<a name="l00621"></a>00621     cpl_image       *   corr[HAWKI_NB_DETECTORS] ;
-<a name="l00622"></a>00622     <span class="keywordtype">int</span>                 i, j ;
-<a name="l00623"></a>00623 
-<a name="l00624"></a>00624     <span class="comment">/* Test entries */</span>
-<a name="l00625"></a>00625     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00626"></a>00626     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00628"></a>00628 
-<a name="l00629"></a>00629     <span class="comment">/* Loop on the 4 chips */</span>
-<a name="l00630"></a>00630     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00631"></a>00631     {
-<a name="l00632"></a>00632         cpl_image * cur_image;
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634         <span class="comment">/* Get the current image */</span>
-<a name="l00635"></a>00635         cur_image = cpl_imagelist_get(ilist, i);
-<a name="l00636"></a>00636         
-<a name="l00637"></a>00637         <span class="comment">/* Correct this image */</span>
-<a name="l00638"></a>00638         corr[i] = <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>(cur_image,dist_x[i],dist_y[i]);
-<a name="l00639"></a>00639         <span class="keywordflow">if</span>(corr[i] == NULL)
-<a name="l00640"></a>00640         {
-<a name="l00641"></a>00641             cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct the distortion"</span>) ;
-<a name="l00642"></a>00642             <span class="keywordflow">for</span> (j=0 ; j<i ; j++) cpl_image_delete(corr[j]) ;
-<a name="l00643"></a>00643             <span class="keywordflow">return</span> -1 ;
-<a name="l00644"></a>00644         }
-<a name="l00645"></a>00645     }
-<a name="l00646"></a>00646 
-<a name="l00647"></a>00647     <span class="comment">/* Store the results */</span>
-<a name="l00648"></a>00648     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00649"></a>00649         cpl_imagelist_set(ilist, corr[i], i);
-<a name="l00650"></a>00650     
-<a name="l00651"></a>00651     <span class="comment">/* Return */</span>
-<a name="l00652"></a>00652     <span class="keywordflow">return</span> 0 ;
-<a name="l00653"></a>00653 }
-<a name="l00654"></a>00654 
-<a name="l00657"></a>00657 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00665"></a>00665 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00666"></a>00666 <span class="keywordtype">int</span> hawki_distortion_create_maps_detector
-<a name="l00667"></a>00667 (<span class="keyword">const</span> hawki_distortion * distortion,
-<a name="l00668"></a>00668  cpl_image              * dist_x,
-<a name="l00669"></a>00669  cpl_image              * dist_y)
-<a name="l00670"></a>00670 {
-<a name="l00671"></a>00671     <span class="keywordtype">double</span>              *   pdx;
-<a name="l00672"></a>00672     <span class="keywordtype">double</span>              *   pdy;
-<a name="l00673"></a>00673     <span class="keywordtype">int</span>                     nx, ny;
-<a name="l00674"></a>00674     <span class="keywordtype">int</span>                     pos;
-<a name="l00675"></a>00675     <span class="keywordtype">int</span>                     i, j;
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677     <span class="comment">/* Test entries */</span>
-<a name="l00678"></a>00678     <span class="keywordflow">if</span> (distortion == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00679"></a>00679     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00680"></a>00680     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     <span class="comment">/* Initialise */</span>
-<a name="l00683"></a>00683     nx = cpl_image_get_size_x(dist_x) ;
-<a name="l00684"></a>00684     ny = cpl_image_get_size_y(dist_x) ;
-<a name="l00685"></a>00685     <span class="keywordflow">if</span> (cpl_image_get_size_x(dist_y) != nx) <span class="keywordflow">return</span> -1 ;
-<a name="l00686"></a>00686     <span class="keywordflow">if</span> (cpl_image_get_size_y(dist_y) != ny) <span class="keywordflow">return</span> -1 ;
-<a name="l00687"></a>00687   
-<a name="l00688"></a>00688     <span class="comment">/* Access to the data */</span>
-<a name="l00689"></a>00689     pdx = cpl_image_get_data_double(dist_x) ;
-<a name="l00690"></a>00690     pdy = cpl_image_get_data_double(dist_y) ;
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     <span class="comment">/* Loop on the pixels */</span>
-<a name="l00693"></a>00693     <span class="keywordflow">for</span> (j=0 ; j<ny ; j++) {
-<a name="l00694"></a>00694         <span class="keywordflow">for</span> (i=0 ; i<nx ; i++) {
-<a name="l00695"></a>00695             <span class="keywordtype">double</span> x_dist;
-<a name="l00696"></a>00696             <span class="keywordtype">double</span> y_dist;
-<a name="l00697"></a>00697 
-<a name="l00698"></a>00698             pos = i+j*nx ;
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700             <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l00701"></a>00701                 (distortion, (<span class="keywordtype">double</span>)i, (<span class="keywordtype">double</span>)j, &x_dist, &y_dist);
-<a name="l00702"></a>00702             
-<a name="l00703"></a>00703             pdx[pos] = x_dist;
-<a name="l00704"></a>00704             pdy[pos] = y_dist;
-<a name="l00705"></a>00705         }
-<a name="l00706"></a>00706     }
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708     <span class="keywordflow">return</span> 0 ; 
-<a name="l00709"></a>00709 }
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00735"></a>00735 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00736"></a>00736 hawki_distortion *  hawki_distortion_compute_solution
-<a name="l00737"></a>00737 (<span class="keyword">const</span> cpl_table       ** ref_catalogues,
-<a name="l00738"></a>00738  <span class="keyword">const</span> cpl_bivector     * initial_offsets,
-<a name="l00739"></a>00739  <span class="keyword">const</span> cpl_table        * matching_sets,
-<a name="l00740"></a>00740  <span class="keywordtype">int</span>                      ncats,
-<a name="l00741"></a>00741  <span class="keywordtype">int</span>                      detector_nx,
-<a name="l00742"></a>00742  <span class="keywordtype">int</span>                      detector_ny,
-<a name="l00743"></a>00743  <span class="keywordtype">int</span>                      grid_size,
-<a name="l00744"></a>00744  <span class="keyword">const</span> hawki_distortion * initial_guess,
-<a name="l00745"></a>00745  <span class="keywordtype">double</span>                 * rms)
-<a name="l00746"></a>00746 {
-<a name="l00747"></a>00747 <span class="preprocessor">#ifdef HAVE_LIBGSL</span>
-<a name="l00748"></a>00748 <span class="preprocessor"></span>    
-<a name="l00749"></a>00749     hawki_distortion                          * distortion;
-<a name="l00750"></a>00750     cpl_bivector                              * offsets;
-<a name="l00751"></a>00751     gsl_multimin_fminimizer                   * minimizer;
-<a name="l00752"></a>00752     gsl_vector                                * step_size;
-<a name="l00753"></a>00753     gsl_vector                                * init_param;
-<a name="l00754"></a>00754     gsl_multimin_function                       minimize_function;
-<a name="l00755"></a>00755     
-<a name="l00756"></a>00756     <span class="keywordtype">int</span>                                         nfitparam = 0;
-<a name="l00757"></a>00757     <span class="keywordtype">int</span>                                         iparam;
-<a name="l00758"></a>00758     <span class="keywordtype">double</span>                                      tolerance = HAWKI_DISTORTION_TOLERANCE;
-<a name="l00759"></a>00759     <span class="keywordtype">double</span>                                      tolerance2 = HAWKI_DISTORTION_TOLERANCE2;
-<a name="l00760"></a>00760     <span class="keywordtype">int</span>                                         minimizer_status;
-<a name="l00761"></a>00761     <span class="keywordtype">int</span>                                         iter = 0;
-<a name="l00762"></a>00762     <span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a> args;
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     <span class="comment">/* Initialize the distortion solution */</span>
-<a name="l00765"></a>00765     <span class="keywordflow">if</span>(initial_guess == NULL)
-<a name="l00766"></a>00766     {
-<a name="l00767"></a>00767         distortion = <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a>
-<a name="l00768"></a>00768             (detector_nx, detector_ny, grid_size);
-<a name="l00769"></a>00769     }
-<a name="l00770"></a>00770     <span class="keywordflow">else</span>
-<a name="l00771"></a>00771     {
-<a name="l00772"></a>00772         distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));
-<a name="l00773"></a>00773         distortion->dist_x  = cpl_image_duplicate(initial_guess->dist_x);
-<a name="l00774"></a>00774         distortion->dist_y  = cpl_image_duplicate(initial_guess->dist_y);
-<a name="l00775"></a>00775         distortion->x_cdelt = initial_guess->x_cdelt;
-<a name="l00776"></a>00776         distortion->x_crval = initial_guess->x_crval;
-<a name="l00777"></a>00777         distortion->y_cdelt = initial_guess->y_cdelt;
-<a name="l00778"></a>00778         distortion->y_crval = initial_guess->y_crval;
-<a name="l00779"></a>00779         <span class="comment">//We have to fit all the distortion coefficients plus</span>
-<a name="l00780"></a>00780         <span class="comment">//the offsets of the catalogues</span>
-<a name="l00781"></a>00781     }
-<a name="l00782"></a>00782     <span class="comment">//We have to fit all the distortion coefficients plus</span>
-<a name="l00783"></a>00783     <span class="comment">//the offsets of the catalogues</span>
-<a name="l00784"></a>00784     nfitparam = grid_size * grid_size * 2 + ncats * 2;
-<a name="l00785"></a>00785     offsets = cpl_bivector_duplicate(initial_offsets);
-<a name="l00786"></a>00786     <span class="keywordflow">if</span>(cpl_table_get_nrow(matching_sets) * 2 < nfitparam)
-<a name="l00787"></a>00787     {
-<a name="l00788"></a>00788         cpl_msg_error(__func__,<span class="stringliteral">"Too few matches to compute distortion (< %d)"</span>,
-<a name="l00789"></a>00789                       nfitparam);
-<a name="l00790"></a>00790         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);
-<a name="l00791"></a>00791         <span class="keywordflow">return</span> NULL;
-<a name="l00792"></a>00792     }
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794     <span class="comment">/* Setup function to minimize */</span>
-<a name="l00795"></a>00795     args.ref_catalogues = ref_catalogues;
-<a name="l00796"></a>00796     args.matching_sets  = matching_sets;
-<a name="l00797"></a>00797     args.distortion     = distortion;
-<a name="l00798"></a>00798     args.offsets        = offsets;
-<a name="l00799"></a>00799     args.ncats          = ncats;
-<a name="l00800"></a>00800     
-<a name="l00801"></a>00801     minimize_function.f      = hawki_distortion_gsl_obj_function;
-<a name="l00802"></a>00802     minimize_function.n      = nfitparam;
-<a name="l00803"></a>00803     minimize_function.params = &args;
-<a name="l00804"></a>00804     
-<a name="l00805"></a>00805     <span class="comment">/* Setup minimizer */</span>
-<a name="l00806"></a>00806     minimizer = gsl_multimin_fminimizer_alloc
-<a name="l00807"></a>00807         (gsl_multimin_fminimizer_nmsimplex, nfitparam);
-<a name="l00808"></a>00808     step_size = gsl_vector_alloc(nfitparam);
-<a name="l00809"></a>00809     init_param = gsl_vector_alloc(nfitparam);
-<a name="l00810"></a>00810     <span class="keywordflow">for</span>(iparam = 0; iparam < grid_size * grid_size * 2; ++iparam)
-<a name="l00811"></a>00811         gsl_vector_set(step_size, iparam, 5);
-<a name="l00812"></a>00812     <span class="keywordflow">for</span>(iparam = grid_size * grid_size * 2;
-<a name="l00813"></a>00813         iparam < nfitparam; ++iparam)
-<a name="l00814"></a>00814         gsl_vector_set(step_size, iparam, 1);
-<a name="l00815"></a>00815     hawki_distortion_update_param_from_solution(init_param, distortion);
-<a name="l00816"></a>00816     hawki_distortion_update_param_from_offsets(init_param, offsets);
-<a name="l00817"></a>00817     gsl_multimin_fminimizer_set(minimizer, &minimize_function,
-<a name="l00818"></a>00818                                 init_param, step_size);
-<a name="l00819"></a>00819 
-<a name="l00820"></a>00820     <span class="keywordflow">do</span>
-<a name="l00821"></a>00821     {
-<a name="l00822"></a>00822         ++iter;
-<a name="l00823"></a>00823         minimizer_status = gsl_multimin_fminimizer_iterate (minimizer);
-<a name="l00824"></a>00824         <span class="keywordflow">if</span>(minimizer_status)
-<a name="l00825"></a>00825             <span class="keywordflow">break</span>;
-<a name="l00826"></a>00826         minimizer_status = gsl_multimin_test_size
-<a name="l00827"></a>00827             (gsl_multimin_fminimizer_size(minimizer), tolerance);
-<a name="l00828"></a>00828         cpl_msg_debug(__func__,<span class="stringliteral">"Iteration %d Minimum: %g"</span>,
-<a name="l00829"></a>00829                       iter, gsl_multimin_fminimizer_minimum(minimizer));
-<a name="l00830"></a>00830     }
-<a name="l00831"></a>00831     <span class="keywordflow">while</span> (minimizer_status == GSL_CONTINUE && iter < HAWKI_DISTORTION_MAX_ITER);
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833     cpl_msg_warning(__func__, <span class="stringliteral">"rms before computing %f"</span>, <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, 
-<a name="l00834"></a>00834                                         matching_sets, ncats, distortion));
-<a name="l00835"></a>00835 
-<a name="l00836"></a>00836     
-<a name="l00837"></a>00837     <span class="comment">//Do it again to avoid local minimum</span>
-<a name="l00838"></a>00838     gsl_multimin_fminimizer_set(minimizer, &minimize_function,
-<a name="l00839"></a>00839                                 gsl_multimin_fminimizer_x(minimizer), step_size);
-<a name="l00840"></a>00840     iter = 0;
-<a name="l00841"></a>00841     <span class="keywordflow">do</span>
-<a name="l00842"></a>00842     {
-<a name="l00843"></a>00843         ++iter;
-<a name="l00844"></a>00844         minimizer_status = gsl_multimin_fminimizer_iterate (minimizer);
-<a name="l00845"></a>00845         <span class="keywordflow">if</span>(minimizer_status)
-<a name="l00846"></a>00846             <span class="keywordflow">break</span>;
-<a name="l00847"></a>00847         minimizer_status = gsl_multimin_test_size
-<a name="l00848"></a>00848             (gsl_multimin_fminimizer_size(minimizer), tolerance2);
-<a name="l00849"></a>00849         cpl_msg_debug(__func__,<span class="stringliteral">"2nd run Iteration %d Minimum: %g"</span>,
-<a name="l00850"></a>00850                       iter, gsl_multimin_fminimizer_minimum(minimizer));
-<a name="l00851"></a>00851     }
-<a name="l00852"></a>00852     <span class="keywordflow">while</span> (minimizer_status == GSL_CONTINUE && iter < HAWKI_DISTORTION_MAX_ITER2);
-<a name="l00853"></a>00853 
-<a name="l00854"></a>00854     <span class="comment">/* Update the distortion solution */</span>
-<a name="l00855"></a>00855     hawki_distortion_update_solution_from_param
-<a name="l00856"></a>00856         (distortion, gsl_multimin_fminimizer_x(minimizer));
-<a name="l00857"></a>00857     hawki_distortion_update_offsets_from_param
-<a name="l00858"></a>00858         (offsets, gsl_multimin_fminimizer_x(minimizer));
-<a name="l00859"></a>00859     
-<a name="l00860"></a>00860     *rms = <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, 
-<a name="l00861"></a>00861                                         matching_sets, ncats, distortion);
-<a name="l00862"></a>00862     
-<a name="l00863"></a>00863     <span class="comment">/* Free and return */</span>
-<a name="l00864"></a>00864     gsl_multimin_fminimizer_free(minimizer);
-<a name="l00865"></a>00865     gsl_vector_free(init_param);
-<a name="l00866"></a>00866     gsl_vector_free(step_size);
-<a name="l00867"></a>00867     cpl_bivector_delete(offsets);
-<a name="l00868"></a>00868 
-<a name="l00869"></a>00869     <span class="keywordflow">return</span> distortion;
-<a name="l00870"></a>00870 <span class="preprocessor">#else</span>
-<a name="l00871"></a>00871 <span class="preprocessor"></span>    cpl_msg_error(__func__,<span class="stringliteral">"Not compiled with GSL support."</span>);
-<a name="l00872"></a>00872     <span class="keywordflow">return</span> NULL;
-<a name="l00873"></a>00873 <span class="preprocessor">#endif</span>
-<a name="l00874"></a>00874 <span class="preprocessor"></span>}
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876 <span class="preprocessor">#ifdef HAVE_LIBGSL</span>
-<a name="l00877"></a>00877 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00885"></a>00885 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00886"></a>00886 <span class="keywordtype">double</span> hawki_distortion_gsl_obj_function
-<a name="l00887"></a>00887 (<span class="keyword">const</span> gsl_vector * dist_param,
-<a name="l00888"></a>00888  <span class="keywordtype">void</span>             * args)
-<a name="l00889"></a>00889 {
-<a name="l00890"></a>00890     <span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a>  args_struct;
-<a name="l00891"></a>00891     <span class="keyword">const</span> cpl_table                           ** ref_catalogues;
-<a name="l00892"></a>00892     <span class="keyword">const</span> cpl_table                            * matching_sets;
-<a name="l00893"></a>00893     hawki_distortion                           * distortion;
-<a name="l00894"></a>00894     cpl_bivector                               * offsets;
-<a name="l00895"></a>00895     <span class="keywordtype">int</span>                                          ncats;
-<a name="l00896"></a>00896     <span class="keywordtype">double</span>                                       rms;
-<a name="l00897"></a>00897     <span class="keywordtype">double</span>                                       objective_function;
-<a name="l00898"></a>00898 
-<a name="l00899"></a>00899     
-<a name="l00900"></a>00900     
-<a name="l00901"></a>00901     args_struct    = *(<span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a> * )args;
-<a name="l00902"></a>00902     ref_catalogues = args_struct.ref_catalogues; 
-<a name="l00903"></a>00903     matching_sets  = args_struct.matching_sets; 
-<a name="l00904"></a>00904     distortion     = args_struct.distortion;
-<a name="l00905"></a>00905     offsets        = args_struct.offsets;
-<a name="l00906"></a>00906     ncats          = args_struct.ncats; 
-<a name="l00907"></a>00907     
-<a name="l00908"></a>00908     hawki_distortion_update_solution_from_param(distortion, dist_param);
-<a name="l00909"></a>00909     hawki_distortion_update_offsets_from_param(offsets, dist_param);
-<a name="l00910"></a>00910     
-<a name="l00911"></a>00911     rms = <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, 
-<a name="l00912"></a>00912                                        matching_sets, ncats, distortion);
-<a name="l00913"></a>00913     
-<a name="l00914"></a>00914     objective_function = rms; 
-<a name="l00915"></a>00915     
-<a name="l00916"></a>00916     
-<a name="l00917"></a>00917     cpl_msg_debug(__func__,<span class="stringliteral">"Objective function: %g"</span>, objective_function);
-<a name="l00918"></a>00918     <span class="keywordflow">return</span> objective_function;
-<a name="l00919"></a>00919 }
-<a name="l00920"></a>00920 <span class="preprocessor">#endif</span>
-<a name="l00921"></a>00921 <span class="preprocessor"></span>
-<a name="l00922"></a>00922 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00928"></a>00928 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00929"></a>00929 <span class="keywordtype">double</span> <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>
-<a name="l00930"></a><a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea">00930</a> (<span class="keyword">const</span> cpl_table   ** ref_catalogues,
-<a name="l00931"></a>00931  <span class="keyword">const</span> cpl_bivector * cat_offsets,
-<a name="l00932"></a>00932  <span class="keyword">const</span> cpl_table    * matching_sets,
-<a name="l00933"></a>00933  <span class="keywordtype">int</span>                  ncats,
-<a name="l00934"></a>00934  hawki_distortion   * distortion)
-<a name="l00935"></a>00935 {
-<a name="l00936"></a>00936     <span class="keywordtype">int</span>                icat;
-<a name="l00937"></a>00937     <span class="keywordtype">int</span>                imatch;
-<a name="l00938"></a>00938     <span class="keywordtype">int</span>                nmatch;
-<a name="l00939"></a>00939     <span class="keywordtype">double</span>             rms = 0;
-<a name="l00940"></a>00940     <span class="keyword">const</span> <span class="keywordtype">double</span>     * x_cat_offsets;
-<a name="l00941"></a>00941     <span class="keyword">const</span> <span class="keywordtype">double</span>     * y_cat_offsets;
-<a name="l00942"></a>00942     <span class="keyword">const</span> <span class="keywordtype">double</span>    ** x_cat_cols; 
-<a name="l00943"></a>00943     <span class="keyword">const</span> <span class="keywordtype">double</span>    ** y_cat_cols;
-<a name="l00944"></a>00944     <span class="keyword">const</span> cpl_array ** match_arrays;
-<a name="l00945"></a>00945     <span class="keywordtype">double</span>          ** x_pos_values;
-<a name="l00946"></a>00946     <span class="keywordtype">double</span>          ** y_pos_values;
-<a name="l00947"></a>00947     <span class="keywordtype">int</span>             ** pos_flag;
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949     
-<a name="l00950"></a>00950     
-<a name="l00951"></a>00951     nmatch = cpl_table_get_nrow(matching_sets);
-<a name="l00952"></a>00952 
-<a name="l00953"></a>00953     x_cat_offsets = cpl_vector_get_data_const
-<a name="l00954"></a>00954         (cpl_bivector_get_x_const(cat_offsets));
-<a name="l00955"></a>00955     y_cat_offsets = cpl_vector_get_data_const
-<a name="l00956"></a>00956         (cpl_bivector_get_y_const(cat_offsets));
-<a name="l00957"></a>00957 
-<a name="l00958"></a>00958     x_cat_cols = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * ncats);
-<a name="l00959"></a>00959     y_cat_cols = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * ncats);
-<a name="l00960"></a>00960     <span class="keywordflow">for</span>(icat = 0; icat < ncats; ++icat)
-<a name="l00961"></a>00961     {
-<a name="l00962"></a>00962         x_cat_cols[icat] = cpl_table_get_data_double_const(ref_catalogues[icat],
-<a name="l00963"></a>00963                                                            HAWKI_COL_OBJ_POSX);
-<a name="l00964"></a>00964         y_cat_cols[icat] = cpl_table_get_data_double_const(ref_catalogues[icat],
-<a name="l00965"></a>00965                                                            HAWKI_COL_OBJ_POSY);
-<a name="l00966"></a>00966     }
-<a name="l00967"></a>00967 
-<a name="l00968"></a>00968     match_arrays = cpl_malloc(<span class="keyword">sizeof</span>(cpl_array *) * nmatch);
-<a name="l00969"></a>00969     x_pos_values = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * nmatch);
-<a name="l00970"></a>00970     y_pos_values = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * nmatch);
-<a name="l00971"></a>00971     pos_flag     = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span> *) * nmatch);
-<a name="l00972"></a>00972     <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)
-<a name="l00973"></a>00973     {
-<a name="l00974"></a>00974         match_arrays[imatch] = cpl_table_get_array(matching_sets, 
-<a name="l00975"></a>00975                 HAWKI_COL_MATCHING_SETS, imatch);
-<a name="l00976"></a>00976         x_pos_values[imatch] = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * ncats);
-<a name="l00977"></a>00977         y_pos_values[imatch] = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * ncats);
-<a name="l00978"></a>00978         pos_flag[imatch]     = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * ncats);
-<a name="l00979"></a>00979     }
-<a name="l00980"></a>00980 
-<a name="l00981"></a>00981 <span class="preprocessor">#ifdef _OPENMP    </span>
-<a name="l00982"></a>00982 <span class="preprocessor"></span><span class="preprocessor">#pragma omp parallel for  private(icat,imatch) reduction(+:rms)</span>
-<a name="l00983"></a>00983 <span class="preprocessor"></span><span class="preprocessor">#endif    </span>
-<a name="l00984"></a>00984 <span class="preprocessor"></span>    <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)
-<a name="l00985"></a>00985     {
-<a name="l00986"></a>00986         <span class="keywordtype">int</span>                 nstddev;
-<a name="l00987"></a>00987         <span class="keywordtype">double</span>              var_x;
-<a name="l00988"></a>00988         <span class="keywordtype">double</span>              var_y;
-<a name="l00989"></a>00989                 
-<a name="l00990"></a>00990         <span class="keywordflow">for</span>(icat = 0; icat < ncats; ++icat)
-<a name="l00991"></a>00991         {
-<a name="l00992"></a>00992             <span class="keywordtype">int</span>    iobj;
-<a name="l00993"></a>00993             <span class="keywordtype">double</span> x_cat_offset;
-<a name="l00994"></a>00994             <span class="keywordtype">double</span> y_cat_offset;
-<a name="l00995"></a>00995             
-<a name="l00996"></a>00996             x_cat_offset = x_cat_offsets[icat];
-<a name="l00997"></a>00997             y_cat_offset = y_cat_offsets[icat];            
-<a name="l00998"></a>00998 
-<a name="l00999"></a>00999             <span class="keywordflow">if</span>((iobj = cpl_array_get(match_arrays[imatch], icat, NULL)) != -1)
-<a name="l01000"></a>01000             {
-<a name="l01001"></a>01001                 <span class="keywordtype">double</span> x_cat;
-<a name="l01002"></a>01002                 <span class="keywordtype">double</span> y_cat;
-<a name="l01003"></a>01003                 <span class="keywordtype">double</span> x_dist_corr;
-<a name="l01004"></a>01004                 <span class="keywordtype">double</span> y_dist_corr;
-<a name="l01005"></a>01005                 <span class="keywordtype">double</span> x_dist;
-<a name="l01006"></a>01006                 <span class="keywordtype">double</span> y_dist;
-<a name="l01007"></a>01007                 <span class="keywordtype">double</span> x_glob;
-<a name="l01008"></a>01008                 <span class="keywordtype">double</span> y_glob;
-<a name="l01009"></a>01009 
-<a name="l01010"></a>01010                 x_cat = x_cat_cols[icat][iobj];
-<a name="l01011"></a>01011                 y_cat = y_cat_cols[icat][iobj];
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013 
-<a name="l01014"></a>01014                 <span class="comment">//These 4 lines of code are from hawki_distortion_correct_coords.</span>
-<a name="l01015"></a>01015                 <span class="comment">//The are repeated here to avoid a cpl call, which is not thread-safe</span>
-<a name="l01016"></a>01016                 <span class="comment">//Two checks to ensure thread-safety:</span>
-<a name="l01017"></a>01017                 <span class="comment">//We have ensured outside the loop that distortion->dist_x and</span>
-<a name="l01018"></a>01018                 <span class="comment">//distortion->dist_y are not null. </span>
-<a name="l01019"></a>01019                 <span class="comment">//We have checked outside the loop the mask has all the points valid</span>
-<a name="l01020"></a>01020                 <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a>
-<a name="l01021"></a>01021                     (distortion, x_cat, y_cat, &x_dist, &y_dist);
-<a name="l01022"></a>01022                 x_dist_corr = x_cat - x_dist;
-<a name="l01023"></a>01023                 y_dist_corr = y_cat - y_dist;
-<a name="l01024"></a>01024 
-<a name="l01025"></a>01025 
-<a name="l01026"></a>01026                 x_glob = x_dist_corr + x_cat_offset;
-<a name="l01027"></a>01027                 y_glob = y_dist_corr + y_cat_offset;
-<a name="l01028"></a>01028                 x_pos_values[imatch][icat] = x_glob;
-<a name="l01029"></a>01029                 y_pos_values[imatch][icat] = y_glob;
-<a name="l01030"></a>01030                 pos_flag[imatch][icat] = 1;
-<a name="l01031"></a>01031            }
-<a name="l01032"></a>01032            <span class="keywordflow">else</span>
-<a name="l01033"></a>01033                pos_flag[imatch][icat] = 0;
-<a name="l01034"></a>01034         }
-<a name="l01035"></a>01035 
-<a name="l01036"></a>01036         <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a>(x_pos_values[imatch], 
-<a name="l01037"></a>01037                                        y_pos_values[imatch], pos_flag[imatch],
-<a name="l01038"></a>01038                                        ncats, &nstddev, &var_x, &var_y);
-<a name="l01039"></a>01039         
-<a name="l01040"></a>01040         <span class="comment">//The rms is counted as many times as this star is the list of catalogs.</span>
-<a name="l01041"></a>01041         rms += sqrt(var_x + var_y) * nstddev;
-<a name="l01042"></a>01042         
-<a name="l01043"></a>01043     }
-<a name="l01044"></a>01044     cpl_free(x_cat_cols);
-<a name="l01045"></a>01045     cpl_free(y_cat_cols);
-<a name="l01046"></a>01046     <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)
-<a name="l01047"></a>01047     {
-<a name="l01048"></a>01048         cpl_free(x_pos_values[imatch]);
-<a name="l01049"></a>01049         cpl_free(y_pos_values[imatch]);
-<a name="l01050"></a>01050         cpl_free(pos_flag[imatch]);
-<a name="l01051"></a>01051     }
-<a name="l01052"></a>01052     cpl_free(x_pos_values);
-<a name="l01053"></a>01053     cpl_free(y_pos_values);
-<a name="l01054"></a>01054     cpl_free(pos_flag);
-<a name="l01055"></a>01055     cpl_free(match_arrays);
-<a name="l01056"></a>01056     
-<a name="l01057"></a>01057     <span class="keywordflow">return</span> rms;
-<a name="l01058"></a>01058 }
-<a name="l01059"></a>01059 
-<a name="l01060"></a>01060 <span class="preprocessor">#ifdef HAVE_LIBGSL</span>
-<a name="l01061"></a>01061 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01067"></a>01067 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01068"></a>01068 <span class="keywordtype">int</span> hawki_distortion_update_solution_from_param
-<a name="l01069"></a>01069 (hawki_distortion  * distortion,
-<a name="l01070"></a>01070  <span class="keyword">const</span> gsl_vector  * dist_param)
-<a name="l01071"></a>01071 {
-<a name="l01072"></a>01072     <span class="keywordtype">int</span>     ipoint;
-<a name="l01073"></a>01073     <span class="keywordtype">int</span>     ix;
-<a name="l01074"></a>01074     <span class="keywordtype">int</span>     iy;
-<a name="l01075"></a>01075     <span class="keywordtype">int</span>     nx;
-<a name="l01076"></a>01076     <span class="keywordtype">int</span>     ny;
-<a name="l01077"></a>01077     <span class="keywordtype">double</span>  x_dist_mean; 
-<a name="l01078"></a>01078     <span class="keywordtype">double</span>  y_dist_mean; 
-<a name="l01079"></a>01079     
-<a name="l01080"></a>01080     nx  = cpl_image_get_size_x(distortion->dist_x);
-<a name="l01081"></a>01081     ny  = cpl_image_get_size_y(distortion->dist_x);
-<a name="l01082"></a>01082     <span class="keywordflow">for</span>(ix = 0; ix < nx; ++ix)
-<a name="l01083"></a>01083         <span class="keywordflow">for</span>(iy = 0; iy < ny; ++iy)
-<a name="l01084"></a>01084         {
-<a name="l01085"></a>01085             ipoint = ix + iy * nx;
-<a name="l01086"></a>01086             cpl_image_set(distortion->dist_x, ix+1, iy+1, 
-<a name="l01087"></a>01087                           gsl_vector_get(dist_param, ipoint * 2));
-<a name="l01088"></a>01088             cpl_image_set(distortion->dist_y, ix+1, iy+1, 
-<a name="l01089"></a>01089                           gsl_vector_get(dist_param, ipoint * 2 + 1));
-<a name="l01090"></a>01090         }
-<a name="l01091"></a>01091     
-<a name="l01092"></a>01092     <span class="comment">/* Normalize to mean(distorsion) = 0 */</span>
-<a name="l01093"></a>01093     x_dist_mean = cpl_image_get_mean(distortion->dist_x);
-<a name="l01094"></a>01094     y_dist_mean = cpl_image_get_mean(distortion->dist_y);
-<a name="l01095"></a>01095     cpl_image_subtract_scalar(distortion->dist_x, x_dist_mean);
-<a name="l01096"></a>01096     cpl_image_subtract_scalar(distortion->dist_y, y_dist_mean);
-<a name="l01097"></a>01097 
-<a name="l01098"></a>01098     <span class="keywordflow">return</span> 0;
-<a name="l01099"></a>01099 }
-<a name="l01100"></a>01100 
-<a name="l01101"></a>01101 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01107"></a>01107 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01108"></a>01108 <span class="keywordtype">int</span> hawki_distortion_update_offsets_from_param
-<a name="l01109"></a>01109 (cpl_bivector      * offsets,
-<a name="l01110"></a>01110  <span class="keyword">const</span> gsl_vector  * dist_param)
-<a name="l01111"></a>01111 {
-<a name="l01112"></a>01112     <span class="keywordtype">int</span>     i;
-<a name="l01113"></a>01113     <span class="keywordtype">int</span>     ncats;
-<a name="l01114"></a>01114     <span class="keywordtype">int</span>     nparam;
-<a name="l01115"></a>01115     
-<a name="l01116"></a>01116     ncats  = cpl_bivector_get_size(offsets);
-<a name="l01117"></a>01117     nparam = dist_param->size;
-<a name="l01118"></a>01118     <span class="keywordflow">for</span>(i = 0; i < ncats; ++i)
-<a name="l01119"></a>01119     {
-<a name="l01120"></a>01120         cpl_vector_set(cpl_bivector_get_x(offsets), i,  
-<a name="l01121"></a>01121                        gsl_vector_get(dist_param, nparam - 2 * ncats + 2 * i));
-<a name="l01122"></a>01122         cpl_vector_set(cpl_bivector_get_y(offsets), i,  
-<a name="l01123"></a>01123                        gsl_vector_get(dist_param, nparam - 2 * ncats + 2 * i + 1));
-<a name="l01124"></a>01124     }
-<a name="l01125"></a>01125     
-<a name="l01126"></a>01126     <span class="keywordflow">return</span> 0;
-<a name="l01127"></a>01127 }
-<a name="l01128"></a>01128 
-<a name="l01129"></a>01129 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01135"></a>01135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01136"></a>01136 <span class="keywordtype">int</span> hawki_distortion_update_param_from_solution
-<a name="l01137"></a>01137 (gsl_vector              * dist_param,
-<a name="l01138"></a>01138  <span class="keyword">const</span> hawki_distortion  * distortion)
-<a name="l01139"></a>01139 {
-<a name="l01140"></a>01140     <span class="keywordtype">int</span>  ipoint;
-<a name="l01141"></a>01141     <span class="keywordtype">int</span>  ix;
-<a name="l01142"></a>01142     <span class="keywordtype">int</span>  iy;
-<a name="l01143"></a>01143     <span class="keywordtype">int</span>  nx;
-<a name="l01144"></a>01144     <span class="keywordtype">int</span>  ny;
-<a name="l01145"></a>01145     <span class="keywordtype">int</span>  isnull;
-<a name="l01146"></a>01146     
-<a name="l01147"></a>01147     nx  = cpl_image_get_size_x(distortion->dist_x);
-<a name="l01148"></a>01148     ny  = cpl_image_get_size_y(distortion->dist_y);
-<a name="l01149"></a>01149     <span class="keywordflow">for</span>(ix = 0; ix < nx; ++ix)
-<a name="l01150"></a>01150         <span class="keywordflow">for</span>(iy = 0; iy < ny; ++iy)
-<a name="l01151"></a>01151         {
-<a name="l01152"></a>01152             ipoint = ix + iy * nx;
-<a name="l01153"></a>01153             gsl_vector_set(dist_param, ipoint * 2, 
-<a name="l01154"></a>01154                            cpl_image_get(distortion->dist_x, ix+1, iy+1, &isnull));
-<a name="l01155"></a>01155             gsl_vector_set(dist_param, ipoint * 2 + 1, 
-<a name="l01156"></a>01156                            cpl_image_get(distortion->dist_y, ix+1, iy+1, &isnull));
-<a name="l01157"></a>01157     }
-<a name="l01158"></a>01158     
-<a name="l01159"></a>01159     <span class="keywordflow">return</span> 0;
-<a name="l01160"></a>01160 }
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01167"></a>01167 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01168"></a>01168 <span class="keywordtype">int</span> hawki_distortion_update_param_from_offsets
-<a name="l01169"></a>01169 (gsl_vector              * dist_param,
-<a name="l01170"></a>01170  <span class="keyword">const</span> cpl_bivector      * offsets)
-<a name="l01171"></a>01171 {
-<a name="l01172"></a>01172     <span class="keywordtype">int</span>     i;
-<a name="l01173"></a>01173     <span class="keywordtype">int</span>     ncats;
-<a name="l01174"></a>01174     <span class="keywordtype">int</span>     nparam;
-<a name="l01175"></a>01175     
-<a name="l01176"></a>01176     ncats  = cpl_bivector_get_size(offsets);
-<a name="l01177"></a>01177     nparam = dist_param->size;
-<a name="l01178"></a>01178     <span class="keywordflow">for</span>(i = 0; i < ncats; ++i)
-<a name="l01179"></a>01179     {
-<a name="l01180"></a>01180         gsl_vector_set(dist_param, nparam - 2 * ncats + 2 * i, 
-<a name="l01181"></a>01181                        cpl_vector_get(cpl_bivector_get_x_const(offsets), i));
-<a name="l01182"></a>01182         gsl_vector_set(dist_param, nparam - 2 * ncats + 2 * i + 1, 
-<a name="l01183"></a>01183                        cpl_vector_get(cpl_bivector_get_y_const(offsets), i));
-<a name="l01184"></a>01184     }
-<a name="l01185"></a>01185 
-<a name="l01186"></a>01186     <span class="keywordflow">return</span> 0;
-<a name="l01187"></a>01187 }
-<a name="l01188"></a>01188 <span class="preprocessor">#endif</span>
-<a name="l01189"></a>01189 <span class="preprocessor"></span>
-<a name="l01190"></a>01190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01196"></a>01196 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01197"></a>01197 <span class="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a>
-<a name="l01198"></a><a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968">01198</a> (<span class="keywordtype">double</span> * x_val, <span class="keywordtype">double</span> * y_val, <span class="keywordtype">int</span> *pos_flag,
-<a name="l01199"></a>01199  <span class="keywordtype">int</span> nvals, <span class="keywordtype">int</span> *nvalid, <span class="keywordtype">double</span> *var_x, <span class="keywordtype">double</span> *var_y)
-<a name="l01200"></a>01200 {
-<a name="l01201"></a>01201     <span class="keywordtype">double</span> varsum_x = 0.0;
-<a name="l01202"></a>01202     <span class="keywordtype">double</span> varsum_y = 0.0;
-<a name="l01203"></a>01203     <span class="keywordtype">double</span> mean_x = 0.0;
-<a name="l01204"></a>01204     <span class="keywordtype">double</span> mean_y = 0.0;
-<a name="l01205"></a>01205     <span class="keywordtype">int</span> i;
-<a name="l01206"></a>01206 
-<a name="l01207"></a>01207     *nvalid = 0;
-<a name="l01208"></a>01208     <span class="keywordflow">for</span> (i=0; i < nvals; i++)
-<a name="l01209"></a>01209     {
-<a name="l01210"></a>01210         <span class="keywordflow">if</span>(pos_flag[i] == 1)
-<a name="l01211"></a>01211         {
-<a name="l01212"></a>01212             <span class="keyword">const</span> <span class="keywordtype">double</span> delta_x = (double)x_val[i] - mean_x;
-<a name="l01213"></a>01213             <span class="keyword">const</span> <span class="keywordtype">double</span> delta_y = (double)y_val[i] - mean_y;
-<a name="l01214"></a>01214 
-<a name="l01215"></a>01215             varsum_x += *nvalid * delta_x * delta_x / (*nvalid + 1.0);
-<a name="l01216"></a>01216             varsum_y += *nvalid * delta_y * delta_y / (*nvalid + 1.0);
-<a name="l01217"></a>01217             mean_x   += delta_x / (*nvalid + 1.0);
-<a name="l01218"></a>01218             mean_y   += delta_y / (*nvalid + 1.0);
-<a name="l01219"></a>01219             (*nvalid)++;
-<a name="l01220"></a>01220         }
-<a name="l01221"></a>01221     }
-<a name="l01222"></a>01222 
-<a name="l01223"></a>01223     <span class="comment">/* Compute the bias-corrected standard deviation.</span>
-<a name="l01224"></a>01224 <span class="comment">       - With the recurrence relation rounding can likely not cause</span>
-<a name="l01225"></a>01225 <span class="comment">       the variance to become negative, but check just to be safe */</span>
-<a name="l01226"></a>01226     *var_x = varsum_x / (double) (*nvalid - 1);
-<a name="l01227"></a>01227     *var_y = varsum_y / (double) (*nvalid - 1);
-<a name="l01228"></a>01228 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_distortion.c,v 1.32 2011/02/23 11:49:37 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/02/23 11:49:37 $</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: hawki-1_8_12 $</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="comment">//Minimization algorithm hard-coded constants</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#define HAWKI_DISTORTION_MAX_ITER 10000</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_TOLERANCE 0.001</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_MAX_ITER2 100000</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_TOLERANCE2 0.0001</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor"></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">                                   Includes</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="preprocessor">#include <math.h></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 <cxdeque.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#ifdef HAVE_LIBGSL</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span><span class="preprocessor">#include <gsl/gsl_multimin.h></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#endif</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="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "hawki_load.h"</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> </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="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="l00069"></a><span class="lineno"><a class="code" href="struct__hawki__distortion__obj__function__args__.html">   69</a></span> <span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a></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> cpl_table   ** ref_catalogues;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <span class="keyword">const</span> cpl_table    * matching_sets;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_bivector       * offsets;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     hawki_distortion   * distortion;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="keywordtype">int</span>                  ncats;</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>     </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="comment">//Private functions</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> <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  <span class="keywordtype">double</span>                 * x_dist, </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>  <span class="keywordtype">double</span>                 * y_dist);</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> <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> (<span class="keyword">const</span> cpl_table    ** ref_catalogues,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keyword">const</span> cpl_bivector  * cat_offsets,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  <span class="keyword">const</span> cpl_table     * matching_sets,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  <span class="keywordtype">int</span>                   ncats,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  hawki_distortion    * distortion);</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">#ifdef HAVE_LIBGSL</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor"></span><span class="keywordtype">double</span> hawki_distortion_gsl_obj_function</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> (<span class="keyword">const</span> gsl_vector * dist_param,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  <span class="keywordtype">void</span>             * args);</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> hawki_distortion_update_solution_from_param</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> (hawki_distortion * distortion,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>  <span class="keyword">const</span> gsl_vector * dist_param);</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="keywordtype">int</span> hawki_distortion_update_offsets_from_param</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> (cpl_bivector      * offsets,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>  <span class="keyword">const</span> gsl_vector  * dist_param);</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">int</span> hawki_distortion_update_param_from_solution</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> (gsl_vector             * dist_param,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>  <span class="keyword">const</span> hawki_distortion * distortion);</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">int</span> hawki_distortion_update_param_from_offsets</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> (gsl_vector              * dist_param,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>  <span class="keyword">const</span> cpl_bivector      * offsets);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">#endif</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="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> (<span class="keywordtype">double</span> * x_val, <span class="keywordtype">double</span> * y_val, <span class="keywordtype">int</span> *pos_flag,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>  <span class="keywordtype">int</span> nvals, <span class="keywordtype">int</span> *nvalid, <span class="keywordtype">double</span> *var_x, <span class="keywordtype">double</span> *var_y);</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> hawki_distortion * <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a></div>
+<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d">  132</a></span> (<span class="keywordtype">int</span> detector_nx, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>  <span class="keywordtype">int</span> detector_ny, </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>  <span class="keywordtype">int</span> grid_size)</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>     hawki_distortion * distortion;</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">//Allocate the structure</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));</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">//Allocate the images</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     distortion->dist_x = cpl_image_new</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         (grid_size, grid_size, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     distortion->dist_y = cpl_image_new</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         (grid_size, grid_size, CPL_TYPE_FLOAT);</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">//Create the transformation between distortion images and the detector</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     distortion->x_cdelt = detector_nx / (double)grid_size; </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     distortion->y_cdelt = detector_ny / (double)grid_size;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     distortion->x_crval  = 0.5 + 0.5 * distortion->x_cdelt;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     distortion->y_crval  = 0.5 + 0.5 * distortion->y_cdelt;</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> distortion;</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="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> <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a></div>
+<div class="line"><a name="l00163"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712">  163</a></span> (hawki_distortion * distortion)</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>(distortion == NULL)</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>     cpl_image_delete(distortion->dist_x);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_image_delete(distortion->dist_y);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_free(distortion);</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">  181</span> hawki_distortion * <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a></div>
+<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7">  182</a></span> (<span class="keyword">const</span> cpl_frame * dist_x,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>  <span class="keyword">const</span> cpl_frame * dist_y,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>  <span class="keywordtype">int</span>               idet)</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="keyword">const</span> <span class="keywordtype">char</span>       * file_dist_x;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       * file_dist_y;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     hawki_distortion * distortion;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordtype">int</span>                iext;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     cpl_propertylist * plist;</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">//Allocate the structure</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));</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">//Read the images</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     file_dist_x = cpl_frame_get_filename(dist_x);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     file_dist_y = cpl_frame_get_filename(dist_y);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     distortion->dist_x = <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         (dist_x, idet, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     distortion->dist_y = <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>         (dist_y, idet, CPL_TYPE_FLOAT);</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">//Read the WCS keywords</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     iext = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(file_dist_x, idet);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     plist = cpl_propertylist_load(file_dist_x, iext);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     distortion->x_crval = cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</span>);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     distortion->x_cdelt = cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT1"</span>);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     distortion->y_crval = cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</span>);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     distortion->y_cdelt = cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT2"</span>);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordflow">if</span>(cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</span>) != 1 ||</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</span>) != 1)</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_error_set_message_macro(cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                                     __FILE__, __LINE__,<span class="stringliteral">"Wrong CRPIX? keywords"</span>);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         cpl_image_delete(distortion->dist_x);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>         cpl_image_delete(distortion->dist_y);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         cpl_free(distortion);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         <span class="keywordflow">return</span> 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>     cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="comment">//Check that the keywords in X and Y are compatibles;</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     plist = cpl_propertylist_load(file_dist_y, iext);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">if</span>(distortion->x_crval != cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</span>) ||</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>        distortion->x_cdelt != cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT1"</span>) ||</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>        distortion->y_crval != cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</span>) ||</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>        distortion->y_cdelt != cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELT2"</span>) ||</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</span>) != 1 ||</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>        cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</span>) != 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>         cpl_error_set_message_macro(cpl_func, CPL_ERROR_ILLEGAL_INPUT, __FILE__,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                 __LINE__,<span class="stringliteral">"WCS keywords mismatch in X and Y distortions"</span>);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         cpl_image_delete(distortion->dist_x);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         cpl_image_delete(distortion->dist_y);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>         cpl_free(distortion);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>         <span class="keywordflow">return</span> 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>     cpl_propertylist_delete(plist);</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> distortion;</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="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="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a></div>
+<div class="line"><a name="l00252"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345">  252</a></span> (<span class="keyword">const</span> hawki_distortion * distortion)</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>(distortion == 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_error_set(__func__,CPL_ERROR_ILLEGAL_INPUT);</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">return</span> cpl_image_get_size_x(distortion->dist_x);</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="l00261"></a><span class="lineno">  261</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a></div>
+<div class="line"><a name="l00269"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c">  269</a></span> (<span class="keyword">const</span> hawki_distortion * distortion)</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">if</span>(distortion == 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>         cpl_error_set(__func__,CPL_ERROR_ILLEGAL_INPUT);</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">return</span> cpl_image_get_size_y(distortion->dist_x);</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> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a></div>
+<div class="line"><a name="l00287"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484">  287</a></span> (cpl_image        ** ilist,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>  <span class="keyword">const</span> cpl_frame   * frame_dist_x,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>  <span class="keyword">const</span> cpl_frame   * frame_dist_y)</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_image        *   corr[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     hawki_distortion *   distortion;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_image        *   dist_x;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_image        *   dist_y;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordtype">int</span>                  idet, j ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">if</span> (frame_dist_x == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">if</span> (frame_dist_y == NULL) <span class="keywordflow">return</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>     <span class="comment">/* Loop on the 4 chips */</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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="keywordtype">int</span> nx;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         <span class="keywordtype">int</span> ny;</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">/* Get the image size */</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         nx = cpl_image_get_size_x(ilist[idet]);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         ny = cpl_image_get_size_y(ilist[idet]);</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">/* Load the distortion */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>         <span class="keywordflow">if</span> ((distortion = <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                  (frame_dist_x, frame_dist_y, idet + 1)) == NULL) </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_msg_error(__func__, <span class="stringliteral">"Cannot load the distortion for chip %d"</span>, </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                     idet+1) ;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             <span class="keywordflow">for</span> (j=0 ; j<idet ; j++) cpl_image_delete(corr[j]) ;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>             <span class="keywordflow">return</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> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         <span class="comment">/* Create the offsets images */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         dist_x = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         dist_y = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>         <span class="keywordflow">if</span> (hawki_distortion_create_maps_detector</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                 (distortion, dist_x, dist_y))</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_msg_error(__func__, <span class="stringliteral">"Cannot create the distortion maps"</span>) ;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             cpl_image_delete(dist_x);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             cpl_image_delete(dist_y);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>             <span class="keywordflow">for</span> (j=0 ; j<idet ; j++) cpl_image_delete(corr[j]) ;</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> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         <span class="comment">/* Correct this image */</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         corr[idet] = <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>(ilist[idet], dist_x, dist_y);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         <span class="keywordflow">if</span>(corr[idet] == NULL)</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_msg_error(__func__, <span class="stringliteral">"Cannot correct the distortion"</span>) ;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>             cpl_image_delete(dist_x);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             cpl_image_delete(dist_y);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             <span class="keywordflow">for</span> (j=0 ; j<idet; j++) cpl_image_delete(corr[j]) ;</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>         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         cpl_image_delete(dist_x) ;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         cpl_image_delete(dist_y);</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="comment">/* Store the results */</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_image_delete(ilist[idet]) ;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         ilist[idet] = corr[idet] ;</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> cpl_image *  <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a></div>
+<div class="line"><a name="l00371"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c">  371</a></span> (cpl_image       *  image,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>  cpl_image       *  dist_x,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>  cpl_image       *  dist_y)</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_image       *   corr;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     cpl_vector      *   profile ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordflow">if</span> (image  == NULL) <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> 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="comment">/* Create the output image */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     corr = cpl_image_new(cpl_image_get_size_x(image),</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                          cpl_image_get_size_y(image), CPL_TYPE_FLOAT) ;</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">/* Create the interpolation profile */</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     profile = cpl_vector_new(CPL_KERNEL_DEF_SAMPLES) ;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     cpl_vector_fill_kernel_profile(profile, CPL_KERNEL_DEFAULT,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                    CPL_KERNEL_DEF_WIDTH) ;</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">/* Apply the distortion */</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordflow">if</span> (cpl_image_warp(corr, image, dist_x, dist_y, profile, </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                        CPL_KERNEL_DEF_WIDTH, profile, </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                        CPL_KERNEL_DEF_WIDTH) != CPL_ERROR_NONE) </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_msg_error(__func__, <span class="stringliteral">"Cannot warp the image"</span>) ;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         cpl_image_delete(corr) ;</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         cpl_vector_delete(profile) ;</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>     cpl_vector_delete(profile) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="keywordflow">return</span> corr;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e" title="Apply the distortion correction to one detector position.">hawki_distortion_correct_coords</a></div>
+<div class="line"><a name="l00423"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e">  423</a></span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>  <span class="keywordtype">double</span>                 * x_pos_distcorr, </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>  <span class="keywordtype">double</span>                 * y_pos_distcorr)</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">double</span> x_dist;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keywordtype">double</span> y_dist;</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>(distortion == 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_error_set(<span class="stringliteral">"hawki_distortion_correct_coords"</span>, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         <span class="keywordflow">return</span> -1;</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>     <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         (distortion, x_pos, y_pos, &x_dist, &y_dist);</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>     *x_pos_distcorr = x_pos - x_dist;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     *y_pos_distcorr = y_pos - y_dist;</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">return</span> 0;</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>     </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</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">int</span> <a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3" title="Apply the inverse distortion correction to one detector position.">hawki_distortion_inverse_correct_coords</a></div>
+<div class="line"><a name="l00467"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3">  467</a></span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>  <span class="keywordtype">double</span>                 * x_pos_distinvcorr, </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>  <span class="keywordtype">double</span>                 * y_pos_distinvcorr)</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="keywordtype">double</span> x_dist = 0;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <span class="keywordtype">double</span> y_dist = 0;</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>     <span class="keywordtype">int</span>    niter = 3;</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">if</span>(distortion == NULL)</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_error_set(<span class="stringliteral">"hawki_distortion_inverse_correct_coords"</span>, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         <span class="keywordflow">return</span> -1;</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">for</span>(i = 0; i < niter; ++i)</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>         <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>             (distortion, x_pos + x_dist, y_pos + y_dist, &x_dist, &y_dist);</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>     </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     <span class="comment">/* Apply the correction in the inverse direction */</span></div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     *x_pos_distinvcorr = x_pos + x_dist;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     *y_pos_distinvcorr = y_pos + y_dist;</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">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l00526"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d">  526</a></span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>  <span class="keywordtype">double</span>                 * x_dist, </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>  <span class="keywordtype">double</span>                 * y_dist)</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>             ix1;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordtype">int</span>             ix2;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordtype">int</span>             iy1;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordtype">int</span>             iy2;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordtype">int</span>             nx;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordtype">int</span>             ny;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keywordtype">double</span>          x1_pos;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordtype">double</span>          x2_pos;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordtype">double</span>          y1_pos;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordtype">double</span>          y2_pos;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     <span class="keywordtype">double</span>          dx11;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordtype">double</span>          dx12;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     <span class="keywordtype">double</span>          dx21;</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordtype">double</span>          dx22;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordtype">double</span>          dy11;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keywordtype">double</span>          dy12;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keywordtype">double</span>          dy21;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordtype">double</span>          dy22;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordtype">int</span>             isnull;</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">/* Get the size of the distortion images */</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     nx = cpl_image_get_size_x(distortion->dist_x);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     ny = cpl_image_get_size_y(distortion->dist_x);</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="comment">//This uses bilinear interpolation</span></div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="comment">//Get lower left corner. This assumes CRPIX? =1 and ix, iy start with 0</span></div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     ix1 = (int)floor((x_pos - distortion->x_crval)/distortion->x_cdelt);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     iy1 = (int)floor((y_pos - distortion->y_crval)/distortion->y_cdelt);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     <span class="comment">//Handle extrapolation</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="keywordflow">if</span>(ix1 < 0)</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         ix1 = 0;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span>(ix1 >= nx - 1)</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         ix1 = nx - 2;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordflow">if</span>(iy1 < 0)</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         iy1 = 0;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">if</span>(iy1 >= ny - 1)</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         iy1 = ny - 2;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="comment">//Get upper right corner</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     ix2 = ix1 + 1;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     iy2 = iy1 + 1;</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="comment">//Get the position values</span></div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <span class="comment">//This implies that CRPIX? = 1 and that ix, iy start at 0.</span></div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     x1_pos = ix1 * distortion->x_cdelt + distortion->x_crval; </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     x2_pos = ix2 * distortion->x_cdelt + distortion->x_crval; </div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     y1_pos = iy1 * distortion->y_cdelt + distortion->y_crval; </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     y2_pos = iy2 * distortion->y_cdelt + distortion->y_crval; </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="comment">//Get the values used to interpolate</span></div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="comment">//The +1 is because cpl_image_get uses FITS convention</span></div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     dx11 = cpl_image_get(distortion->dist_x, ix1 + 1, iy1 + 1, &isnull);  </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     dx21 = cpl_image_get(distortion->dist_x, ix2 + 1, iy1 + 1, &isnull);  </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     dx12 = cpl_image_get(distortion->dist_x, ix1 + 1, iy2 + 1, &isnull);  </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     dx22 = cpl_image_get(distortion->dist_x, ix2 + 1, iy2 + 1, &isnull);  </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     dy11 = cpl_image_get(distortion->dist_y, ix1 + 1, iy1 + 1, &isnull);  </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     dy21 = cpl_image_get(distortion->dist_y, ix2 + 1, iy1 + 1, &isnull);  </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     dy12 = cpl_image_get(distortion->dist_y, ix1 + 1, iy2 + 1, &isnull);  </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     dy22 = cpl_image_get(distortion->dist_y, ix2 + 1, iy2 + 1, &isnull);  </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="comment">//Compute the final values</span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     *x_dist = dx11 * (x2_pos - x_pos) * (y2_pos - y_pos) +</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>               dx21 * (x_pos - x1_pos) * (y2_pos - y_pos) +</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>               dx12 * (x2_pos - x_pos) * (y_pos - y1_pos) +</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>               dx22 * (x_pos - x1_pos) * (y_pos - y1_pos);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     *x_dist = *x_dist / (x2_pos -x1_pos) / (y2_pos -y1_pos);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     *y_dist = dy11 * (x2_pos - x_pos) * (y2_pos - y_pos) +</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>               dy21 * (x_pos - x1_pos) * (y2_pos - y_pos) +</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>               dy12 * (x2_pos - x_pos) * (y_pos - y1_pos) +</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>               dy22 * (x_pos - x1_pos) * (y_pos - y1_pos);</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     *y_dist = *y_dist / (x2_pos -x1_pos) / (y2_pos -y1_pos);</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">return</span> 0;</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> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a></div>
+<div class="line"><a name="l00617"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f">  617</a></span> (cpl_imagelist   *   ilist, </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>  cpl_image       **  dist_x,</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>  cpl_image       **  dist_y)</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_image       *   corr[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordtype">int</span>                 i, j ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     <span class="keywordflow">if</span> (ilist == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Loop on the 4 chips */</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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>         cpl_image * cur_image;</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">/* Get the current image */</span></div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         cur_image = cpl_imagelist_get(ilist, i);</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">/* Correct this image */</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         corr[i] = <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>(cur_image,dist_x[i],dist_y[i]);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         <span class="keywordflow">if</span>(corr[i] == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct the distortion"</span>) ;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>             <span class="keywordflow">for</span> (j=0 ; j<i ; j++) cpl_image_delete(corr[j]) ;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>             <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Store the results */</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>         cpl_imagelist_set(ilist, corr[i], 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>     <span class="comment">/* Return */</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 class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</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="keywordtype">int</span> hawki_distortion_create_maps_detector</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> (<span class="keyword">const</span> hawki_distortion * distortion,</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>  cpl_image              * dist_x,</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>  cpl_image              * dist_y)</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>              *   pdx;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordtype">double</span>              *   pdy;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordtype">int</span>                     nx, ny;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keywordtype">int</span>                     pos;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordtype">int</span>                     i, j;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="keywordflow">if</span> (distortion == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <span class="keywordflow">if</span> (dist_x == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keywordflow">if</span> (dist_y == NULL) <span class="keywordflow">return</span> -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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     nx = cpl_image_get_size_x(dist_x) ;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     ny = cpl_image_get_size_y(dist_x) ;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keywordflow">if</span> (cpl_image_get_size_x(dist_y) != nx) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordflow">if</span> (cpl_image_get_size_y(dist_y) != ny) <span class="keywordflow">return</span> -1 ;</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">/* Access to the data */</span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     pdx = cpl_image_get_data_double(dist_x) ;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     pdy = cpl_image_get_data_double(dist_y) ;</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="comment">/* Loop on the pixels */</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <span class="keywordflow">for</span> (j=0 ; j<ny ; j++) {</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         <span class="keywordflow">for</span> (i=0 ; i<nx ; i++) {</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>             <span class="keywordtype">double</span> x_dist;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>             <span class="keywordtype">double</span> y_dist;</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>             pos = i+j*nx ;</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__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                 (distortion, (<span class="keywordtype">double</span>)i, (<span class="keywordtype">double</span>)j, &x_dist, &y_dist);</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>             pdx[pos] = x_dist;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>             pdy[pos] = y_dist;</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>     }</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">return</span> 0 ; </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> <span class="comment">/*----------------------------------------------------------------------------*/</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> hawki_distortion *  hawki_distortion_compute_solution</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> (<span class="keyword">const</span> cpl_table       ** ref_catalogues,</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>  <span class="keyword">const</span> cpl_bivector     * initial_offsets,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>  <span class="keyword">const</span> cpl_table        * matching_sets,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>  <span class="keywordtype">int</span>                      ncats,</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>  <span class="keywordtype">int</span>                      detector_nx,</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>  <span class="keywordtype">int</span>                      detector_ny,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>  <span class="keywordtype">int</span>                      grid_size,</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>  <span class="keyword">const</span> hawki_distortion * initial_guess,</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>  <span class="keywordtype">double</span>                 * rms)</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="preprocessor">#ifdef HAVE_LIBGSL</span></div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> <span class="preprocessor"></span>    </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     hawki_distortion                          * distortion;</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     cpl_bivector                              * offsets;</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     gsl_multimin_fminimizer                   * minimizer;</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     gsl_vector                                * step_size;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     gsl_vector                                * init_param;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     gsl_multimin_function                       minimize_function;</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="keywordtype">int</span>                                         nfitparam = 0;</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     <span class="keywordtype">int</span>                                         iparam;</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     <span class="keywordtype">double</span>                                      tolerance = HAWKI_DISTORTION_TOLERANCE;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     <span class="keywordtype">double</span>                                      tolerance2 = HAWKI_DISTORTION_TOLERANCE2;</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     <span class="keywordtype">int</span>                                         minimizer_status;</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     <span class="keywordtype">int</span>                                         iter = 0;</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     <span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a> args;</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">/* Initialize the distortion solution */</span></div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     <span class="keywordflow">if</span>(initial_guess == 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>         distortion = <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a></div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>             (detector_nx, detector_ny, grid_size);</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">else</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>         distortion = cpl_malloc(<span class="keyword">sizeof</span>(hawki_distortion));</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         distortion->dist_x  = cpl_image_duplicate(initial_guess->dist_x);</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         distortion->dist_y  = cpl_image_duplicate(initial_guess->dist_y);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         distortion->x_cdelt = initial_guess->x_cdelt;</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         distortion->x_crval = initial_guess->x_crval;</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>         distortion->y_cdelt = initial_guess->y_cdelt;</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>         distortion->y_crval = initial_guess->y_crval;</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         <span class="comment">//We have to fit all the distortion coefficients plus</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         <span class="comment">//the offsets of the catalogues</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>     <span class="comment">//We have to fit all the distortion coefficients plus</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="comment">//the offsets of the catalogues</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     nfitparam = grid_size * grid_size * 2 + ncats * 2;</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     offsets = cpl_bivector_duplicate(initial_offsets);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     <span class="keywordflow">if</span>(cpl_table_get_nrow(matching_sets) * 2 < nfitparam)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Too few matches to compute distortion (< %d)"</span>,</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>                       nfitparam);</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     <span class="comment">/* Setup function to minimize */</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     args.ref_catalogues = ref_catalogues;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     args.matching_sets  = matching_sets;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     args.distortion     = distortion;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     args.offsets        = offsets;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     args.ncats          = ncats;</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>     minimize_function.f      = hawki_distortion_gsl_obj_function;</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     minimize_function.n      = nfitparam;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     minimize_function.params = &args;</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">/* Setup minimizer */</span></div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     minimizer = gsl_multimin_fminimizer_alloc</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         (gsl_multimin_fminimizer_nmsimplex, nfitparam);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     step_size = gsl_vector_alloc(nfitparam);</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     init_param = gsl_vector_alloc(nfitparam);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     <span class="keywordflow">for</span>(iparam = 0; iparam < grid_size * grid_size * 2; ++iparam)</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         gsl_vector_set(step_size, iparam, 5);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="keywordflow">for</span>(iparam = grid_size * grid_size * 2;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>         iparam < nfitparam; ++iparam)</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>         gsl_vector_set(step_size, iparam, 1);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     hawki_distortion_update_param_from_solution(init_param, distortion);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     hawki_distortion_update_param_from_offsets(init_param, offsets);</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     gsl_multimin_fminimizer_set(minimizer, &minimize_function,</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                                 init_param, step_size);</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>     <span class="keywordflow">do</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>         ++iter;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         minimizer_status = gsl_multimin_fminimizer_iterate (minimizer);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         <span class="keywordflow">if</span>(minimizer_status)</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         minimizer_status = gsl_multimin_test_size</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>             (gsl_multimin_fminimizer_size(minimizer), tolerance);</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>         cpl_msg_debug(__func__,<span class="stringliteral">"Iteration %d Minimum: %g"</span>,</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                       iter, gsl_multimin_fminimizer_minimum(minimizer));</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">while</span> (minimizer_status == GSL_CONTINUE && iter < HAWKI_DISTORTION_MAX_ITER);</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>     cpl_msg_warning(__func__, <span class="stringliteral">"rms before computing %f"</span>, <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, </div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                                         matching_sets, ncats, distortion));</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="comment">//Do it again to avoid local minimum</span></div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     gsl_multimin_fminimizer_set(minimizer, &minimize_function,</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>                                 gsl_multimin_fminimizer_x(minimizer), step_size);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     iter = 0;</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     <span class="keywordflow">do</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>         ++iter;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>         minimizer_status = gsl_multimin_fminimizer_iterate (minimizer);</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         <span class="keywordflow">if</span>(minimizer_status)</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         minimizer_status = gsl_multimin_test_size</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             (gsl_multimin_fminimizer_size(minimizer), tolerance2);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>         cpl_msg_debug(__func__,<span class="stringliteral">"2nd run Iteration %d Minimum: %g"</span>,</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>                       iter, gsl_multimin_fminimizer_minimum(minimizer));</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="keywordflow">while</span> (minimizer_status == GSL_CONTINUE && iter < HAWKI_DISTORTION_MAX_ITER2);</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="comment">/* Update the distortion solution */</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>     hawki_distortion_update_solution_from_param</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         (distortion, gsl_multimin_fminimizer_x(minimizer));</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     hawki_distortion_update_offsets_from_param</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>         (offsets, gsl_multimin_fminimizer_x(minimizer));</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>     *rms = <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>                                         matching_sets, ncats, distortion);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     gsl_multimin_fminimizer_free(minimizer);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     gsl_vector_free(init_param);</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     gsl_vector_free(step_size);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     cpl_bivector_delete(offsets);</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">return</span> distortion;</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> <span class="preprocessor"></span>    cpl_msg_error(__func__,<span class="stringliteral">"Not compiled with GSL support."</span>);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span> <span class="preprocessor"></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="preprocessor">#ifdef HAVE_LIBGSL</span></div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> <span class="keywordtype">double</span> hawki_distortion_gsl_obj_function</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span> (<span class="keyword">const</span> gsl_vector * dist_param,</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>  <span class="keywordtype">void</span>             * args)</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="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a>  args_struct;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>     <span class="keyword">const</span> cpl_table                           ** ref_catalogues;</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>     <span class="keyword">const</span> cpl_table                            * matching_sets;</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     hawki_distortion                           * distortion;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     cpl_bivector                               * offsets;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     <span class="keywordtype">int</span>                                          ncats;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     <span class="keywordtype">double</span>                                       rms;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     <span class="keywordtype">double</span>                                       objective_function;</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>     args_struct    = *(<span class="keyword">struct </span><a class="code" href="struct__hawki__distortion__obj__function__args__.html">_hawki_distortion_obj_function_args_</a> * )args;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     ref_catalogues = args_struct.ref_catalogues; </div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     matching_sets  = args_struct.matching_sets; </div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     distortion     = args_struct.distortion;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     offsets        = args_struct.offsets;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     ncats          = args_struct.ncats; </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>     hawki_distortion_update_solution_from_param(distortion, dist_param);</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     hawki_distortion_update_offsets_from_param(offsets, dist_param);</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>     rms = <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a>(ref_catalogues, offsets, </div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>                                        matching_sets, ncats, distortion);</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>     objective_function = rms; </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>     cpl_msg_debug(__func__,<span class="stringliteral">"Objective function: %g"</span>, objective_function);</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>     <span class="keywordflow">return</span> objective_function;</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="preprocessor">#endif</span></div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea" title="This private function computes the rms, which is the objective function of the minimization algorithm...">hawki_distortion_compute_rms</a></div>
+<div class="line"><a name="l00930"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#ga8a38c008060d64d9e62198505617e5ea">  930</a></span> (<span class="keyword">const</span> cpl_table   ** ref_catalogues,</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>  <span class="keyword">const</span> cpl_bivector * cat_offsets,</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>  <span class="keyword">const</span> cpl_table    * matching_sets,</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>  <span class="keywordtype">int</span>                  ncats,</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>  hawki_distortion   * distortion)</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="keywordtype">int</span>                icat;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>     <span class="keywordtype">int</span>                imatch;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     <span class="keywordtype">int</span>                nmatch;</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     <span class="keywordtype">double</span>             rms = 0;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>     * x_cat_offsets;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>     * y_cat_offsets;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>    ** x_cat_cols; </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>    ** y_cat_cols;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>     <span class="keyword">const</span> cpl_array ** match_arrays;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     <span class="keywordtype">double</span>          ** x_pos_values;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>     <span class="keywordtype">double</span>          ** y_pos_values;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     <span class="keywordtype">int</span>             ** pos_flag;</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>     </div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     nmatch = cpl_table_get_nrow(matching_sets);</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>     x_cat_offsets = cpl_vector_get_data_const</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>         (cpl_bivector_get_x_const(cat_offsets));</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     y_cat_offsets = cpl_vector_get_data_const</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         (cpl_bivector_get_y_const(cat_offsets));</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>     x_cat_cols = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * ncats);</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     y_cat_cols = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * ncats);</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     <span class="keywordflow">for</span>(icat = 0; icat < ncats; ++icat)</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>         x_cat_cols[icat] = cpl_table_get_data_double_const(ref_catalogues[icat],</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>                                                            HAWKI_COL_OBJ_POSX);</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>         y_cat_cols[icat] = cpl_table_get_data_double_const(ref_catalogues[icat],</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>                                                            HAWKI_COL_OBJ_POSY);</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>     match_arrays = cpl_malloc(<span class="keyword">sizeof</span>(cpl_array *) * nmatch);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>     x_pos_values = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * nmatch);</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     y_pos_values = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span> *) * nmatch);</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>     pos_flag     = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span> *) * nmatch);</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>     <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)</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>         match_arrays[imatch] = cpl_table_get_array(matching_sets, </div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>                 HAWKI_COL_MATCHING_SETS, imatch);</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>         x_pos_values[imatch] = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * ncats);</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>         y_pos_values[imatch] = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * ncats);</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>         pos_flag[imatch]     = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * ncats);</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> </div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span> <span class="preprocessor">#ifdef _OPENMP    </span></div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> <span class="preprocessor"></span><span class="preprocessor">#pragma omp parallel for  private(icat,imatch) reduction(+:rms)</span></div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span> <span class="preprocessor"></span><span class="preprocessor">#endif    </span></div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span> <span class="preprocessor"></span>    <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)</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="keywordtype">int</span>                 nstddev;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>         <span class="keywordtype">double</span>              var_x;</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         <span class="keywordtype">double</span>              var_y;</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>(icat = 0; icat < ncats; ++icat)</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="keywordtype">int</span>    iobj;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>             <span class="keywordtype">double</span> x_cat_offset;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             <span class="keywordtype">double</span> y_cat_offset;</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>             x_cat_offset = x_cat_offsets[icat];</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>             y_cat_offset = y_cat_offsets[icat];            </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>             <span class="keywordflow">if</span>((iobj = cpl_array_get(match_arrays[imatch], icat, NULL)) != -1)</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="keywordtype">double</span> x_cat;</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                 <span class="keywordtype">double</span> y_cat;</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                 <span class="keywordtype">double</span> x_dist_corr;</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                 <span class="keywordtype">double</span> y_dist_corr;</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>                 <span class="keywordtype">double</span> x_dist;</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>                 <span class="keywordtype">double</span> y_dist;</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>                 <span class="keywordtype">double</span> x_glob;</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>                 <span class="keywordtype">double</span> y_glob;</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>                 x_cat = x_cat_cols[icat][iobj];</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>                 y_cat = y_cat_cols[icat][iobj];</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>                 <span class="comment">//These 4 lines of code are from hawki_distortion_correct_coords.</span></div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>                 <span class="comment">//The are repeated here to avoid a cpl call, which is not thread-safe</span></div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>                 <span class="comment">//Two checks to ensure thread-safety:</span></div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>                 <span class="comment">//We have ensured outside the loop that distortion->dist_x and</span></div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>                 <span class="comment">//distortion->dist_y are not null. </span></div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>                 <span class="comment">//We have checked outside the loop the mask has all the points valid</span></div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>                 <a class="code" href="group__hawki__distortion.html#ga27bd7baaf0df89d1d58b69968638b14d" title="Interpolates the distortion solution at a given position.">hawki_distortion_interpolate_distortion</a></div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>                     (distortion, x_cat, y_cat, &x_dist, &y_dist);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>                 x_dist_corr = x_cat - x_dist;</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>                 y_dist_corr = y_cat - y_dist;</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> </div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                 x_glob = x_dist_corr + x_cat_offset;</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>                 y_glob = y_dist_corr + y_cat_offset;</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>                 x_pos_values[imatch][icat] = x_glob;</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>                 y_pos_values[imatch][icat] = y_glob;</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>                 pos_flag[imatch][icat] = 1;</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">else</span></div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>                pos_flag[imatch][icat] = 0;</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> </div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a>(x_pos_values[imatch], </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>                                        y_pos_values[imatch], pos_flag[imatch],</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                                        ncats, &nstddev, &var_x, &var_y);</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">//The rms is counted as many times as this star is the list of catalogs.</span></div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         rms += sqrt(var_x + var_y) * nstddev;</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>     cpl_free(x_cat_cols);</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>     cpl_free(y_cat_cols);</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     <span class="keywordflow">for</span>(imatch = 0; imatch < nmatch; ++imatch)</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_free(x_pos_values[imatch]);</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>         cpl_free(y_pos_values[imatch]);</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>         cpl_free(pos_flag[imatch]);</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>     cpl_free(x_pos_values);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>     cpl_free(y_pos_values);</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>     cpl_free(pos_flag);</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>     cpl_free(match_arrays);</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">return</span> rms;</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> </div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> <span class="preprocessor">#ifdef HAVE_LIBGSL</span></div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span> <span class="keywordtype">int</span> hawki_distortion_update_solution_from_param</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> (hawki_distortion  * distortion,</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>  <span class="keyword">const</span> gsl_vector  * dist_param)</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>     <span class="keywordtype">int</span>     ipoint;</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>     <span class="keywordtype">int</span>     ix;</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     <span class="keywordtype">int</span>     iy;</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>     <span class="keywordtype">int</span>     nx;</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>     <span class="keywordtype">int</span>     ny;</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     <span class="keywordtype">double</span>  x_dist_mean; </div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     <span class="keywordtype">double</span>  y_dist_mean; </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>     nx  = cpl_image_get_size_x(distortion->dist_x);</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>     ny  = cpl_image_get_size_y(distortion->dist_x);</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>     <span class="keywordflow">for</span>(ix = 0; ix < nx; ++ix)</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>         <span class="keywordflow">for</span>(iy = 0; iy < ny; ++iy)</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>             ipoint = ix + iy * nx;</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>             cpl_image_set(distortion->dist_x, ix+1, iy+1, </div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>                           gsl_vector_get(dist_param, ipoint * 2));</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>             cpl_image_set(distortion->dist_y, ix+1, iy+1, </div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>                           gsl_vector_get(dist_param, ipoint * 2 + 1));</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="comment">/* Normalize to mean(distorsion) = 0 */</span></div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>     x_dist_mean = cpl_image_get_mean(distortion->dist_x);</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     y_dist_mean = cpl_image_get_mean(distortion->dist_y);</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     cpl_image_subtract_scalar(distortion->dist_x, x_dist_mean);</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>     cpl_image_subtract_scalar(distortion->dist_y, y_dist_mean);</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">return</span> 0;</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> </div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span> <span class="keywordtype">int</span> hawki_distortion_update_offsets_from_param</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> (cpl_bivector      * offsets,</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>  <span class="keyword">const</span> gsl_vector  * dist_param)</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="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>     <span class="keywordtype">int</span>     ncats;</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>     <span class="keywordtype">int</span>     nparam;</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>     ncats  = cpl_bivector_get_size(offsets);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>     nparam = dist_param->size;</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>     <span class="keywordflow">for</span>(i = 0; i < ncats; ++i)</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_vector_set(cpl_bivector_get_x(offsets), i,  </div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>                        gsl_vector_get(dist_param, nparam - 2 * ncats + 2 * i));</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>         cpl_vector_set(cpl_bivector_get_y(offsets), i,  </div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>                        gsl_vector_get(dist_param, nparam - 2 * ncats + 2 * i + 1));</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>     </div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>     <span class="keywordflow">return</span> 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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span> <span class="keywordtype">int</span> hawki_distortion_update_param_from_solution</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span> (gsl_vector              * dist_param,</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>  <span class="keyword">const</span> hawki_distortion  * distortion)</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="keywordtype">int</span>  ipoint;</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     <span class="keywordtype">int</span>  ix;</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     <span class="keywordtype">int</span>  iy;</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     <span class="keywordtype">int</span>  nx;</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     <span class="keywordtype">int</span>  ny;</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     <span class="keywordtype">int</span>  isnull;</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>     nx  = cpl_image_get_size_x(distortion->dist_x);</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>     ny  = cpl_image_get_size_y(distortion->dist_y);</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>     <span class="keywordflow">for</span>(ix = 0; ix < nx; ++ix)</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>         <span class="keywordflow">for</span>(iy = 0; iy < ny; ++iy)</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>             ipoint = ix + iy * nx;</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>             gsl_vector_set(dist_param, ipoint * 2, </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>                            cpl_image_get(distortion->dist_x, ix+1, iy+1, &isnull));</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>             gsl_vector_set(dist_param, ipoint * 2 + 1, </div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>                            cpl_image_get(distortion->dist_y, ix+1, iy+1, &isnull));</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>     </div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>     <span class="keywordflow">return</span> 0;</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="l01167"></a><span class="lineno"> 1167</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span> <span class="keywordtype">int</span> hawki_distortion_update_param_from_offsets</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span> (gsl_vector              * dist_param,</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>  <span class="keyword">const</span> cpl_bivector      * offsets)</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="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>     <span class="keywordtype">int</span>     ncats;</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>     <span class="keywordtype">int</span>     nparam;</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>     ncats  = cpl_bivector_get_size(offsets);</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     nparam = dist_param->size;</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>     <span class="keywordflow">for</span>(i = 0; i < ncats; ++i)</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>         gsl_vector_set(dist_param, nparam - 2 * ncats + 2 * i, </div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                        cpl_vector_get(cpl_bivector_get_x_const(offsets), i));</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         gsl_vector_set(dist_param, nparam - 2 * ncats + 2 * i + 1, </div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                        cpl_vector_get(cpl_bivector_get_y_const(offsets), i));</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> </div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>     <span class="keywordflow">return</span> 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> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968" title="Compute the standard deviation of two vectors, not using flagged values.">hawki_distortion_get_flag_vars</a></div>
+<div class="line"><a name="l01198"></a><span class="lineno"><a class="code" href="group__hawki__distortion.html#gaa7dc1bd3e8cd954c453ecfdf2b0fe968"> 1198</a></span> (<span class="keywordtype">double</span> * x_val, <span class="keywordtype">double</span> * y_val, <span class="keywordtype">int</span> *pos_flag,</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>  <span class="keywordtype">int</span> nvals, <span class="keywordtype">int</span> *nvalid, <span class="keywordtype">double</span> *var_x, <span class="keywordtype">double</span> *var_y)</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="keywordtype">double</span> varsum_x = 0.0;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordtype">double</span> varsum_y = 0.0;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordtype">double</span> mean_x = 0.0;</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>     <span class="keywordtype">double</span> mean_y = 0.0;</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <span class="keywordtype">int</span> i;</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>     *nvalid = 0;</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>     <span class="keywordflow">for</span> (i=0; i < nvals; i++)</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>(pos_flag[i] == 1)</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="keyword">const</span> <span class="keywordtype">double</span> delta_x = (double)x_val[i] - mean_x;</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>             <span class="keyword">const</span> <span class="keywordtype">double</span> delta_y = (double)y_val[i] - mean_y;</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>             varsum_x += *nvalid * delta_x * delta_x / (*nvalid + 1.0);</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>             varsum_y += *nvalid * delta_y * delta_y / (*nvalid + 1.0);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>             mean_x   += delta_x / (*nvalid + 1.0);</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>             mean_y   += delta_y / (*nvalid + 1.0);</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>             (*nvalid)++;</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> </div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>     <span class="comment">/* Compute the bias-corrected standard deviation.</span></div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> <span class="comment">       - With the recurrence relation rounding can likely not cause</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> <span class="comment">       the variance to become negative, but check just to be safe */</span></div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>     *var_x = varsum_x / (double) (*nvalid - 1);</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     *var_y = varsum_y / (double) (*nvalid - 1);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</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/hawki__distortion_8h_source.html b/html/hawki__distortion_8h_source.html
index 72bcf6c..546f26f 100644
--- a/html/hawki__distortion_8h_source.html
+++ b/html/hawki__distortion_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_distortion.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,149 +40,150 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_distortion.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_distortion.h,v 1.13 2012/12/07 14:09: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/07 14:09:12 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.13 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_DISTORTION_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                    Structures and typedefs</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keyword">typedef</span> <span class="keyword">struct </span>_hawki_distortion_ hawki_distortion;
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">struct </span>_hawki_distortion_
-<a name="l00044"></a>00044 {
-<a name="l00045"></a>00045     cpl_image   * dist_x; 
-<a name="l00046"></a>00046     cpl_image   * dist_y;
-<a name="l00047"></a>00047     <span class="keywordtype">double</span>        x_crval;
-<a name="l00048"></a>00048     <span class="keywordtype">double</span>        x_cdelt;
-<a name="l00049"></a>00049     <span class="keywordtype">double</span>        y_crval;
-<a name="l00050"></a>00050     <span class="keywordtype">double</span>        y_cdelt;
-<a name="l00051"></a>00051 };
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00054"></a>00054 <span class="comment">                                    Prototypes</span>
-<a name="l00055"></a>00055 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 CPL_BEGIN_DECLS
-<a name="l00058"></a>00058 hawki_distortion * <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a>
-<a name="l00059"></a>00059 (<span class="keywordtype">int</span> detector_nx, 
-<a name="l00060"></a>00060  <span class="keywordtype">int</span> detector_ny, 
-<a name="l00061"></a>00061  <span class="keywordtype">int</span> grid_size);
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 <span class="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>
-<a name="l00064"></a>00064 (hawki_distortion * distortion);
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 hawki_distortion * <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a>
-<a name="l00067"></a>00067 (<span class="keyword">const</span> cpl_frame * dist_x,
-<a name="l00068"></a>00068  <span class="keyword">const</span> cpl_frame * dist_y,
-<a name="l00069"></a>00069  <span class="keywordtype">int</span>               idet);
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a>
-<a name="l00072"></a>00072 (<span class="keyword">const</span> hawki_distortion * distortion);
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a>
-<a name="l00075"></a>00075 (<span class="keyword">const</span> hawki_distortion * distortion);
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a>
-<a name="l00078"></a>00078 (cpl_image       ** alldetectors,
-<a name="l00079"></a>00079  <span class="keyword">const</span> cpl_frame  * distortion_x,
-<a name="l00080"></a>00080  <span class="keyword">const</span> cpl_frame  * distortion_y) ;
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 cpl_image * <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a>
-<a name="l00083"></a>00083 (cpl_image       *  image,
-<a name="l00084"></a>00084  cpl_image       *  dist_x,
-<a name="l00085"></a>00085  cpl_image       *  dist_y);
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e" title="Apply the distortion correction to one detector position.">hawki_distortion_correct_coords</a>
-<a name="l00088"></a>00088 (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00089"></a>00089  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00090"></a>00090  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00091"></a>00091  <span class="keywordtype">double</span>                *  x_pos_distcorr, 
-<a name="l00092"></a>00092  <span class="keywordtype">double</span>                *  y_pos_distcorr);
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3" title="Apply the inverse distortion correction to one detector position.">hawki_distortion_inverse_correct_coords</a>
-<a name="l00095"></a>00095 (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00096"></a>00096  <span class="keywordtype">double</span>                   x_pos,
-<a name="l00097"></a>00097  <span class="keywordtype">double</span>                   y_pos,
-<a name="l00098"></a>00098  <span class="keywordtype">double</span>                *  x_pos_distdecorr, 
-<a name="l00099"></a>00099  <span class="keywordtype">double</span>                *  y_pos_distdecorr);
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a>
-<a name="l00102"></a>00102 (cpl_imagelist   *  ilist, 
-<a name="l00103"></a>00103  cpl_image       ** dist_x,
-<a name="l00104"></a>00104  cpl_image       ** dist_y);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keywordtype">int</span> hawki_distortion_create_maps_detector
-<a name="l00107"></a>00107 (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00108"></a>00108  cpl_image              * dist_detector_x,
-<a name="l00109"></a>00109  cpl_image              * dist_detector_y);
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 <span class="keywordtype">int</span> hawki_distortion_create_maps
-<a name="l00112"></a>00112 (<span class="keyword">const</span> hawki_distortion * distortion, 
-<a name="l00113"></a>00113  cpl_image            **  dist_x,
-<a name="l00114"></a>00114  cpl_image            **  dist_y);
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116 hawki_distortion * hawki_distortion_compute_solution
-<a name="l00117"></a>00117 (<span class="keyword">const</span> cpl_table       ** ref_catalogues,
-<a name="l00118"></a>00118  <span class="keyword">const</span> cpl_bivector     * cat_offsets,
-<a name="l00119"></a>00119  <span class="keyword">const</span> cpl_table        * matching_sets,
-<a name="l00120"></a>00120  <span class="keywordtype">int</span>                      ncats,
-<a name="l00121"></a>00121  <span class="keywordtype">int</span>                      detector_nx,
-<a name="l00122"></a>00122  <span class="keywordtype">int</span>                      detector_ny,
-<a name="l00123"></a>00123  <span class="keywordtype">int</span>                      grid_size,
-<a name="l00124"></a>00124  <span class="keyword">const</span> hawki_distortion * dist_initguess,
-<a name="l00125"></a>00125  <span class="keywordtype">double</span>                 * rms);
-<a name="l00126"></a>00126 CPL_END_DECLS
-<a name="l00127"></a>00127 
-<a name="l00128"></a>00128 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_distortion.h,v 1.13 2012/12/07 14:09: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/07 14:09:12 $</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: hawki-1_8_12 $</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 HAWKI_DISTORTION_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DISTORTION_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                    Structures and typedefs</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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">typedef</span> <span class="keyword">struct </span>_hawki_distortion_ hawki_distortion;</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">struct </span>_hawki_distortion_</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_image   * dist_x; </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     cpl_image   * dist_y;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span>        x_crval;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keywordtype">double</span>        x_cdelt;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keywordtype">double</span>        y_crval;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     <span class="keywordtype">double</span>        y_cdelt;</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> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">                                    Prototypes</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> hawki_distortion * <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> (<span class="keywordtype">int</span> detector_nx, </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  <span class="keywordtype">int</span> detector_ny, </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  <span class="keywordtype">int</span> grid_size);</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="keywordtype">void</span> <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> (hawki_distortion * distortion);</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> hawki_distortion * <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> (<span class="keyword">const</span> cpl_frame * dist_x,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="keyword">const</span> cpl_frame * dist_y,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keywordtype">int</span>               idet);</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">int</span> <a class="code" href="group__hawki__distortion.html#gaaeaf96920122f1d4f64c164289588345" title="Gives the dimension in X of the distortion solution.">hawki_distortion_get_size_x</a></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (<span class="keyword">const</span> hawki_distortion * distortion);</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="keywordtype">int</span> <a class="code" href="group__hawki__distortion.html#ga990c10037636042cfcc0b40332821e9c" title="Gives the dimension in Y of the distortion solution.">hawki_distortion_get_size_y</a></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> (<span class="keyword">const</span> hawki_distortion * distortion);</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> <a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> (cpl_image       ** alldetectors,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keyword">const</span> cpl_frame  * distortion_x,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keyword">const</span> cpl_frame  * distortion_y) ;</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> cpl_image * <a class="code" href="group__hawki__distortion.html#ga872e536210e467ff47f70959f5390b7c" title="Apply the distortion correction to one chip.">hawki_distortion_correct_detector</a></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> (cpl_image       *  image,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_image       *  dist_x,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_image       *  dist_y);</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">int</span> <a class="code" href="group__hawki__distortion.html#ga6ecd36fa4b8e69cf6f3c85a64b7a9c3e" title="Apply the distortion correction to one detector position.">hawki_distortion_correct_coords</a></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  <span class="keywordtype">double</span>                *  x_pos_distcorr, </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  <span class="keywordtype">double</span>                *  y_pos_distcorr);</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">int</span> <a class="code" href="group__hawki__distortion.html#ga9462a4c3d7e6d3cac66f7bef27f6cbe3" title="Apply the inverse distortion correction to one detector position.">hawki_distortion_inverse_correct_coords</a></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  <span class="keywordtype">double</span>                   x_pos,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  <span class="keywordtype">double</span>                   y_pos,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  <span class="keywordtype">double</span>                *  x_pos_distdecorr, </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>  <span class="keywordtype">double</span>                *  y_pos_distdecorr);</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> <a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> (cpl_imagelist   *  ilist, </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>  cpl_image       ** dist_x,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>  cpl_image       ** dist_y);</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">int</span> hawki_distortion_create_maps_detector</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>  cpl_image              * dist_detector_x,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>  cpl_image              * dist_detector_y);</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="keywordtype">int</span> hawki_distortion_create_maps</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> (<span class="keyword">const</span> hawki_distortion * distortion, </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>  cpl_image            **  dist_x,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>  cpl_image            **  dist_y);</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> hawki_distortion * hawki_distortion_compute_solution</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> (<span class="keyword">const</span> cpl_table       ** ref_catalogues,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>  <span class="keyword">const</span> cpl_bivector     * cat_offsets,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>  <span class="keyword">const</span> cpl_table        * matching_sets,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>  <span class="keywordtype">int</span>                      ncats,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>  <span class="keywordtype">int</span>                      detector_nx,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>  <span class="keywordtype">int</span>                      detector_ny,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>  <span class="keywordtype">int</span>                      grid_size,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>  <span class="keyword">const</span> hawki_distortion * dist_initguess,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>  <span class="keywordtype">double</span>                 * rms);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> CPL_END_DECLS</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="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/hawki__image_8c_source.html b/html/hawki__image_8c_source.html
index 2679a50..376f7a4 100644
--- a/html/hawki__image_8c_source.html
+++ b/html/hawki__image_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_image.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,134 +40,135 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_image.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_image.c,v 1.3 2012/12/04 09:17: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/04 09:17:04 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl_mask.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl_matrix.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_mask.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00067"></a>00067 cpl_error_code <a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d" title="Copies the values of an image to the intersection of two images.">hawki_image_copy_to_intersection</a>
-<a name="l00068"></a><a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d">00068</a> (cpl_image        * target,
-<a name="l00069"></a>00069  <span class="keyword">const</span> cpl_image  * from,
-<a name="l00070"></a>00070  cpl_size           target_shift_x,
-<a name="l00071"></a>00071  cpl_size           target_shift_y)
-<a name="l00072"></a>00072 {
-<a name="l00073"></a>00073     
-<a name="l00074"></a>00074     cpl_size inter_x1;
-<a name="l00075"></a>00075     cpl_size inter_x2;
-<a name="l00076"></a>00076     cpl_size inter_y1;
-<a name="l00077"></a>00077     cpl_size inter_y2;
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_size from_x1 = 0;
-<a name="l00080"></a>00080     cpl_size from_x2 = cpl_image_get_size_x(from);
-<a name="l00081"></a>00081     cpl_size from_y1 = 0;
-<a name="l00082"></a>00082     cpl_size from_y2 = cpl_image_get_size_y(from);
-<a name="l00083"></a>00083     
-<a name="l00084"></a>00084     cpl_size target_x1 = target_shift_x;
-<a name="l00085"></a>00085     cpl_size target_x2 = target_shift_x + cpl_image_get_size_x(target);
-<a name="l00086"></a>00086     cpl_size target_y1 = target_shift_y;
-<a name="l00087"></a>00087     cpl_size target_y2 = target_shift_y + cpl_image_get_size_y(target);
-<a name="l00088"></a>00088     
-<a name="l00089"></a>00089     <span class="comment">/* Check entries */</span>
-<a name="l00090"></a>00090     cpl_ensure_code(target       != NULL,      CPL_ERROR_NULL_INPUT);
-<a name="l00091"></a>00091     cpl_ensure_code(from         != NULL,      CPL_ERROR_NULL_INPUT);
-<a name="l00092"></a>00092     cpl_ensure_code(cpl_image_get_type(target) == cpl_image_get_type(from),
-<a name="l00093"></a>00093                     CPL_ERROR_TYPE_MISMATCH);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095     <span class="comment">/* Compute intersection */</span>
-<a name="l00096"></a>00096     inter_x1 = CX_MAX(from_x1, target_x1);
-<a name="l00097"></a>00097     inter_x2 = CX_MIN(from_x2, target_x2);
-<a name="l00098"></a>00098     inter_y1 = CX_MAX(from_y1, target_y1);
-<a name="l00099"></a>00099     inter_y2 = CX_MIN(from_y2, target_y2);
-<a name="l00100"></a>00100  
-<a name="l00101"></a>00101     <span class="keywordflow">if</span>(inter_x2 > inter_x1 && inter_y2 > inter_y1)
-<a name="l00102"></a>00102     {
-<a name="l00103"></a>00103         <span class="keyword">const</span> <span class="keywordtype">void</span> * from_data;
-<a name="l00104"></a>00104         <span class="keywordtype">void</span>       * target_data;
-<a name="l00105"></a>00105         <span class="keywordtype">int</span>          iy;
-<a name="l00106"></a>00106         <span class="keywordtype">size_t</span>       pixel_size = cpl_type_get_sizeof(cpl_image_get_type(from));
-<a name="l00107"></a>00107         cpl_size     from_nx = cpl_image_get_size_x(from);
-<a name="l00108"></a>00108         cpl_size     target_nx = cpl_image_get_size_y(target);
-<a name="l00109"></a>00109         cpl_size     memcopy_size;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111         memcopy_size = (inter_x2 - inter_x1) * pixel_size;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113         from_data   = cpl_image_get_data_const(from);
-<a name="l00114"></a>00114         target_data = cpl_image_get_data(target);
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116         <span class="keywordflow">for</span>(iy=inter_y1; iy<inter_y2; ++iy)
-<a name="l00117"></a>00117         {
-<a name="l00118"></a>00118             <span class="keyword">const</span> <span class="keywordtype">void</span> * from_p; 
-<a name="l00119"></a>00119             <span class="keywordtype">void</span>       * target_p;
-<a name="l00120"></a>00120             
-<a name="l00121"></a>00121             from_p   = from_data   + (inter_x1 + iy * from_nx) * pixel_size;
-<a name="l00122"></a>00122             target_p = target_data +
-<a name="l00123"></a>00123                     (inter_x1 - target_shift_x +
-<a name="l00124"></a>00124                             (iy - target_shift_y) * target_nx) * pixel_size;
-<a name="l00125"></a>00125             memcpy(target_p, from_p, memcopy_size);
-<a name="l00126"></a>00126         }
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="comment">/* If the if is not executed is because intersection is empty. </span>
-<a name="l00129"></a>00129 <span class="comment">     * Nothing to copy */</span>
-<a name="l00130"></a>00130     
-<a name="l00131"></a>00131     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00132"></a>00132 }
-<a name="l00133"></a>00133 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_image.c,v 1.3 2012/12/04 09:17:04 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/04 09:17:04 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <string.h></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> <span class="preprocessor">#include <cpl_mask.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl_matrix.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 "hawki_mask.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="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="l00067"></a><span class="lineno">   67</span> cpl_error_code <a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d" title="Copies the values of an image to the intersection of two images.">hawki_image_copy_to_intersection</a></div>
+<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d">   68</a></span> (cpl_image        * target,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keyword">const</span> cpl_image  * from,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_size           target_shift_x,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  cpl_size           target_shift_y)</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_size inter_x1;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     cpl_size inter_x2;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     cpl_size inter_y1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cpl_size inter_y2;</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_size from_x1 = 0;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cpl_size from_x2 = cpl_image_get_size_x(from);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     cpl_size from_y1 = 0;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     cpl_size from_y2 = cpl_image_get_size_y(from);</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_size target_x1 = target_shift_x;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_size target_x2 = target_shift_x + cpl_image_get_size_x(target);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_size target_y1 = target_shift_y;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_size target_y2 = target_shift_y + cpl_image_get_size_y(target);</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">/* Check entries */</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_ensure_code(target       != NULL,      CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_ensure_code(from         != NULL,      CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     cpl_ensure_code(cpl_image_get_type(target) == cpl_image_get_type(from),</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                     CPL_ERROR_TYPE_MISMATCH);</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">/* Compute intersection */</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     inter_x1 = CX_MAX(from_x1, target_x1);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     inter_x2 = CX_MIN(from_x2, target_x2);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     inter_y1 = CX_MAX(from_y1, target_y1);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     inter_y2 = CX_MIN(from_y2, target_y2);</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="keywordflow">if</span>(inter_x2 > inter_x1 && inter_y2 > inter_y1)</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="keyword">const</span> <span class="keywordtype">void</span> * from_data;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         <span class="keywordtype">void</span>       * target_data;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         <span class="keywordtype">int</span>          iy;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         <span class="keywordtype">size_t</span>       pixel_size = cpl_type_get_sizeof(cpl_image_get_type(from));</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         cpl_size     from_nx = cpl_image_get_size_x(from);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         cpl_size     target_nx = cpl_image_get_size_y(target);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         cpl_size     memcopy_size;</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>         memcopy_size = (inter_x2 - inter_x1) * pixel_size;</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>         from_data   = cpl_image_get_data_const(from);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         target_data = cpl_image_get_data(target);</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">for</span>(iy=inter_y1; iy<inter_y2; ++iy)</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">const</span> <span class="keywordtype">void</span> * from_p; </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>             <span class="keywordtype">void</span>       * target_p;</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>             from_p   = from_data   + (inter_x1 + iy * from_nx) * pixel_size;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>             target_p = target_data +</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     (inter_x1 - target_shift_x +</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                             (iy - target_shift_y) * target_nx) * pixel_size;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             memcpy(target_p, from_p, memcopy_size);</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="comment">/* If the if is not executed is because intersection is empty. </span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="comment">     * Nothing to copy */</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> CPL_ERROR_NONE;</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><!-- 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/hawki__image_8h_source.html b/html/hawki__image_8h_source.html
index 4c89d58..bc71f22 100644
--- a/html/hawki__image_8h_source.html
+++ b/html/hawki__image_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_image.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,67 +40,68 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_image.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_image.h,v 1.2 2012/12/07 13:45: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/07 13:45:04 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_IMAGE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMAGE_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 <span class="preprocessor">#include "cpl_image.h"</span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00035"></a>00035 <span class="comment">                                Functions prototypes</span>
-<a name="l00036"></a>00036 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 CPL_BEGIN_DECLS
-<a name="l00039"></a>00039 cpl_error_code <a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d" title="Copies the values of an image to the intersection of two images.">hawki_image_copy_to_intersection</a>
-<a name="l00040"></a>00040 (cpl_image        * target,
-<a name="l00041"></a>00041  <span class="keyword">const</span> cpl_image  * from,
-<a name="l00042"></a>00042  cpl_size           target_shift_x,
-<a name="l00043"></a>00043  cpl_size           target_shift_y);
-<a name="l00044"></a>00044 CPL_END_DECLS
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_image.h,v 1.2 2012/12/07 13:45:04 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/07 13:45:04 $</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: hawki-1_8_12 $</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 HAWKI_IMAGE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_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 "cpl.h"</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include "cpl_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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="comment">                                Functions prototypes</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> cpl_error_code <a class="code" href="group__hawki__image.html#ga346a296d47b16f2b677665c01adbd41d" title="Copies the values of an image to the intersection of two images.">hawki_image_copy_to_intersection</a></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> (cpl_image        * target,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>  <span class="keyword">const</span> cpl_image  * from,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>  cpl_size           target_shift_x,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  cpl_size           target_shift_y);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> CPL_END_DECLS</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="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/hawki__image__stats_8c_source.html b/html/hawki__image__stats_8c_source.html
index 41280a7..67afb08 100644
--- a/html/hawki__image__stats_8c_source.html
+++ b/html/hawki__image__stats_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_image_stats.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,588 +40,589 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_image_stats.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_image_stats.c,v 1.8 2012/05/03 10:42:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/05/03 10:42:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <string.h></span>
-<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 "hawki_image_stats.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00045"></a>00045 <span class="comment">/*        Private functions                                                   */</span>
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00047"></a>00047 <span class="keywordtype">float</span> hawki_tools_get_kth_float(<span class="keywordtype">float</span> * a,
-<a name="l00048"></a>00048                                 <span class="keywordtype">int</span>        n,
-<a name="l00049"></a>00049                                 <span class="keywordtype">int</span>        k);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00055"></a>00055 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 
-<a name="l00059"></a>00059 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00068"></a>00068 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00069"></a>00069 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>
-<a name="l00070"></a><a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6">00070</a> (cpl_table ** raw_stats)
-<a name="l00071"></a>00071 {
-<a name="l00072"></a>00072     <span class="keywordtype">int</span> idet;
-<a name="l00073"></a>00073     <span class="comment">/* Error state variables */</span>
-<a name="l00074"></a>00074     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00075"></a>00075     
-<a name="l00076"></a>00076     <span class="comment">/* Check inputs */</span>
-<a name="l00077"></a>00077     <span class="keywordflow">if</span>(raw_stats == NULL)
-<a name="l00078"></a>00078         <span class="keywordflow">return</span> -1;
-<a name="l00079"></a>00079     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00080"></a>00080     {
-<a name="l00081"></a>00081         <span class="keywordflow">if</span>(raw_stats[idet] == NULL)
-<a name="l00082"></a>00082             <span class="keywordflow">return</span> -1;
-<a name="l00083"></a>00083     }
-<a name="l00084"></a>00084     
-<a name="l00085"></a>00085     <span class="comment">/* Creates the proper columns */</span>
-<a name="l00086"></a>00086     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00087"></a>00087     {
-<a name="l00088"></a>00088         cpl_table_new_column
-<a name="l00089"></a>00089             (raw_stats[idet],HAWKI_COL_STAT_MIN,CPL_TYPE_DOUBLE);
-<a name="l00090"></a>00090         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MIN,<span class="stringliteral">"ADU"</span>);
-<a name="l00091"></a>00091         cpl_table_new_column
-<a name="l00092"></a>00092             (raw_stats[idet],HAWKI_COL_STAT_MAX,CPL_TYPE_DOUBLE);
-<a name="l00093"></a>00093         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MAX,<span class="stringliteral">"ADU"</span>);
-<a name="l00094"></a>00094         cpl_table_new_column
-<a name="l00095"></a>00095             (raw_stats[idet],HAWKI_COL_STAT_MED,CPL_TYPE_DOUBLE);
-<a name="l00096"></a>00096         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MED,<span class="stringliteral">"ADU"</span>);
-<a name="l00097"></a>00097         cpl_table_new_column
-<a name="l00098"></a>00098             (raw_stats[idet],HAWKI_COL_STAT_MEAN,CPL_TYPE_DOUBLE);
-<a name="l00099"></a>00099         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MEAN,<span class="stringliteral">"ADU"</span>);
-<a name="l00100"></a>00100         cpl_table_new_column    
-<a name="l00101"></a>00101             (raw_stats[idet],HAWKI_COL_STAT_RMS,CPL_TYPE_DOUBLE);
-<a name="l00102"></a>00102         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_RMS,<span class="stringliteral">"ADU"</span>);
-<a name="l00103"></a>00103         cpl_table_new_column
-<a name="l00104"></a>00104             (raw_stats[idet],HAWKI_COL_STAT_USED,CPL_TYPE_INT);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106     }
-<a name="l00107"></a>00107     <span class="comment">/* Check error status and exit */</span>
-<a name="l00108"></a>00108     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00109"></a>00109         <span class="keywordflow">return</span> -1;
-<a name="l00110"></a>00110     <span class="keywordflow">return</span> 0;
-<a name="l00111"></a>00111 }
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00137"></a><a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f">00137</a> (cpl_table       ** image_stats,
-<a name="l00138"></a>00138  <span class="keyword">const</span> cpl_image *  image,
-<a name="l00139"></a>00139  <span class="keywordtype">int</span>                llx,
-<a name="l00140"></a>00140  <span class="keywordtype">int</span>                lly,
-<a name="l00141"></a>00141  <span class="keywordtype">int</span>                urx,
-<a name="l00142"></a>00142  <span class="keywordtype">int</span>                ury,
-<a name="l00143"></a>00143  <span class="keywordtype">int</span>                idet,
-<a name="l00144"></a>00144  <span class="keywordtype">int</span>                irow)
-<a name="l00145"></a>00145 {
-<a name="l00146"></a>00146     <span class="comment">/* stats variables */</span>
-<a name="l00147"></a>00147     <span class="keywordtype">double</span> minval;
-<a name="l00148"></a>00148     <span class="keywordtype">double</span> maxval;
-<a name="l00149"></a>00149     <span class="keywordtype">double</span> median;
-<a name="l00150"></a>00150     <span class="keywordtype">double</span> stdev;
-<a name="l00151"></a>00151     <span class="keywordtype">double</span> mean;
-<a name="l00152"></a>00152     cpl_stats * stats_ima ;
-<a name="l00153"></a>00153     
-<a name="l00154"></a>00154     <span class="comment">/* Error state variables */</span>
-<a name="l00155"></a>00155     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="comment">/* Checking input */</span>
-<a name="l00158"></a>00158     <span class="keywordflow">if</span>(image_stats == NULL || image == NULL)
-<a name="l00159"></a>00159         <span class="keywordflow">return</span> -1;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     <span class="comment">/* Compute statistics */</span>
-<a name="l00162"></a>00162     stats_ima = cpl_stats_new_from_image_window
-<a name="l00163"></a>00163         (image, CPL_STATS_ALL, llx, lly, urx, ury) ;
-<a name="l00164"></a>00164     <span class="keywordflow">if</span>(stats_ima == NULL)
-<a name="l00165"></a>00165         <span class="keywordflow">return</span> -1;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     <span class="comment">/* Get the stats from the storage structure */</span>
-<a name="l00168"></a>00168     minval  = cpl_stats_get_min(stats_ima);
-<a name="l00169"></a>00169     maxval  = cpl_stats_get_max(stats_ima);
-<a name="l00170"></a>00170     median  = cpl_stats_get_median(stats_ima);
-<a name="l00171"></a>00171     stdev   = cpl_stats_get_stdev(stats_ima);
-<a name="l00172"></a>00172     mean    = cpl_stats_get_mean(stats_ima);
-<a name="l00173"></a>00173     cpl_stats_delete(stats_ima);
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     <span class="comment">/* Store in table */</span>
-<a name="l00176"></a>00176     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MIN,
-<a name="l00177"></a>00177                          irow, minval);
-<a name="l00178"></a>00178     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MAX,
-<a name="l00179"></a>00179                          irow, maxval);
-<a name="l00180"></a>00180     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MED,
-<a name="l00181"></a>00181                          irow, median);
-<a name="l00182"></a>00182     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MEAN,
-<a name="l00183"></a>00183                          irow, mean);
-<a name="l00184"></a>00184     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_RMS,
-<a name="l00185"></a>00185                          irow, stdev) ;
-<a name="l00186"></a>00186     cpl_table_set_int(image_stats[idet], HAWKI_COL_STAT_USED,
-<a name="l00187"></a>00187                       irow, 1) ;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* Check error status and exit */</span>
-<a name="l00190"></a>00190     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00191"></a>00191         <span class="keywordflow">return</span> -1;
-<a name="l00192"></a>00192     <span class="keywordflow">return</span> 0;
-<a name="l00193"></a>00193 }
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195 <span class="keywordtype">int</span> hawki_image_stats_odd_even_column_row_fill_from_image
-<a name="l00196"></a>00196 (cpl_table       ** odd_column_stats,
-<a name="l00197"></a>00197  cpl_table       ** even_column_stats,
-<a name="l00198"></a>00198  cpl_table       ** odd_row_stats,
-<a name="l00199"></a>00199  cpl_table       ** even_row_stats,
-<a name="l00200"></a>00200  <span class="keyword">const</span> cpl_image *  image,
-<a name="l00201"></a>00201  <span class="keywordtype">int</span>                idet,
-<a name="l00202"></a>00202  <span class="keywordtype">int</span>                irow)
-<a name="l00203"></a>00203 {
-<a name="l00204"></a>00204     <span class="comment">/* stats variables */</span>
-<a name="l00205"></a>00205     <span class="keywordtype">int</span>    i;
-<a name="l00206"></a>00206     <span class="keywordtype">int</span>    j;
-<a name="l00207"></a>00207     <span class="keywordtype">int</span>    nx;
-<a name="l00208"></a>00208     <span class="keywordtype">int</span>    ny;
-<a name="l00209"></a>00209     <span class="keywordtype">double</span> minval;
-<a name="l00210"></a>00210     <span class="keywordtype">double</span> maxval;
-<a name="l00211"></a>00211     <span class="keywordtype">double</span> median;
-<a name="l00212"></a>00212     <span class="keywordtype">double</span> stdev;
-<a name="l00213"></a>00213     <span class="keywordtype">double</span> mean;
-<a name="l00214"></a>00214     cpl_stats  * stats_ima;
-<a name="l00215"></a>00215     cpl_image  * tmp_ima;
-<a name="l00216"></a>00216     cpl_mask   * mask;
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <span class="comment">/* Error state variables */</span>
-<a name="l00219"></a>00219     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     <span class="comment">/* Checking input */</span>
-<a name="l00222"></a>00222     <span class="keywordflow">if</span>(odd_column_stats == NULL  || 
-<a name="l00223"></a>00223        even_column_stats == NULL || 
-<a name="l00224"></a>00224        odd_row_stats == NULL     || 
-<a name="l00225"></a>00225        even_row_stats == NULL    || 
-<a name="l00226"></a>00226        image == NULL)
-<a name="l00227"></a>00227         <span class="keywordflow">return</span> -1;
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="comment">/* Copying the target image */</span>
-<a name="l00230"></a>00230     tmp_ima = cpl_image_duplicate(image);
-<a name="l00231"></a>00231     nx = cpl_image_get_size_x(tmp_ima);
-<a name="l00232"></a>00232     ny = cpl_image_get_size_y(tmp_ima);
-<a name="l00233"></a>00233     
-<a name="l00234"></a>00234     <span class="comment">/* Compute statistics odd column */</span>
-<a name="l00235"></a>00235     mask = cpl_image_get_bpm(tmp_ima);
-<a name="l00236"></a>00236     <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)
-<a name="l00237"></a>00237     {
-<a name="l00238"></a>00238         <span class="keywordflow">if</span>((i+1) % 2)
-<a name="l00239"></a>00239             <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)
-<a name="l00240"></a>00240             {
-<a name="l00241"></a>00241                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);
-<a name="l00242"></a>00242             }
-<a name="l00243"></a>00243     }
-<a name="l00244"></a>00244     stats_ima = cpl_stats_new_from_image
-<a name="l00245"></a>00245         (tmp_ima, CPL_STATS_ALL);
-<a name="l00246"></a>00246     <span class="keywordflow">if</span>(stats_ima == NULL)
-<a name="l00247"></a>00247     {
-<a name="l00248"></a>00248         cpl_image_delete(tmp_ima);
-<a name="l00249"></a>00249         <span class="keywordflow">return</span> -1;
-<a name="l00250"></a>00250     }
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     <span class="comment">/* Get the stats from the storage structure */</span>
-<a name="l00253"></a>00253     minval  = cpl_stats_get_min(stats_ima);
-<a name="l00254"></a>00254     maxval  = cpl_stats_get_max(stats_ima);
-<a name="l00255"></a>00255     median  = cpl_stats_get_median(stats_ima);
-<a name="l00256"></a>00256     stdev   = cpl_stats_get_stdev(stats_ima);
-<a name="l00257"></a>00257     mean    = cpl_stats_get_mean(stats_ima);
-<a name="l00258"></a>00258     cpl_stats_delete(stats_ima);
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     <span class="comment">/* Store in table */</span>
-<a name="l00261"></a>00261     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MIN,
-<a name="l00262"></a>00262                          irow, minval);
-<a name="l00263"></a>00263     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MAX,
-<a name="l00264"></a>00264                          irow, maxval);
-<a name="l00265"></a>00265     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MED,
-<a name="l00266"></a>00266                          irow, median);
-<a name="l00267"></a>00267     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MEAN,
-<a name="l00268"></a>00268                          irow, mean);
-<a name="l00269"></a>00269     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_RMS,
-<a name="l00270"></a>00270                          irow, stdev) ;
-<a name="l00271"></a>00271     cpl_table_set_int(odd_column_stats[idet], HAWKI_COL_STAT_USED,
-<a name="l00272"></a>00272                       irow, 1) ;
-<a name="l00273"></a>00273     
-<a name="l00274"></a>00274     <span class="comment">/* Compute statistics even column */</span>
-<a name="l00275"></a>00275     <span class="comment">//cpl_image_reject_from_mask();</span>
-<a name="l00276"></a>00276     cpl_image_accept_all(tmp_ima);
-<a name="l00277"></a>00277     mask = cpl_image_get_bpm(tmp_ima);
-<a name="l00278"></a>00278     <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)
-<a name="l00279"></a>00279     {
-<a name="l00280"></a>00280         <span class="keywordflow">if</span>(i % 2)
-<a name="l00281"></a>00281             <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)
-<a name="l00282"></a>00282             {
-<a name="l00283"></a>00283                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);
-<a name="l00284"></a>00284             }
-<a name="l00285"></a>00285     }
-<a name="l00286"></a>00286     stats_ima = cpl_stats_new_from_image
-<a name="l00287"></a>00287         (tmp_ima, CPL_STATS_ALL);
-<a name="l00288"></a>00288     <span class="keywordflow">if</span>(stats_ima == NULL)
-<a name="l00289"></a>00289     {
-<a name="l00290"></a>00290         cpl_image_delete(tmp_ima);
-<a name="l00291"></a>00291         <span class="keywordflow">return</span> -1;
-<a name="l00292"></a>00292     }
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294     <span class="comment">/* Get the stats from the storage structure */</span>
-<a name="l00295"></a>00295     minval  = cpl_stats_get_min(stats_ima);
-<a name="l00296"></a>00296     maxval  = cpl_stats_get_max(stats_ima);
-<a name="l00297"></a>00297     median  = cpl_stats_get_median(stats_ima);
-<a name="l00298"></a>00298     stdev   = cpl_stats_get_stdev(stats_ima);
-<a name="l00299"></a>00299     mean    = cpl_stats_get_mean(stats_ima);
-<a name="l00300"></a>00300     cpl_stats_delete(stats_ima);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="comment">/* Store in table */</span>
-<a name="l00303"></a>00303     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MIN,
-<a name="l00304"></a>00304                          irow, minval);
-<a name="l00305"></a>00305     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MAX,
-<a name="l00306"></a>00306                          irow, maxval);
-<a name="l00307"></a>00307     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MED,
-<a name="l00308"></a>00308                          irow, median);
-<a name="l00309"></a>00309     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MEAN,
-<a name="l00310"></a>00310                          irow, mean);
-<a name="l00311"></a>00311     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_RMS,
-<a name="l00312"></a>00312                          irow, stdev) ;
-<a name="l00313"></a>00313     cpl_table_set_int(even_column_stats[idet], HAWKI_COL_STAT_USED,
-<a name="l00314"></a>00314                       irow, 1) ;
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="comment">/* Compute statistics odd rows */</span>
-<a name="l00317"></a>00317     cpl_image_accept_all(tmp_ima);
-<a name="l00318"></a>00318     mask = cpl_image_get_bpm(tmp_ima);
-<a name="l00319"></a>00319     <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)
-<a name="l00320"></a>00320     {
-<a name="l00321"></a>00321         <span class="keywordflow">if</span>((j+1) % 2)
-<a name="l00322"></a>00322             <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)
-<a name="l00323"></a>00323             {
-<a name="l00324"></a>00324                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);
-<a name="l00325"></a>00325             }
-<a name="l00326"></a>00326     }
-<a name="l00327"></a>00327     stats_ima = cpl_stats_new_from_image
-<a name="l00328"></a>00328         (tmp_ima, CPL_STATS_ALL) ;
-<a name="l00329"></a>00329     <span class="keywordflow">if</span>(stats_ima == NULL)
-<a name="l00330"></a>00330     {
-<a name="l00331"></a>00331         cpl_image_delete(tmp_ima);
-<a name="l00332"></a>00332         <span class="keywordflow">return</span> -1;
-<a name="l00333"></a>00333     }
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <span class="comment">/* Get the stats from the storage structure */</span>
-<a name="l00336"></a>00336     minval  = cpl_stats_get_min(stats_ima);
-<a name="l00337"></a>00337     maxval  = cpl_stats_get_max(stats_ima);
-<a name="l00338"></a>00338     median  = cpl_stats_get_median(stats_ima);
-<a name="l00339"></a>00339     stdev   = cpl_stats_get_stdev(stats_ima);
-<a name="l00340"></a>00340     mean    = cpl_stats_get_mean(stats_ima);
-<a name="l00341"></a>00341     cpl_stats_delete(stats_ima);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/* Store in table */</span>
-<a name="l00344"></a>00344     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MIN,
-<a name="l00345"></a>00345                          irow, minval);
-<a name="l00346"></a>00346     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MAX,
-<a name="l00347"></a>00347                          irow, maxval);
-<a name="l00348"></a>00348     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MED,
-<a name="l00349"></a>00349                          irow, median);
-<a name="l00350"></a>00350     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MEAN,
-<a name="l00351"></a>00351                          irow, mean);
-<a name="l00352"></a>00352     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_RMS,
-<a name="l00353"></a>00353                          irow, stdev) ;
-<a name="l00354"></a>00354     cpl_table_set_int(odd_row_stats[idet], HAWKI_COL_STAT_USED,
-<a name="l00355"></a>00355                       irow, 1) ;
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     <span class="comment">/* Compute statistics even row */</span>
-<a name="l00358"></a>00358     cpl_image_accept_all(tmp_ima);
-<a name="l00359"></a>00359     mask = cpl_image_get_bpm(tmp_ima);
-<a name="l00360"></a>00360     <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)
-<a name="l00361"></a>00361     {
-<a name="l00362"></a>00362         <span class="keywordflow">if</span>(j % 2)
-<a name="l00363"></a>00363             <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)
-<a name="l00364"></a>00364             {
-<a name="l00365"></a>00365                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);
-<a name="l00366"></a>00366             }
-<a name="l00367"></a>00367     }
-<a name="l00368"></a>00368     stats_ima = cpl_stats_new_from_image
-<a name="l00369"></a>00369         (tmp_ima, CPL_STATS_ALL) ;
-<a name="l00370"></a>00370     <span class="keywordflow">if</span>(stats_ima == NULL)
-<a name="l00371"></a>00371     {
-<a name="l00372"></a>00372         cpl_image_delete(tmp_ima);
-<a name="l00373"></a>00373         <span class="keywordflow">return</span> -1;
-<a name="l00374"></a>00374     }
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="comment">/* Get the stats from the storage structure */</span>
-<a name="l00377"></a>00377     minval  = cpl_stats_get_min(stats_ima);
-<a name="l00378"></a>00378     maxval  = cpl_stats_get_max(stats_ima);
-<a name="l00379"></a>00379     median  = cpl_stats_get_median(stats_ima);
-<a name="l00380"></a>00380     stdev   = cpl_stats_get_stdev(stats_ima);
-<a name="l00381"></a>00381     mean    = cpl_stats_get_mean(stats_ima);
-<a name="l00382"></a>00382     cpl_stats_delete(stats_ima);
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     <span class="comment">/* Store in table */</span>
-<a name="l00385"></a>00385     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MIN,
-<a name="l00386"></a>00386                          irow, minval);
-<a name="l00387"></a>00387     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MAX,
-<a name="l00388"></a>00388                          irow, maxval);
-<a name="l00389"></a>00389     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MED,
-<a name="l00390"></a>00390                          irow, median);
-<a name="l00391"></a>00391     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MEAN,
-<a name="l00392"></a>00392                          irow, mean);
-<a name="l00393"></a>00393     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_RMS,
-<a name="l00394"></a>00394                          irow, stdev) ;
-<a name="l00395"></a>00395     cpl_table_set_int(even_row_stats[idet], HAWKI_COL_STAT_USED,
-<a name="l00396"></a>00396                       irow, 1) ;
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     <span class="comment">/* Free */</span>
-<a name="l00399"></a>00399     cpl_image_delete(tmp_ima);
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401     <span class="comment">/* Check error status and exit */</span>
-<a name="l00402"></a>00402     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00403"></a>00403         <span class="keywordflow">return</span> -1;
-<a name="l00404"></a>00404     <span class="keywordflow">return</span> 0;
-<a name="l00405"></a>00405 }
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00428"></a>00428 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00429"></a>00429 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a>
-<a name="l00430"></a><a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836">00430</a> (cpl_table       ** image_stats,
-<a name="l00431"></a>00431  <span class="keyword">const</span> cpl_frame *  frame,
-<a name="l00432"></a>00432  <span class="keywordtype">int</span>                irow)
-<a name="l00433"></a>00433 {
-<a name="l00434"></a>00434     <span class="keywordtype">int</span>              idet;
-<a name="l00435"></a>00435     cpl_imagelist  * images;
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     <span class="comment">/* Loading the four chips */</span>
-<a name="l00438"></a>00438     images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(frame, CPL_TYPE_FLOAT);
-<a name="l00439"></a>00439     <span class="keywordflow">if</span>(images == NULL)
-<a name="l00440"></a>00440     {
-<a name="l00441"></a>00441         cpl_msg_error(__func__,<span class="stringliteral">"Could not read file %s"</span>,
-<a name="l00442"></a>00442                       cpl_frame_get_filename(frame));
-<a name="l00443"></a>00443         <span class="keywordflow">return</span> -1;
-<a name="l00444"></a>00444     }
-<a name="l00445"></a>00445     
-<a name="l00446"></a>00446     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00447"></a>00447     {
-<a name="l00448"></a>00448         <span class="keywordtype">int</span> nx, ny;
-<a name="l00449"></a>00449         nx = cpl_image_get_size_x(cpl_imagelist_get(images,idet));
-<a name="l00450"></a>00450         ny = cpl_image_get_size_y(cpl_imagelist_get(images,idet));
-<a name="l00451"></a>00451         <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00452"></a>00452             (image_stats,
-<a name="l00453"></a>00453              cpl_imagelist_get(images,idet),
-<a name="l00454"></a>00454              1, 1, nx, ny, idet, irow);
-<a name="l00455"></a>00455     }
-<a name="l00456"></a>00456     
-<a name="l00457"></a>00457     <span class="comment">/* Free and exit */</span>
-<a name="l00458"></a>00458     cpl_imagelist_delete(images);
-<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 <span class="keywordtype">int</span> hawki_image_stats_print
-<a name="l00463"></a>00463 (cpl_table ** table_stats)
-<a name="l00464"></a>00464 {
-<a name="l00465"></a>00465     <span class="keywordtype">int</span> idet;
-<a name="l00466"></a>00466     <span class="keywordtype">int</span> istat;
-<a name="l00467"></a>00467     
-<a name="l00468"></a>00468     <span class="comment">/* Print header */</span>
-<a name="l00469"></a>00469     cpl_msg_info(__func__, <span class="stringliteral">"Stats summary"</span>) ;
-<a name="l00470"></a>00470     
-<a name="l00471"></a>00471     <span class="comment">/* Loop on detectors */</span>
-<a name="l00472"></a>00472     cpl_msg_indent_more();
-<a name="l00473"></a>00473     <span class="keywordflow">for</span>( idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00474"></a>00474     {
-<a name="l00475"></a>00475     
-<a name="l00476"></a>00476         <span class="comment">/* Chip header */</span>
-<a name="l00477"></a>00477         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;
-<a name="l00478"></a>00478         cpl_msg_info(__func__, <span class="stringliteral">"image      min        max        med     rms"</span>) ;
-<a name="l00479"></a>00479         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</span>) ;
-<a name="l00480"></a>00480         
-<a name="l00481"></a>00481         <span class="comment">/* Loop on images */</span>
-<a name="l00482"></a>00482         <span class="keywordflow">for</span>(istat = 0; istat < cpl_table_get_nrow(table_stats[idet]); ++istat)
-<a name="l00483"></a>00483         {
-<a name="l00484"></a>00484             cpl_msg_info(__func__, <span class="stringliteral">"%02d   %10.2f %10.2f %10.2f %10.2f"</span>,
-<a name="l00485"></a>00485                          istat+1,
-<a name="l00486"></a>00486                          cpl_table_get_double(table_stats[idet],
-<a name="l00487"></a>00487                                               HAWKI_COL_STAT_MIN,istat,NULL),
-<a name="l00488"></a>00488                          cpl_table_get_double(table_stats[idet],
-<a name="l00489"></a>00489                                               HAWKI_COL_STAT_MAX,istat,NULL),
-<a name="l00490"></a>00490                          cpl_table_get_double(table_stats[idet],
-<a name="l00491"></a>00491                                               HAWKI_COL_STAT_MED,istat,NULL ),
-<a name="l00492"></a>00492                          cpl_table_get_double(table_stats[idet],
-<a name="l00493"></a>00493                                               HAWKI_COL_STAT_RMS,istat,NULL ));
-<a name="l00494"></a>00494         }
-<a name="l00495"></a>00495     }
-<a name="l00496"></a>00496     cpl_msg_indent_less();
-<a name="l00497"></a>00497     <span class="keywordflow">return</span> 0;
-<a name="l00498"></a>00498 }
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00509"></a>00509 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>
-<a name="l00512"></a><a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928">00512</a> (cpl_table         ** image_stats,
-<a name="l00513"></a>00513  cpl_propertylist  ** stats_stats)
-<a name="l00514"></a>00514 {
-<a name="l00515"></a>00515     cpl_array * col_names;
-<a name="l00516"></a>00516     <span class="keywordtype">int</span>         idet;
-<a name="l00517"></a>00517     <span class="keywordtype">int</span>         icol;
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     <span class="comment">/* Check entries */</span>
-<a name="l00520"></a>00520     <span class="keywordflow">if</span>(image_stats == NULL || stats_stats == NULL)
-<a name="l00521"></a>00521         <span class="keywordflow">return</span> -1;
-<a name="l00522"></a>00522     
-<a name="l00523"></a>00523     <span class="comment">/* Fill the name of the interesting columns */</span>
-<a name="l00524"></a>00524     col_names = cpl_array_new(5, CPL_TYPE_STRING);
-<a name="l00525"></a>00525     cpl_array_set_string(col_names, 0, HAWKI_COL_STAT_MIN);
-<a name="l00526"></a>00526     cpl_array_set_string(col_names, 1, HAWKI_COL_STAT_MAX);
-<a name="l00527"></a>00527     cpl_array_set_string(col_names, 2, HAWKI_COL_STAT_MED);
-<a name="l00528"></a>00528     cpl_array_set_string(col_names, 3, HAWKI_COL_STAT_MEAN);
-<a name="l00529"></a>00529     cpl_array_set_string(col_names, 4, HAWKI_COL_STAT_RMS);
-<a name="l00530"></a>00530     
-<a name="l00531"></a>00531     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; ++idet) 
-<a name="l00532"></a>00532     {
-<a name="l00533"></a>00533         <span class="keywordflow">for</span>(icol = 0;icol < 5; ++icol)
-<a name="l00534"></a>00534         {
-<a name="l00535"></a>00535             <span class="keyword">const</span> <span class="keywordtype">char</span> * this_col_name = cpl_array_get_string(col_names, icol);
-<a name="l00536"></a>00536             <span class="keywordtype">char</span>         mean_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;
-<a name="l00537"></a>00537             <span class="keywordtype">char</span>         median_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;
-<a name="l00538"></a>00538             <span class="keywordtype">char</span>         minimum_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;
-<a name="l00539"></a>00539             <span class="keywordtype">char</span>         maximum_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;
-<a name="l00540"></a>00540             <span class="keywordtype">char</span>         stdev_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;
-<a name="l00541"></a>00541             strncat(mean_col_name, this_col_name, 244);
-<a name="l00542"></a>00542             strncat(mean_col_name, <span class="stringliteral">" MEAN"</span>, 236);
-<a name="l00543"></a>00543             cpl_propertylist_append_double
-<a name="l00544"></a>00544                 (stats_stats[idet], mean_col_name, 
-<a name="l00545"></a>00545                  cpl_table_get_column_mean(image_stats[idet],this_col_name));
-<a name="l00546"></a>00546             strncat(median_col_name, this_col_name, 255);
-<a name="l00547"></a>00547             strncat(median_col_name, <span class="stringliteral">" MEDIAN"</span>, 236);
-<a name="l00548"></a>00548             cpl_propertylist_append_double
-<a name="l00549"></a>00549                 (stats_stats[idet], median_col_name, 
-<a name="l00550"></a>00550                  cpl_table_get_column_median(image_stats[idet],this_col_name));
-<a name="l00551"></a>00551             strncat(minimum_col_name, this_col_name, 255);
-<a name="l00552"></a>00552             strncat(minimum_col_name, <span class="stringliteral">" MINIMUM"</span>, 236);
-<a name="l00553"></a>00553             cpl_propertylist_append_double
-<a name="l00554"></a>00554                 (stats_stats[idet], minimum_col_name, 
-<a name="l00555"></a>00555                  cpl_table_get_column_min(image_stats[idet],this_col_name));
-<a name="l00556"></a>00556             strncat(maximum_col_name, this_col_name, 255);
-<a name="l00557"></a>00557             strncat(maximum_col_name, <span class="stringliteral">" MAXIMUM"</span>, 236);
-<a name="l00558"></a>00558             cpl_propertylist_append_double
-<a name="l00559"></a>00559                 (stats_stats[idet], maximum_col_name, 
-<a name="l00560"></a>00560                  cpl_table_get_column_max(image_stats[idet],this_col_name));
-<a name="l00561"></a>00561             strncat(stdev_col_name, this_col_name, 255);
-<a name="l00562"></a>00562             strncat(stdev_col_name, <span class="stringliteral">" STDEV"</span>, 236);
-<a name="l00563"></a>00563             cpl_propertylist_append_double
-<a name="l00564"></a>00564                 (stats_stats[idet], stdev_col_name, 
-<a name="l00565"></a>00565                  cpl_table_get_column_stdev(image_stats[idet],this_col_name));
-<a name="l00566"></a>00566         }
-<a name="l00567"></a>00567     }
-<a name="l00568"></a>00568     
-<a name="l00569"></a>00569     <span class="comment">/*Free and return */</span>
-<a name="l00570"></a>00570     cpl_array_delete(col_names);
-<a name="l00571"></a>00571     <span class="keywordflow">return</span> 0;
-<a name="l00572"></a>00572 }
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00581"></a>00581 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00582"></a><a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651">00582</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(cpl_image * image)
-<a name="l00583"></a>00583 {
-<a name="l00584"></a>00584     <span class="keywordtype">int</span>      npixels;
-<a name="l00585"></a>00585     <span class="keywordtype">int</span>      ipix_0_25;
-<a name="l00586"></a>00586     <span class="keywordtype">int</span>      ipix_0_75;
-<a name="l00587"></a>00587     <span class="keywordtype">double</span>   first_quartil;
-<a name="l00588"></a>00588     <span class="keywordtype">double</span>   third_quartil;
-<a name="l00589"></a>00589     <span class="keywordtype">double</span>   sigma_from_quartile;
-<a name="l00590"></a>00590     <span class="keywordtype">float</span>  * data;
-<a name="l00591"></a>00591     
-<a name="l00592"></a>00592     npixels = cpl_image_get_size_x(image) * cpl_image_get_size_y(image);
-<a name="l00593"></a>00593     data = cpl_image_get_data(image);
-<a name="l00594"></a>00594     ipix_0_25 = (int)(npixels * 0.25);
-<a name="l00595"></a>00595     ipix_0_75 = (int)(npixels * 0.75);
-<a name="l00596"></a>00596         
-<a name="l00597"></a>00597     first_quartil = hawki_tools_get_kth_float(data, npixels, ipix_0_25);
-<a name="l00598"></a>00598     third_quartil = hawki_tools_get_kth_float(data, npixels, ipix_0_75);
-<a name="l00599"></a>00599     sigma_from_quartile = (third_quartil - first_quartil) / 1.35;
-<a name="l00600"></a>00600     <span class="keywordflow">return</span> sigma_from_quartile;
-<a name="l00601"></a>00601 }
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603 
-<a name="l00604"></a>00604 <span class="comment">/* Swap macro */</span>
-<a name="l00605"></a>00605 <span class="preprocessor">#undef SWAP</span>
-<a name="l00606"></a>00606 <span class="preprocessor"></span><span class="preprocessor">#define SWAP(a,b) { register float t=(a);(a)=(b);(b)=t; }</span>
-<a name="l00607"></a>00607 <span class="preprocessor"></span>
-<a name="l00608"></a>00608 <span class="keywordtype">float</span> hawki_tools_get_kth_float(<span class="keywordtype">float</span> * a,
-<a name="l00609"></a>00609                                 <span class="keywordtype">int</span>        n,
-<a name="l00610"></a>00610                                 <span class="keywordtype">int</span>        k)
-<a name="l00611"></a>00611 {
-<a name="l00612"></a>00612     <span class="keyword">register</span> <span class="keywordtype">float</span> x;
-<a name="l00613"></a>00613     <span class="keyword">register</span> <span class="keywordtype">int</span>    i, j, l, m;
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00);
-<a name="l00616"></a>00616 
-<a name="l00617"></a>00617     l=0; m=n-1;
-<a name="l00618"></a>00618     <span class="keywordflow">while</span> (l<m) {
-<a name="l00619"></a>00619         x=a[k];
-<a name="l00620"></a>00620         i=l;
-<a name="l00621"></a>00621         j=m;
-<a name="l00622"></a>00622         <span class="keywordflow">do</span> {
-<a name="l00623"></a>00623             <span class="keywordflow">while</span> (a[i]<x) i++;
-<a name="l00624"></a>00624             <span class="keywordflow">while</span> (x<a[j]) j--;
-<a name="l00625"></a>00625             <span class="keywordflow">if</span> (i<=j) {
-<a name="l00626"></a>00626                 SWAP(a[i],a[j]);
-<a name="l00627"></a>00627                 i++; j--;
-<a name="l00628"></a>00628             }
-<a name="l00629"></a>00629         } <span class="keywordflow">while</span> (i<=j);
-<a name="l00630"></a>00630         <span class="keywordflow">if</span> (j<k) l=i;
-<a name="l00631"></a>00631         <span class="keywordflow">if</span> (k<i) m=j;
-<a name="l00632"></a>00632     }
-<a name="l00633"></a>00633     <span class="keywordflow">return</span> a[k];
-<a name="l00634"></a>00634 }
-<a name="l00635"></a>00635 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_image_stats.c,v 1.8 2012/05/03 10:42: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/05/03 10:42:32 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </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 <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 "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_load.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="l00045"></a><span class="lineno">   45</span> <span class="comment">/*        Private functions                                                   */</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="keywordtype">float</span> hawki_tools_get_kth_float(<span class="keywordtype">float</span> * a,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                                 <span class="keywordtype">int</span>        n,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                                 <span class="keywordtype">int</span>        k);</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">/*----------------------------------------------------------------------------*/</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="l00059"></a><span class="lineno">   59</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="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a></div>
+<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6">   70</a></span> (cpl_table ** raw_stats)</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> idet;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="comment">/* Error state variables */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     cpl_errorstate  prestate = cpl_errorstate_get();</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="comment">/* Check inputs */</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="keywordflow">if</span>(raw_stats == NULL)</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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="keywordflow">if</span>(raw_stats[idet] == NULL)</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Creates the proper columns */</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         cpl_table_new_column</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>             (raw_stats[idet],HAWKI_COL_STAT_MIN,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MIN,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>             (raw_stats[idet],HAWKI_COL_STAT_MAX,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MAX,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>             (raw_stats[idet],HAWKI_COL_STAT_MED,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MED,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             (raw_stats[idet],HAWKI_COL_STAT_MEAN,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_MEAN,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         cpl_table_new_column    </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>             (raw_stats[idet],HAWKI_COL_STAT_RMS,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         cpl_table_set_column_unit(raw_stats[idet],HAWKI_COL_STAT_RMS,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>             (raw_stats[idet],HAWKI_COL_STAT_USED,CPL_TYPE_INT);</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="comment">/* Check error status and exit */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f">  137</a></span> (cpl_table       ** image_stats,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>  <span class="keyword">const</span> cpl_image *  image,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>  <span class="keywordtype">int</span>                llx,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>  <span class="keywordtype">int</span>                lly,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>  <span class="keywordtype">int</span>                urx,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>  <span class="keywordtype">int</span>                ury,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>  <span class="keywordtype">int</span>                idet,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>  <span class="keywordtype">int</span>                irow)</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">/* stats variables */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordtype">double</span> minval;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordtype">double</span> maxval;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="keywordtype">double</span> median;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordtype">double</span> stdev;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keywordtype">double</span> mean;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     cpl_stats * stats_ima ;</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="comment">/* Error state variables */</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_errorstate  prestate = cpl_errorstate_get();</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">/* Checking input */</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordflow">if</span>(image_stats == NULL || image == NULL)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Compute statistics */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     stats_ima = cpl_stats_new_from_image_window</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         (image, CPL_STATS_ALL, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">if</span>(stats_ima == NULL)</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>         <span class="keywordflow">return</span> -1;</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">/* Get the stats from the storage structure */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     minval  = cpl_stats_get_min(stats_ima);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     maxval  = cpl_stats_get_max(stats_ima);</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     median  = cpl_stats_get_median(stats_ima);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     stdev   = cpl_stats_get_stdev(stats_ima);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     mean    = cpl_stats_get_mean(stats_ima);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_stats_delete(stats_ima);</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">/* Store in table */</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MIN,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                          irow, minval);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MAX,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                          irow, maxval);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MED,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                          irow, median);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_MEAN,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                          irow, mean);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     cpl_table_set_double(image_stats[idet], HAWKI_COL_STAT_RMS,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                          irow, stdev) ;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_table_set_int(image_stats[idet], HAWKI_COL_STAT_USED,</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                       irow, 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="comment">/* Check error status and exit */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">return</span> 0;</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="keywordtype">int</span> hawki_image_stats_odd_even_column_row_fill_from_image</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> (cpl_table       ** odd_column_stats,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>  cpl_table       ** even_column_stats,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>  cpl_table       ** odd_row_stats,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>  cpl_table       ** even_row_stats,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>  <span class="keyword">const</span> cpl_image *  image,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>  <span class="keywordtype">int</span>                idet,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>  <span class="keywordtype">int</span>                irow)</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">/* stats variables */</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="keywordtype">int</span>    i;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordtype">int</span>    j;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="keywordtype">int</span>    nx;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="keywordtype">int</span>    ny;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keywordtype">double</span> minval;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordtype">double</span> maxval;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordtype">double</span> median;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="keywordtype">double</span> stdev;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keywordtype">double</span> mean;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_stats  * stats_ima;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_image  * tmp_ima;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     cpl_mask   * mask;</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">/* Error state variables */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_errorstate  prestate = cpl_errorstate_get();</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">/* Checking input */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">if</span>(odd_column_stats == NULL  || </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>        even_column_stats == NULL || </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>        odd_row_stats == NULL     || </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>        even_row_stats == NULL    || </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>        image == NULL)</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         <span class="keywordflow">return</span> -1;</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">/* Copying the target image */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     tmp_ima = cpl_image_duplicate(image);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     nx = cpl_image_get_size_x(tmp_ima);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     ny = cpl_image_get_size_y(tmp_ima);</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">/* Compute statistics odd column */</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     mask = cpl_image_get_bpm(tmp_ima);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)</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">if</span>((i+1) % 2)</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>             <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)</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>                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);</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>     stats_ima = cpl_stats_new_from_image</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         (tmp_ima, CPL_STATS_ALL);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordflow">if</span>(stats_ima == 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>         cpl_image_delete(tmp_ima);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Get the stats from the storage structure */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     minval  = cpl_stats_get_min(stats_ima);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     maxval  = cpl_stats_get_max(stats_ima);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     median  = cpl_stats_get_median(stats_ima);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     stdev   = cpl_stats_get_stdev(stats_ima);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     mean    = cpl_stats_get_mean(stats_ima);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_stats_delete(stats_ima);</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">/* Store in table */</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MIN,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                          irow, minval);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MAX,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                          irow, maxval);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MED,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                          irow, median);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_MEAN,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                          irow, mean);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cpl_table_set_double(odd_column_stats[idet], HAWKI_COL_STAT_RMS,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                          irow, stdev) ;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_table_set_int(odd_column_stats[idet], HAWKI_COL_STAT_USED,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                       irow, 1) ;</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">/* Compute statistics even column */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="comment">//cpl_image_reject_from_mask();</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_image_accept_all(tmp_ima);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     mask = cpl_image_get_bpm(tmp_ima);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)</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>(i % 2)</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>             <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)</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_mask_set(mask, i + 1, j + 1, CPL_BINARY_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>     stats_ima = cpl_stats_new_from_image</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         (tmp_ima, CPL_STATS_ALL);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">if</span>(stats_ima == 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>         cpl_image_delete(tmp_ima);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Get the stats from the storage structure */</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     minval  = cpl_stats_get_min(stats_ima);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     maxval  = cpl_stats_get_max(stats_ima);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     median  = cpl_stats_get_median(stats_ima);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     stdev   = cpl_stats_get_stdev(stats_ima);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     mean    = cpl_stats_get_mean(stats_ima);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_stats_delete(stats_ima);</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">/* Store in table */</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MIN,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                          irow, minval);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MAX,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                          irow, maxval);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MED,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                          irow, median);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_MEAN,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                          irow, mean);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_table_set_double(even_column_stats[idet], HAWKI_COL_STAT_RMS,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                          irow, stdev) ;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_table_set_int(even_column_stats[idet], HAWKI_COL_STAT_USED,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                       irow, 1) ;</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">/* Compute statistics odd rows */</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_image_accept_all(tmp_ima);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     mask = cpl_image_get_bpm(tmp_ima);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)</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>((j+1) % 2)</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>             <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)</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_mask_set(mask, i + 1, j + 1, CPL_BINARY_1);</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>     stats_ima = cpl_stats_new_from_image</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         (tmp_ima, CPL_STATS_ALL) ;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keywordflow">if</span>(stats_ima == NULL)</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>         cpl_image_delete(tmp_ima);</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> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="comment">/* Get the stats from the storage structure */</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     minval  = cpl_stats_get_min(stats_ima);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     maxval  = cpl_stats_get_max(stats_ima);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     median  = cpl_stats_get_median(stats_ima);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     stdev   = cpl_stats_get_stdev(stats_ima);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     mean    = cpl_stats_get_mean(stats_ima);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_stats_delete(stats_ima);</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">/* Store in table */</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MIN,</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                          irow, minval);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MAX,</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                          irow, maxval);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MED,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                          irow, median);</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_MEAN,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                          irow, mean);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_table_set_double(odd_row_stats[idet], HAWKI_COL_STAT_RMS,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                          irow, stdev) ;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_table_set_int(odd_row_stats[idet], HAWKI_COL_STAT_USED,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                       irow, 1) ;</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">/* Compute statistics even row */</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     cpl_image_accept_all(tmp_ima);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     mask = cpl_image_get_bpm(tmp_ima);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keywordflow">for</span>(j=0 ; j < ny ; ++j)</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>(j % 2)</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>             <span class="keywordflow">for</span>(i=0 ; i < nx ; ++i)</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>                 cpl_mask_set(mask, i + 1, j + 1, CPL_BINARY_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>     stats_ima = cpl_stats_new_from_image</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         (tmp_ima, CPL_STATS_ALL) ;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">if</span>(stats_ima == 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(tmp_ima);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>         <span class="keywordflow">return</span> -1;</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">/* Get the stats from the storage structure */</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     minval  = cpl_stats_get_min(stats_ima);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     maxval  = cpl_stats_get_max(stats_ima);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     median  = cpl_stats_get_median(stats_ima);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     stdev   = cpl_stats_get_stdev(stats_ima);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     mean    = cpl_stats_get_mean(stats_ima);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_stats_delete(stats_ima);</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">/* Store in table */</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MIN,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                          irow, minval);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MAX,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                          irow, maxval);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MED,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                          irow, median);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_MEAN,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                          irow, mean);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     cpl_table_set_double(even_row_stats[idet], HAWKI_COL_STAT_RMS,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                          irow, stdev) ;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_table_set_int(even_row_stats[idet], HAWKI_COL_STAT_USED,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                       irow, 1) ;</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">/* Free */</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     cpl_image_delete(tmp_ima);</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">/* Check error status and exit */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> <span class="comment">/*----------------------------------------------------------------------------*/</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">int</span> <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a></div>
+<div class="line"><a name="l00430"></a><span class="lineno"><a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836">  430</a></span> (cpl_table       ** image_stats,</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>  <span class="keyword">const</span> cpl_frame *  frame,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>  <span class="keywordtype">int</span>                irow)</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="keywordtype">int</span>              idet;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     cpl_imagelist  * images;</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>     <span class="comment">/* Loading the four chips */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordflow">if</span>(images == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not read file %s"</span>,</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                       cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         <span class="keywordflow">return</span> -1;</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>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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">int</span> nx, ny;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         nx = cpl_image_get_size_x(cpl_imagelist_get(images,idet));</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         ny = cpl_image_get_size_y(cpl_imagelist_get(images,idet));</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>             (image_stats,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>              cpl_imagelist_get(images,idet),</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>              1, 1, nx, ny, idet, irow);</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="comment">/* Free and exit */</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     cpl_imagelist_delete(images);</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> <span class="keywordtype">int</span> hawki_image_stats_print</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> (cpl_table ** table_stats)</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="keywordtype">int</span> idet;</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordtype">int</span> istat;</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">/* Print header */</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cpl_msg_info(__func__, <span class="stringliteral">"Stats summary"</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="comment">/* Loop on detectors */</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">for</span>( idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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">/* Chip header */</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         cpl_msg_info(__func__, <span class="stringliteral">"Chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         cpl_msg_info(__func__, <span class="stringliteral">"image      min        max        med     rms"</span>) ;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_msg_info(__func__, <span class="stringliteral">"--------------------------------------------"</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">/* Loop on images */</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         <span class="keywordflow">for</span>(istat = 0; istat < cpl_table_get_nrow(table_stats[idet]); ++istat)</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_msg_info(__func__, <span class="stringliteral">"%02d   %10.2f %10.2f %10.2f %10.2f"</span>,</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                          istat+1,</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                          cpl_table_get_double(table_stats[idet],</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                               HAWKI_COL_STAT_MIN,istat,NULL),</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                          cpl_table_get_double(table_stats[idet],</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                                               HAWKI_COL_STAT_MAX,istat,NULL),</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                          cpl_table_get_double(table_stats[idet],</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                                               HAWKI_COL_STAT_MED,istat,NULL ),</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                          cpl_table_get_double(table_stats[idet],</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                                               HAWKI_COL_STAT_RMS,istat,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>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">return</span> 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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a></div>
+<div class="line"><a name="l00512"></a><span class="lineno"><a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928">  512</a></span> (cpl_table         ** image_stats,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>  cpl_propertylist  ** stats_stats)</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_array * col_names;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="keywordtype">int</span>         idet;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordtype">int</span>         icol;</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="comment">/* Check entries */</span></div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     <span class="keywordflow">if</span>(image_stats == NULL || stats_stats == NULL)</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>     <span class="comment">/* Fill the name of the interesting columns */</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     col_names = cpl_array_new(5, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     cpl_array_set_string(col_names, 0, HAWKI_COL_STAT_MIN);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     cpl_array_set_string(col_names, 1, HAWKI_COL_STAT_MAX);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     cpl_array_set_string(col_names, 2, HAWKI_COL_STAT_MED);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     cpl_array_set_string(col_names, 3, HAWKI_COL_STAT_MEAN);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     cpl_array_set_string(col_names, 4, HAWKI_COL_STAT_RMS);</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">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; ++idet) </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">for</span>(icol = 0;icol < 5; ++icol)</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="keyword">const</span> <span class="keywordtype">char</span> * this_col_name = cpl_array_get_string(col_names, icol);</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>             <span class="keywordtype">char</span>         mean_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             <span class="keywordtype">char</span>         median_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             <span class="keywordtype">char</span>         minimum_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             <span class="keywordtype">char</span>         maximum_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>             <span class="keywordtype">char</span>         stdev_col_name[256] = <span class="stringliteral">"ESO QC RAW "</span>;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>             strncat(mean_col_name, this_col_name, 244);</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             strncat(mean_col_name, <span class="stringliteral">" MEAN"</span>, 236);</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             cpl_propertylist_append_double</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                 (stats_stats[idet], mean_col_name, </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                  cpl_table_get_column_mean(image_stats[idet],this_col_name));</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             strncat(median_col_name, this_col_name, 255);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             strncat(median_col_name, <span class="stringliteral">" MEDIAN"</span>, 236);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             cpl_propertylist_append_double</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>                 (stats_stats[idet], median_col_name, </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>                  cpl_table_get_column_median(image_stats[idet],this_col_name));</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             strncat(minimum_col_name, this_col_name, 255);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             strncat(minimum_col_name, <span class="stringliteral">" MINIMUM"</span>, 236);</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             cpl_propertylist_append_double</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                 (stats_stats[idet], minimum_col_name, </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                  cpl_table_get_column_min(image_stats[idet],this_col_name));</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>             strncat(maximum_col_name, this_col_name, 255);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>             strncat(maximum_col_name, <span class="stringliteral">" MAXIMUM"</span>, 236);</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>             cpl_propertylist_append_double</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                 (stats_stats[idet], maximum_col_name, </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                  cpl_table_get_column_max(image_stats[idet],this_col_name));</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>             strncat(stdev_col_name, this_col_name, 255);</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>             strncat(stdev_col_name, <span class="stringliteral">" STDEV"</span>, 236);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>             cpl_propertylist_append_double</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                 (stats_stats[idet], stdev_col_name, </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                  cpl_table_get_column_stdev(image_stats[idet],this_col_name));</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>     </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="comment">/*Free and return */</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_array_delete(col_names);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651">  582</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(cpl_image * image)</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="keywordtype">int</span>      npixels;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordtype">int</span>      ipix_0_25;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordtype">int</span>      ipix_0_75;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordtype">double</span>   first_quartil;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordtype">double</span>   third_quartil;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordtype">double</span>   sigma_from_quartile;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keywordtype">float</span>  * data;</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>     npixels = cpl_image_get_size_x(image) * cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     data = cpl_image_get_data(image);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     ipix_0_25 = (int)(npixels * 0.25);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     ipix_0_75 = (int)(npixels * 0.75);</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>     first_quartil = hawki_tools_get_kth_float(data, npixels, ipix_0_25);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     third_quartil = hawki_tools_get_kth_float(data, npixels, ipix_0_75);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     sigma_from_quartile = (third_quartil - first_quartil) / 1.35;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">return</span> sigma_from_quartile;</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">/* Swap macro */</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="preprocessor">#undef SWAP</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="preprocessor"></span><span class="preprocessor">#define SWAP(a,b) { register float t=(a);(a)=(b);(b)=t; }</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> <span class="keywordtype">float</span> hawki_tools_get_kth_float(<span class="keywordtype">float</span> * a,</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>                                 <span class="keywordtype">int</span>        n,</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>                                 <span class="keywordtype">int</span>        k)</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="keyword">register</span> <span class="keywordtype">float</span> x;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keyword">register</span> <span class="keywordtype">int</span>    i, j, l, m;</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>     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00);</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>     l=0; m=n-1;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keywordflow">while</span> (l<m) {</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         x=a[k];</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         i=l;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         j=m;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>             <span class="keywordflow">while</span> (a[i]<x) i++;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             <span class="keywordflow">while</span> (x<a[j]) j--;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             <span class="keywordflow">if</span> (i<=j) {</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                 SWAP(a[i],a[j]);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>                 i++; j--;</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">while</span> (i<=j);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         <span class="keywordflow">if</span> (j<k) l=i;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         <span class="keywordflow">if</span> (k<i) m=j;</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">return</span> a[k];</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><!-- 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/hawki__image__stats_8h_source.html b/html/hawki__image__stats_8h_source.html
index 82013d7..ca3f5b5 100644
--- a/html/hawki__image__stats_8h_source.html
+++ b/html/hawki__image__stats_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_image_stats.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,88 +40,89 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_image_stats.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_image_stats.h,v 1.4 2009/11/25 16:24: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/11/25 16:24:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_IMAGE_STATS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMAGE_STATS_H</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 
-<a name="l00038"></a>00038 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>
-<a name="l00039"></a>00039 (cpl_table ** raw_stats);
-<a name="l00040"></a>00040 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l00041"></a>00041 (cpl_table       ** image_stats,
-<a name="l00042"></a>00042  <span class="keyword">const</span> cpl_image *  image,
-<a name="l00043"></a>00043  <span class="keywordtype">int</span>                llx,
-<a name="l00044"></a>00044  <span class="keywordtype">int</span>                lly,
-<a name="l00045"></a>00045  <span class="keywordtype">int</span>                urx,
-<a name="l00046"></a>00046  <span class="keywordtype">int</span>                ury,
-<a name="l00047"></a>00047  <span class="keywordtype">int</span>                idet,
-<a name="l00048"></a>00048  <span class="keywordtype">int</span>                irow);
-<a name="l00049"></a>00049 <span class="keywordtype">int</span> hawki_image_stats_odd_even_column_row_fill_from_image
-<a name="l00050"></a>00050 (cpl_table       ** odd_column_stats,
-<a name="l00051"></a>00051  cpl_table       ** even_column_stats,
-<a name="l00052"></a>00052  cpl_table       ** odd_row_stats,
-<a name="l00053"></a>00053  cpl_table       ** even_row_stats,
-<a name="l00054"></a>00054  <span class="keyword">const</span> cpl_image *  image,
-<a name="l00055"></a>00055  <span class="keywordtype">int</span>                idet,
-<a name="l00056"></a>00056  <span class="keywordtype">int</span>                irow);
-<a name="l00057"></a>00057 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a>
-<a name="l00058"></a>00058 (cpl_table       ** image_stats,
-<a name="l00059"></a>00059  <span class="keyword">const</span> cpl_frame *  frame,
-<a name="l00060"></a>00060  <span class="keywordtype">int</span>                irow);
-<a name="l00061"></a>00061 <span class="keywordtype">int</span> hawki_image_stats_print
-<a name="l00062"></a>00062 (cpl_table ** table_stats);
-<a name="l00063"></a>00063 <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>
-<a name="l00064"></a>00064 (cpl_table         ** image_stats,
-<a name="l00065"></a>00065  cpl_propertylist  ** stats_stats);
-<a name="l00066"></a>00066 <span class="keywordtype">double</span> <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(cpl_image * image);
-<a name="l00067"></a>00067 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_image_stats.h,v 1.4 2009/11/25 16:24: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/11/25 16:24:13 $</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: hawki-1_8_12 $</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 HAWKI_IMAGE_STATS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_IMAGE_STATS_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="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> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> (cpl_table ** raw_stats);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> (cpl_table       ** image_stats,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>  <span class="keyword">const</span> cpl_image *  image,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  <span class="keywordtype">int</span>                llx,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>  <span class="keywordtype">int</span>                lly,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>  <span class="keywordtype">int</span>                urx,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>  <span class="keywordtype">int</span>                ury,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>  <span class="keywordtype">int</span>                idet,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>  <span class="keywordtype">int</span>                irow);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keywordtype">int</span> hawki_image_stats_odd_even_column_row_fill_from_image</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> (cpl_table       ** odd_column_stats,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>  cpl_table       ** even_column_stats,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>  cpl_table       ** odd_row_stats,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>  cpl_table       ** even_row_stats,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>  <span class="keyword">const</span> cpl_image *  image,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>  <span class="keywordtype">int</span>                idet,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>  <span class="keywordtype">int</span>                irow);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> (cpl_table       ** image_stats,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  <span class="keyword">const</span> cpl_frame *  frame,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  <span class="keywordtype">int</span>                irow);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keywordtype">int</span> hawki_image_stats_print</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> (cpl_table ** table_stats);</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> (cpl_table         ** image_stats,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  cpl_propertylist  ** stats_stats);</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(cpl_image * image);</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</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/hawki__load_8c_source.html b/html/hawki__load_8c_source.html
index 4479a61..2c000a5 100644
--- a/html/hawki__load_8c_source.html
+++ b/html/hawki__load_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_load.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,800 +40,801 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_load.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_load.c,v 1.40 2009/12/04 10:39: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/12/04 10:39:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.40 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <string.h></span>
-<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 "hawki_load.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00053"></a>00053 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00062"></a>00062 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00063"></a><a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a">00063</a> cpl_frameset * <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(
-<a name="l00064"></a>00064         <span class="keyword">const</span> cpl_frameset  *   in,
-<a name="l00065"></a>00065         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   tag)
-<a name="l00066"></a>00066 {
-<a name="l00067"></a>00067     cpl_frameset    *   out ;
-<a name="l00068"></a>00068     <span class="keyword">const</span> cpl_frame *   cur_frame ;
-<a name="l00069"></a>00069     cpl_frame       *   loc_frame ;
-<a name="l00070"></a>00070     <span class="keywordtype">int</span>                 nbframes, nbext ;
-<a name="l00071"></a>00071     <span class="keywordtype">int</span>                 i ;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <span class="comment">/* Test entries */</span>
-<a name="l00074"></a>00074     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00075"></a>00075     <span class="keywordflow">if</span> (tag == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077     <span class="comment">/* Initialise */</span>
-<a name="l00078"></a>00078     nbframes = cpl_frameset_get_size(in) ;
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="comment">/* Count the frames with the tag */</span>
-<a name="l00081"></a>00081     <span class="keywordflow">if</span> ((nbext = cpl_frameset_count_tags(in, tag)) == 0) <span class="keywordflow">return</span> NULL ;
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     <span class="comment">/* Create the output frameset */</span>
-<a name="l00084"></a>00084     out = cpl_frameset_new() ;
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     <span class="comment">/* Loop on the requested frames and store them in out */</span>
-<a name="l00087"></a>00087     nbext = 0 ;
-<a name="l00088"></a>00088     <span class="keywordflow">for</span> (i=0 ; i<nbframes ; i++) {
-<a name="l00089"></a>00089         cur_frame = cpl_frameset_get_frame_const(in, i) ;
-<a name="l00090"></a>00090         <span class="keywordflow">if</span> (!strcmp(cpl_frame_get_tag(cur_frame), tag)) {
-<a name="l00091"></a>00091             loc_frame = cpl_frame_duplicate(cur_frame) ;
-<a name="l00092"></a>00092             cpl_frameset_insert(out, loc_frame) ;
-<a name="l00093"></a>00093             nbext ++ ;
-<a name="l00094"></a>00094         }
-<a name="l00095"></a>00095     }
-<a name="l00096"></a>00096     <span class="keywordflow">return</span> out ;
-<a name="l00097"></a>00097 }
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00109"></a>00109 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00110"></a><a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a">00110</a> cpl_image * <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(
-<a name="l00111"></a>00111         <span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00112"></a>00112         <span class="keywordtype">int</span>                     fnum,
-<a name="l00113"></a>00113         <span class="keywordtype">int</span>                     chip,
-<a name="l00114"></a>00114         <span class="keywordtype">int</span>                     quad,
-<a name="l00115"></a>00115         cpl_type                ptype)
-<a name="l00116"></a>00116 {
-<a name="l00117"></a>00117     <span class="keyword">const</span> cpl_frame     *   frame ;
-<a name="l00118"></a>00118     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00119"></a>00119     cpl_image           *   ima ;
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121     <span class="comment">/* Test entries */</span>
-<a name="l00122"></a>00122     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00123"></a>00123     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00124"></a>00124     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> NULL ;
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126     <span class="comment">/* Load the fnum frame */</span>
-<a name="l00127"></a>00127     frame = cpl_frameset_get_frame_const(fset, fnum) ;
-<a name="l00128"></a>00128     fname = cpl_frame_get_filename(frame) ;
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     <span class="comment">/* Load */</span>
-<a name="l00131"></a>00131     <span class="keywordflow">if</span> ((ima=<a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(fname, chip, quad, ptype)) == NULL) {
-<a name="l00132"></a>00132         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d quarter %d)"</span>,
-<a name="l00133"></a>00133                 fnum+1, chip, quad) ;
-<a name="l00134"></a>00134         <span class="keywordflow">return</span> NULL ;
-<a name="l00135"></a>00135     }
-<a name="l00136"></a>00136     <span class="keywordflow">return</span> ima ;
-<a name="l00137"></a>00137 }
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00148"></a>00148 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00149"></a><a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7">00149</a> cpl_image * <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(
-<a name="l00150"></a>00150         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,
-<a name="l00151"></a>00151         <span class="keywordtype">int</span>             chip,
-<a name="l00152"></a>00152         <span class="keywordtype">int</span>             quad,
-<a name="l00153"></a>00153         cpl_type        ptype)
-<a name="l00154"></a>00154 {
-<a name="l00155"></a>00155     cpl_image           *   ima ;
-<a name="l00156"></a>00156     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00157"></a>00157     <span class="keywordtype">int</span>                     llx, lly, urx, ury ;
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     <span class="comment">/* Test entries */</span>
-<a name="l00160"></a>00160     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00161"></a>00161     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00162"></a>00162     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> NULL ;
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/* Define the window */</span>
-<a name="l00165"></a>00165     <span class="keywordflow">if</span> (quad == 1) {
-<a name="l00166"></a>00166         llx = lly = 1 ;
-<a name="l00167"></a>00167         urx = ury = 1024 ;
-<a name="l00168"></a>00168     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 2) {
-<a name="l00169"></a>00169         llx = 1025 ;
-<a name="l00170"></a>00170         lly = 1 ;
-<a name="l00171"></a>00171         urx = 2048 ;
-<a name="l00172"></a>00172         ury = 1024 ;
-<a name="l00173"></a>00173     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 3) {
-<a name="l00174"></a>00174         llx = 1 ;
-<a name="l00175"></a>00175         lly = 1025 ;
-<a name="l00176"></a>00176         urx = 1024 ;
-<a name="l00177"></a>00177         ury = 2048 ;
-<a name="l00178"></a>00178     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 4) {
-<a name="l00179"></a>00179         llx = lly = 1025 ;
-<a name="l00180"></a>00180         urx = ury = 2048 ;
-<a name="l00181"></a>00181     } <span class="keywordflow">else</span> <span class="keywordflow">return</span> NULL ;
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <span class="comment">/* Get the extension with the wished chip */</span>
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {
-<a name="l00185"></a>00185         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,
-<a name="l00186"></a>00186                 chip+1) ;
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> NULL ;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="comment">/* Load */</span>
-<a name="l00191"></a>00191     <span class="keywordflow">if</span> ((ima=cpl_image_load_window(fname, ptype, 0, ext_nb, llx, lly, urx,
-<a name="l00192"></a>00192                     ury)) == NULL) {
-<a name="l00193"></a>00193         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d quarter %d from %s"</span>,
-<a name="l00194"></a>00194                 chip, quad, fname) ;
-<a name="l00195"></a>00195         <span class="keywordflow">return</span> NULL ;
-<a name="l00196"></a>00196     }
-<a name="l00197"></a>00197     <span class="keywordflow">return</span> ima ;
-<a name="l00198"></a>00198 }
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00208"></a>00208 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00209"></a><a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895">00209</a> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(
-<a name="l00210"></a>00210         <span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00211"></a>00211         <span class="keywordtype">int</span>                     chip,
-<a name="l00212"></a>00212         cpl_type                ptype)
-<a name="l00213"></a>00213 {
-<a name="l00214"></a>00214     <span class="keywordtype">int</span>                     nframes ;
-<a name="l00215"></a>00215     cpl_imagelist       *   out ;
-<a name="l00216"></a>00216     <span class="keyword">const</span> cpl_frame     *   frame ;
-<a name="l00217"></a>00217     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00218"></a>00218     cpl_image           *   ima ;
-<a name="l00219"></a>00219     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00220"></a>00220     <span class="keywordtype">int</span>                     i ;
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="comment">/* Test entries */</span>
-<a name="l00223"></a>00223     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00224"></a>00224     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00225"></a>00225     nframes = cpl_frameset_get_size(fset) ;
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/* Create the output list */</span>
-<a name="l00228"></a>00228     out = cpl_imagelist_new() ;
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="comment">/* Loop on the frames */</span>
-<a name="l00231"></a>00231     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233         <span class="comment">/* Load the ith frame */</span>
-<a name="l00234"></a>00234         frame = cpl_frameset_get_frame_const(fset, i) ;
-<a name="l00235"></a>00235         fname = cpl_frame_get_filename(frame) ;
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237         <span class="comment">/* Get the extension with the wished chip */</span>
-<a name="l00238"></a>00238         <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {
-<a name="l00239"></a>00239             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,
-<a name="l00240"></a>00240                     chip) ;
-<a name="l00241"></a>00241             cpl_imagelist_delete(out);
-<a name="l00242"></a>00242             <span class="keywordflow">return</span> NULL ;
-<a name="l00243"></a>00243         }
-<a name="l00244"></a>00244         <span class="comment">/* Load */</span>
-<a name="l00245"></a>00245         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL) {
-<a name="l00246"></a>00246             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,
-<a name="l00247"></a>00247                     i+1, chip) ;
-<a name="l00248"></a>00248             cpl_imagelist_delete(out) ;
-<a name="l00249"></a>00249             <span class="keywordflow">return</span> NULL ;
-<a name="l00250"></a>00250         }
-<a name="l00251"></a>00251         cpl_imagelist_set(out, ima, i) ;
-<a name="l00252"></a>00252     }
-<a name="l00253"></a>00253     <span class="keywordflow">return</span> out ;
-<a name="l00254"></a>00254 }
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00264"></a>00264 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00265"></a>00265 cpl_imagelist * <a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d" title="Loads a given extension from a HAWKI frameset in an image list.">hawki_load_extensions</a>
-<a name="l00266"></a><a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d">00266</a> (<span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00267"></a>00267  <span class="keywordtype">int</span>                     extension,
-<a name="l00268"></a>00268  cpl_type                ptype)
-<a name="l00269"></a>00269 {
-<a name="l00270"></a>00270     <span class="keywordtype">int</span>                     nframes ;
-<a name="l00271"></a>00271     cpl_imagelist       *   out ;
-<a name="l00272"></a>00272     <span class="keyword">const</span> cpl_frame     *   frame ;
-<a name="l00273"></a>00273     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00274"></a>00274     cpl_image           *   ima ;
-<a name="l00275"></a>00275     <span class="keywordtype">int</span>                     iframe;
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* Test entries */</span>
-<a name="l00278"></a>00278     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00279"></a>00279     nframes = cpl_frameset_get_size(fset) ;
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     <span class="comment">/* Create the output list */</span>
-<a name="l00282"></a>00282     out = cpl_imagelist_new() ;
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/* Loop on the frames */</span>
-<a name="l00285"></a>00285     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) {
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287         <span class="comment">/* Load the ith frame */</span>
-<a name="l00288"></a>00288         frame = cpl_frameset_get_frame_const(fset, iframe) ;
-<a name="l00289"></a>00289         fname = cpl_frame_get_filename(frame) ;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291         <span class="comment">/* Load */</span>
-<a name="l00292"></a>00292         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, extension)) == NULL) {
-<a name="l00293"></a>00293             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (extension %d)"</span>,
-<a name="l00294"></a>00294                     iframe+1, extension) ;
-<a name="l00295"></a>00295             cpl_imagelist_delete(out) ;
-<a name="l00296"></a>00296             <span class="keywordflow">return</span> NULL ;
-<a name="l00297"></a>00297         }
-<a name="l00298"></a>00298         cpl_imagelist_set(out, ima, iframe) ;
-<a name="l00299"></a>00299     }
-<a name="l00300"></a>00300     <span class="keywordflow">return</span> out ;
-<a name="l00301"></a>00301 }
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00312"></a>00312 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00313"></a><a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed">00313</a> cpl_image * <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(
-<a name="l00314"></a>00314         <span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00315"></a>00315         <span class="keywordtype">int</span>                     fnum,
-<a name="l00316"></a>00316         <span class="keywordtype">int</span>                     chip,
-<a name="l00317"></a>00317         cpl_type                ptype)
-<a name="l00318"></a>00318 {
-<a name="l00319"></a>00319     <span class="keyword">const</span> cpl_frame     *   frame ;
-<a name="l00320"></a>00320     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00321"></a>00321     cpl_image           *   ima ;
-<a name="l00322"></a>00322     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="comment">/* Test entries */</span>
-<a name="l00325"></a>00325     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00326"></a>00326     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     <span class="comment">/* Load the fnum frame */</span>
-<a name="l00329"></a>00329     frame = cpl_frameset_get_frame_const(fset, fnum) ;
-<a name="l00330"></a>00330     fname = cpl_frame_get_filename(frame) ;
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="comment">/* Check that the frame has the right number of extension */</span>
-<a name="l00333"></a>00333     <span class="keywordflow">if</span>(cpl_frame_get_nextensions(frame) != HAWKI_NB_DETECTORS)
-<a name="l00334"></a>00334     {
-<a name="l00335"></a>00335         cpl_msg_error(__func__, <span class="stringliteral">"File %s contains less than %d extensions"</span>,
-<a name="l00336"></a>00336                       fname, HAWKI_NB_DETECTORS);
-<a name="l00337"></a>00337         <span class="keywordflow">return</span> NULL ;
-<a name="l00338"></a>00338     }
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="comment">/* Get the extension with the wished chip */</span>
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {
-<a name="l00342"></a>00342         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,
-<a name="l00343"></a>00343                 chip+1) ;
-<a name="l00344"></a>00344         <span class="keywordflow">return</span> NULL ;
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346     <span class="comment">/* Load */</span>
-<a name="l00347"></a>00347     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL) {
-<a name="l00348"></a>00348         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,
-<a name="l00349"></a>00349                 fnum+1, chip) ;
-<a name="l00350"></a>00350         <span class="keywordflow">return</span> NULL ;
-<a name="l00351"></a>00351     }
-<a name="l00352"></a>00352     <span class="keywordflow">return</span> ima ;
-<a name="l00353"></a>00353 }
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00364"></a>00364 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00365"></a><a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438">00365</a> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(
-<a name="l00366"></a>00366         <span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00367"></a>00367         <span class="keywordtype">int</span>                     chip,
-<a name="l00368"></a>00368         <span class="keywordtype">int</span>                     quad,
-<a name="l00369"></a>00369         cpl_type                ptype)
-<a name="l00370"></a>00370 {
-<a name="l00371"></a>00371     cpl_imagelist       *   out ;
-<a name="l00372"></a>00372     cpl_image           *   ima ;
-<a name="l00373"></a>00373     <span class="keywordtype">int</span>                     i ;
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375     <span class="comment">/* Test entries */</span>
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00377"></a>00377     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00378"></a>00378     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> NULL ;
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="comment">/* Create the output imagelist */</span>
-<a name="l00381"></a>00381     out = cpl_imagelist_new() ;
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="comment">/* Loop on the frames */</span>
-<a name="l00384"></a>00384     <span class="keywordflow">for</span> (i=0 ; i<cpl_frameset_get_size(fset) ; i++) {
-<a name="l00385"></a>00385         ima = <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(fset, i, chip, quad, ptype) ;
-<a name="l00386"></a>00386         <span class="keywordflow">if</span> (ima == NULL) {
-<a name="l00387"></a>00387             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d, quad %d)"</span>,
-<a name="l00388"></a>00388                     i+1, chip, quad) ;
-<a name="l00389"></a>00389             cpl_imagelist_delete(out) ;
-<a name="l00390"></a>00390             <span class="keywordflow">return</span> NULL ;
-<a name="l00391"></a>00391         }
-<a name="l00392"></a>00392         cpl_imagelist_set(out, ima, i) ;
-<a name="l00393"></a>00393     }
-<a name="l00394"></a>00394     <span class="keywordflow">return</span> out ;
-<a name="l00395"></a>00395 }
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00406"></a>00406 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00407"></a><a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32">00407</a> cpl_imagelist * <a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32" title="Load the chip of HAWKI images from a frameset in an image list.">hawki_load_frameset</a>(
-<a name="l00408"></a>00408         <span class="keyword">const</span> cpl_frameset  *   fset,
-<a name="l00409"></a>00409         <span class="keywordtype">int</span>                     chip,
-<a name="l00410"></a>00410         cpl_type                ptype)
-<a name="l00411"></a>00411 {
-<a name="l00412"></a>00412     cpl_imagelist       *   out ;
-<a name="l00413"></a>00413     cpl_image           *   ima ;
-<a name="l00414"></a>00414     <span class="keywordtype">int</span>                     i ;
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="comment">/* Test entries */</span>
-<a name="l00417"></a>00417     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     <span class="comment">/* Create the output imagelist */</span>
-<a name="l00421"></a>00421     out = cpl_imagelist_new() ;
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="comment">/* Loop on the frames */</span>
-<a name="l00424"></a>00424     <span class="keywordflow">for</span> (i=0 ; i<cpl_frameset_get_size(fset) ; i++) {
-<a name="l00425"></a>00425         ima = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(fset, i, chip, ptype) ;
-<a name="l00426"></a>00426         <span class="keywordflow">if</span> (ima == NULL) {
-<a name="l00427"></a>00427             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,
-<a name="l00428"></a>00428                     i+1, chip) ;
-<a name="l00429"></a>00429             cpl_imagelist_delete(out) ;
-<a name="l00430"></a>00430             <span class="keywordflow">return</span> NULL ;
-<a name="l00431"></a>00431         }
-<a name="l00432"></a>00432         cpl_imagelist_set(out, ima, i) ;
-<a name="l00433"></a>00433     }
-<a name="l00434"></a>00434     <span class="keywordflow">return</span> out ;
-<a name="l00435"></a>00435 }
-<a name="l00436"></a>00436 
-<a name="l00444"></a>00444 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00445"></a><a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751">00445</a> cpl_imagelist * <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(
-<a name="l00446"></a>00446         <span class="keyword">const</span> cpl_frame  *   frame,
-<a name="l00447"></a>00447         cpl_type             ptype)
-<a name="l00448"></a>00448 {
-<a name="l00449"></a>00449     cpl_imagelist       *   out;
-<a name="l00450"></a>00450     cpl_image           *   ima;
-<a name="l00451"></a>00451     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname;
-<a name="l00452"></a>00452     <span class="keywordtype">int</span>                     idet;
-<a name="l00453"></a>00453     <span class="keywordtype">int</span>                     ext_nb;
-<a name="l00454"></a>00454     <span class="keywordtype">int</span>                 *   ext_chip_mapping;
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456     <span class="comment">/* Test entries */</span>
-<a name="l00457"></a>00457     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="comment">/* Create the output imagelist */</span>
-<a name="l00460"></a>00460     out = cpl_imagelist_new() ;
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="comment">/* Get the filename */</span>
-<a name="l00463"></a>00463     fname = cpl_frame_get_filename(frame);
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     <span class="comment">/* Check that the frame has the right number of extension */</span>
-<a name="l00466"></a>00466     <span class="keywordflow">if</span>(cpl_frame_get_nextensions(frame) != HAWKI_NB_DETECTORS)
-<a name="l00467"></a>00467     {
-<a name="l00468"></a>00468         cpl_msg_error(__func__, <span class="stringliteral">"File %s contains less than %d extensions"</span>,
-<a name="l00469"></a>00469                       fname, HAWKI_NB_DETECTORS);
-<a name="l00470"></a>00470         cpl_imagelist_delete(out);
-<a name="l00471"></a>00471         <span class="keywordflow">return</span> NULL ;
-<a name="l00472"></a>00472     }
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474     <span class="comment">/* Get the extension-chip mapping */</span>
-<a name="l00475"></a>00475     ext_chip_mapping = <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a>(fname);
-<a name="l00476"></a>00476     <span class="keywordflow">if</span> (ext_chip_mapping == NULL)
-<a name="l00477"></a>00477     {
-<a name="l00478"></a>00478         cpl_msg_error(__func__,<span class="stringliteral">"Cannot get mapping between extension and chip"</span>);
-<a name="l00479"></a>00479         cpl_imagelist_delete(out);
-<a name="l00480"></a>00480         <span class="keywordflow">return</span> NULL;
-<a name="l00481"></a>00481     }
-<a name="l00482"></a>00482     
-<a name="l00483"></a>00483     <span class="comment">/* Loop on the chips */</span>
-<a name="l00484"></a>00484     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00485"></a>00485     {
-<a name="l00486"></a>00486         <span class="comment">/* Get the extension */</span>
-<a name="l00487"></a>00487         ext_nb = ext_chip_mapping[idet];
-<a name="l00488"></a>00488         
-<a name="l00489"></a>00489         <span class="comment">/* Load */</span>
-<a name="l00490"></a>00490         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL)
-<a name="l00491"></a>00491         {
-<a name="l00492"></a>00492             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load frame (detector %d)"</span>,
-<a name="l00493"></a>00493                           idet);
-<a name="l00494"></a>00494             cpl_imagelist_delete(out);
-<a name="l00495"></a>00495             <span class="keywordflow">return</span> NULL;
-<a name="l00496"></a>00496         }
-<a name="l00497"></a>00497         cpl_imagelist_set(out, ima, idet);
-<a name="l00498"></a>00498     }
-<a name="l00499"></a>00499     
-<a name="l00500"></a>00500     <span class="comment">/* Free */</span>
-<a name="l00501"></a>00501     cpl_free(ext_chip_mapping);
-<a name="l00502"></a>00502     <span class="keywordflow">return</span> out;
-<a name="l00503"></a>00503 }
-<a name="l00504"></a>00504 
-<a name="l00512"></a>00512 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00513"></a><a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef">00513</a> cpl_image * <a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef" title="Load one the extensions of HAWKI images from a frame into an image.">hawki_load_frame_extension</a>(
-<a name="l00514"></a>00514         <span class="keyword">const</span> cpl_frame  *   frame,
-<a name="l00515"></a>00515         <span class="keywordtype">int</span>                  iextension,
-<a name="l00516"></a>00516         cpl_type             ptype)
-<a name="l00517"></a>00517 {
-<a name="l00518"></a>00518     cpl_image        *   ima;
-<a name="l00519"></a>00519     <span class="keyword">const</span> <span class="keywordtype">char</span>       *   fname;
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521     <span class="comment">/* Test entries */</span>
-<a name="l00522"></a>00522     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     <span class="comment">/* Get filename */</span>
-<a name="l00525"></a>00525     fname = cpl_frame_get_filename(frame);
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527     <span class="comment">/* Load */</span>
-<a name="l00528"></a>00528     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, iextension)) == NULL)
-<a name="l00529"></a>00529     {
-<a name="l00530"></a>00530         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load frame (extension %d)"</span>,
-<a name="l00531"></a>00531                       iextension) ;
-<a name="l00532"></a>00532         <span class="keywordflow">return</span> NULL ;
-<a name="l00533"></a>00533     }
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535     <span class="comment">/* Return */</span>
-<a name="l00536"></a>00536     <span class="keywordflow">return</span> ima;
-<a name="l00537"></a>00537 }
-<a name="l00538"></a>00538 
-<a name="l00546"></a>00546 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00547"></a><a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1">00547</a> cpl_image * <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>(
-<a name="l00548"></a>00548         <span class="keyword">const</span> cpl_frame  *   frame,
-<a name="l00549"></a>00549         <span class="keywordtype">int</span>                  idet,
-<a name="l00550"></a>00550         cpl_type             ptype)
-<a name="l00551"></a>00551 {
-<a name="l00552"></a>00552     cpl_image        *   ima;
-<a name="l00553"></a>00553     <span class="keyword">const</span> <span class="keywordtype">char</span>       *   fname;
-<a name="l00554"></a>00554     <span class="keywordtype">int</span>                  ext_nb;
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="comment">/* Test entries */</span>
-<a name="l00557"></a>00557     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559     <span class="comment">/* Get filename */</span>
-<a name="l00560"></a>00560     fname = cpl_frame_get_filename(frame);
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="comment">/* Get the extension with the wished chip */</span>
-<a name="l00563"></a>00563     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, idet)) == -1)
-<a name="l00564"></a>00564     {
-<a name="l00565"></a>00565         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,
-<a name="l00566"></a>00566                       idet) ;
-<a name="l00567"></a>00567         <span class="keywordflow">return</span> NULL ;
-<a name="l00568"></a>00568     }
-<a name="l00569"></a>00569     <span class="comment">/* Load */</span>
-<a name="l00570"></a>00570     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL)
-<a name="l00571"></a>00571     {
-<a name="l00572"></a>00572         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load frame (chip %d)"</span>,
-<a name="l00573"></a>00573                       idet) ;
-<a name="l00574"></a>00574         <span class="keywordflow">return</span> NULL ;
-<a name="l00575"></a>00575     }
-<a name="l00576"></a>00576 
-<a name="l00577"></a>00577     <span class="comment">/* Return */</span>
-<a name="l00578"></a>00578     <span class="keywordflow">return</span> ima;
-<a name="l00579"></a>00579 }
-<a name="l00580"></a>00580 
-<a name="l00588"></a>00588 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00589"></a><a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0">00589</a> cpl_table  ** <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(<span class="keyword">const</span> cpl_frame * frame)
-<a name="l00590"></a>00590 {
-<a name="l00591"></a>00591     cpl_table  ** tables;
-<a name="l00592"></a>00592     <span class="keyword">const</span> <span class="keywordtype">char</span> *  filename;
-<a name="l00593"></a>00593     <span class="keywordtype">int</span>           idet;
-<a name="l00594"></a>00594     <span class="keywordtype">int</span>           j;
-<a name="l00595"></a>00595     <span class="keywordtype">int</span>           ext_nb;
-<a name="l00596"></a>00596 
-<a name="l00597"></a>00597     <span class="comment">/* Allocate the set of tables */</span>
-<a name="l00598"></a>00598     tables = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600     <span class="comment">/* Get the filename */</span>
-<a name="l00601"></a>00601     filename = cpl_frame_get_filename(frame);
-<a name="l00602"></a>00602     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00603"></a>00603     {
-<a name="l00604"></a>00604         <span class="comment">/* Get the extension with the wished chip */</span>
-<a name="l00605"></a>00605         <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename, idet+1)) == -1)
-<a name="l00606"></a>00606         {
-<a name="l00607"></a>00607             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with detector %d"</span>,
-<a name="l00608"></a>00608                           idet+1) ;
-<a name="l00609"></a>00609             <span class="keywordflow">return</span> NULL ;
-<a name="l00610"></a>00610         }
-<a name="l00611"></a>00611         <span class="comment">/* Load the table */</span>
-<a name="l00612"></a>00612         <span class="keywordflow">if</span>((tables[idet] = cpl_table_load(filename, ext_nb, 0) ) == NULL)
-<a name="l00613"></a>00613         {
-<a name="l00614"></a>00614             <span class="keywordflow">for</span> (j=0 ; j< idet ; j++)
-<a name="l00615"></a>00615             {
-<a name="l00616"></a>00616                 cpl_table_delete(tables[j]);
-<a name="l00617"></a>00617             }
-<a name="l00618"></a>00618             cpl_free(tables);
-<a name="l00619"></a>00619             <span class="keywordflow">return</span> NULL;
-<a name="l00620"></a>00620         }
-<a name="l00621"></a>00621     }
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     <span class="keywordflow">return</span>  tables;
-<a name="l00624"></a>00624 }
-<a name="l00625"></a>00625 
-<a name="l00632"></a>00632 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00633"></a><a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1">00633</a> cpl_bivector  ** <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a>(<span class="keyword">const</span> cpl_frame * offsets_frame)
-<a name="l00634"></a>00634 {
-<a name="l00635"></a>00635     cpl_errorstate    previous_state;
-<a name="l00636"></a>00636     cpl_table      ** offsets_tables;
-<a name="l00637"></a>00637     cpl_bivector   ** offsets;
-<a name="l00638"></a>00638     <span class="keywordtype">int</span>               idet;
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="comment">/* Get the error state */</span>
-<a name="l00641"></a>00641     previous_state = cpl_errorstate_get();
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     <span class="comment">/* Read the offsets table */</span>
-<a name="l00644"></a>00644     <span class="keywordflow">if</span>((offsets_tables = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(offsets_frame)) == NULL)
-<a name="l00645"></a>00645         <span class="keywordflow">return</span> NULL;
-<a name="l00646"></a>00646 
-<a name="l00647"></a>00647     <span class="comment">/* Convert the table to offsets bivectors */</span>
-<a name="l00648"></a>00648     offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));
-<a name="l00649"></a>00649     <span class="keywordflow">if</span>(offsets == NULL)
-<a name="l00650"></a>00650     {
-<a name="l00651"></a>00651         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00652"></a>00652             cpl_table_delete(offsets_tables[idet]);
-<a name="l00653"></a>00653         <span class="keywordflow">return</span> NULL;
-<a name="l00654"></a>00654     }
-<a name="l00655"></a>00655     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00656"></a>00656     {
-<a name="l00657"></a>00657         cpl_vector * off_x;
-<a name="l00658"></a>00658         cpl_vector * off_y;
-<a name="l00659"></a>00659         <span class="keywordtype">int</span>          noff;
-<a name="l00660"></a>00660         <span class="keywordtype">int</span>          ioff;
-<a name="l00661"></a>00661         <span class="keywordtype">int</span>          jdet;
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663         noff = cpl_table_get_nrow(offsets_tables[idet]);
-<a name="l00664"></a>00664         offsets[idet] = cpl_bivector_new(noff);
-<a name="l00665"></a>00665         <span class="keywordflow">if</span>(offsets[idet] == NULL)
-<a name="l00666"></a>00666         {
-<a name="l00667"></a>00667             <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00668"></a>00668                 cpl_table_delete(offsets_tables[idet]);
-<a name="l00669"></a>00669             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00670"></a>00670                 cpl_bivector_delete(offsets[jdet]);
-<a name="l00671"></a>00671             cpl_free(offsets[jdet]);
-<a name="l00672"></a>00672             <span class="keywordflow">return</span> NULL;
-<a name="l00673"></a>00673         }
-<a name="l00674"></a>00674         off_x = cpl_bivector_get_x(offsets[idet]);
-<a name="l00675"></a>00675         off_y = cpl_bivector_get_y(offsets[idet]);
-<a name="l00676"></a>00676         <span class="keywordflow">for</span>(ioff = 0; ioff < noff; ++ioff)
-<a name="l00677"></a>00677         {
-<a name="l00678"></a>00678             <span class="keywordtype">double</span> xoffset, yoffset;
-<a name="l00679"></a>00679             xoffset = cpl_table_get
-<a name="l00680"></a>00680                 (offsets_tables[idet], HAWKI_COL_OFFSET_X, ioff, NULL);
-<a name="l00681"></a>00681             yoffset = cpl_table_get
-<a name="l00682"></a>00682                 (offsets_tables[idet], HAWKI_COL_OFFSET_Y, ioff, NULL);
-<a name="l00683"></a>00683             cpl_vector_set(off_x, ioff, xoffset);
-<a name="l00684"></a>00684             cpl_vector_set(off_y, ioff, yoffset);
-<a name="l00685"></a>00685         }
-<a name="l00686"></a>00686     }
-<a name="l00687"></a>00687 
-<a name="l00688"></a>00688     <span class="comment">/* Check error state */</span>
-<a name="l00689"></a>00689     <span class="keywordflow">if</span>(cpl_errorstate_get() != previous_state)
-<a name="l00690"></a>00690     {
-<a name="l00691"></a>00691         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00692"></a>00692         {
-<a name="l00693"></a>00693             cpl_table_delete(offsets_tables[idet]);
-<a name="l00694"></a>00694             cpl_bivector_delete(offsets[idet]);
-<a name="l00695"></a>00695         }
-<a name="l00696"></a>00696         cpl_free(offsets);
-<a name="l00697"></a>00697         <span class="keywordflow">return</span> NULL;
-<a name="l00698"></a>00698     }
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     <span class="comment">/* Free and exit */</span>
-<a name="l00701"></a>00701     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00702"></a>00702         cpl_table_delete(offsets_tables[idet]);
-<a name="l00703"></a>00703     cpl_free(offsets_tables);
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     <span class="keywordflow">return</span> offsets;
-<a name="l00706"></a>00706 }
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00717"></a>00717 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00718"></a><a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0">00718</a> cpl_image * <a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0" title="Rebuild the 4 chips.">hawki_rebuild_detectors</a>(
-<a name="l00719"></a>00719         <span class="keyword">const</span> cpl_image *   ima1,
-<a name="l00720"></a>00720         <span class="keyword">const</span> cpl_image *   ima2,
-<a name="l00721"></a>00721         <span class="keyword">const</span> cpl_image *   ima3,
-<a name="l00722"></a>00722         <span class="keyword">const</span> cpl_image *   ima4)
-<a name="l00723"></a>00723 {
-<a name="l00724"></a>00724     cpl_image           *   ima ;
-<a name="l00725"></a>00725 
-<a name="l00726"></a>00726     <span class="comment">/* Test entries */</span>
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (ima1 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00728"></a>00728     <span class="keywordflow">if</span> (ima2 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00729"></a>00729     <span class="keywordflow">if</span> (ima3 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00730"></a>00730     <span class="keywordflow">if</span> (ima4 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00731"></a>00731     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima2)) <span class="keywordflow">return</span> NULL ;
-<a name="l00732"></a>00732     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima3)) <span class="keywordflow">return</span> NULL ;
-<a name="l00733"></a>00733     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima4)) <span class="keywordflow">return</span> NULL ;
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     <span class="comment">/* Create the image */</span>
-<a name="l00736"></a>00736     ima = cpl_image_new(4096, 4096, cpl_image_get_type(ima1)) ;
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738     <span class="comment">/* Paste the input images */</span>
-<a name="l00739"></a>00739     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima1, 1, 1) != CPL_ERROR_NONE) {
-<a name="l00740"></a>00740         cpl_image_delete(ima) ;
-<a name="l00741"></a>00741         <span class="keywordflow">return</span> NULL ;
-<a name="l00742"></a>00742     }
-<a name="l00743"></a>00743     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima2, 2049, 1) != CPL_ERROR_NONE) {
-<a name="l00744"></a>00744         cpl_image_delete(ima) ;
-<a name="l00745"></a>00745         <span class="keywordflow">return</span> NULL ;
-<a name="l00746"></a>00746     }
-<a name="l00747"></a>00747     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima3, 2049, 2049) != CPL_ERROR_NONE) {
-<a name="l00748"></a>00748         cpl_image_delete(ima) ;
-<a name="l00749"></a>00749         <span class="keywordflow">return</span> NULL ;
-<a name="l00750"></a>00750     }
-<a name="l00751"></a>00751     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima4, 1, 2049) != CPL_ERROR_NONE) {
-<a name="l00752"></a>00752         cpl_image_delete(ima) ;
-<a name="l00753"></a>00753         <span class="keywordflow">return</span> NULL ;
-<a name="l00754"></a>00754     }
-<a name="l00755"></a>00755     <span class="keywordflow">return</span> ima ;
-<a name="l00756"></a>00756 }
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758 
-<a name="l00759"></a>00759 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00768"></a>00768 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00769"></a><a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df">00769</a> cpl_image * <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(
-<a name="l00770"></a>00770         <span class="keyword">const</span> cpl_image *   ima1,
-<a name="l00771"></a>00771         <span class="keyword">const</span> cpl_image *   ima2,
-<a name="l00772"></a>00772         <span class="keyword">const</span> cpl_image *   ima3,
-<a name="l00773"></a>00773         <span class="keyword">const</span> cpl_image *   ima4)
-<a name="l00774"></a>00774 {
-<a name="l00775"></a>00775     cpl_image           *   ima ;
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777     <span class="comment">/* Test entries */</span>
-<a name="l00778"></a>00778     <span class="keywordflow">if</span> (ima1 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00779"></a>00779     <span class="keywordflow">if</span> (ima2 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00780"></a>00780     <span class="keywordflow">if</span> (ima3 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00781"></a>00781     <span class="keywordflow">if</span> (ima4 == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00782"></a>00782     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima2)) <span class="keywordflow">return</span> NULL ;
-<a name="l00783"></a>00783     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima3)) <span class="keywordflow">return</span> NULL ;
-<a name="l00784"></a>00784     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima4)) <span class="keywordflow">return</span> NULL ;
-<a name="l00785"></a>00785 
-<a name="l00786"></a>00786     <span class="comment">/* Create the image */</span>
-<a name="l00787"></a>00787     ima = cpl_image_new(2048, 2048, cpl_image_get_type(ima1)) ;
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     <span class="comment">/* Paste the input images */</span>
-<a name="l00790"></a>00790     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima1, 1, 1) != CPL_ERROR_NONE) {
-<a name="l00791"></a>00791         cpl_image_delete(ima) ;
-<a name="l00792"></a>00792         <span class="keywordflow">return</span> NULL ;
-<a name="l00793"></a>00793     }
-<a name="l00794"></a>00794     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima2, 1025, 1) != CPL_ERROR_NONE) {
-<a name="l00795"></a>00795         cpl_image_delete(ima) ;
-<a name="l00796"></a>00796         <span class="keywordflow">return</span> NULL ;
-<a name="l00797"></a>00797     }
-<a name="l00798"></a>00798     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima3, 1, 1025) != CPL_ERROR_NONE) {
-<a name="l00799"></a>00799         cpl_image_delete(ima) ;
-<a name="l00800"></a>00800         <span class="keywordflow">return</span> NULL ;
-<a name="l00801"></a>00801     }
-<a name="l00802"></a>00802     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima4, 1025, 1025) != CPL_ERROR_NONE) {
-<a name="l00803"></a>00803         cpl_image_delete(ima) ;
-<a name="l00804"></a>00804         <span class="keywordflow">return</span> NULL ;
-<a name="l00805"></a>00805     }
-<a name="l00806"></a>00806     <span class="keywordflow">return</span> ima ;
-<a name="l00807"></a>00807 }
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00816"></a>00816 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00817"></a><a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756">00817</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(
-<a name="l00818"></a>00818         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,
-<a name="l00819"></a>00819         <span class="keywordtype">int</span>             ext)
-<a name="l00820"></a>00820 {
-<a name="l00821"></a>00821     cpl_propertylist    *   plist ;
-<a name="l00822"></a>00822     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;
-<a name="l00823"></a>00823     <span class="keywordtype">int</span>                     chip ;
-<a name="l00824"></a>00824 
-<a name="l00825"></a>00825     <span class="comment">/* Test entries */</span>
-<a name="l00826"></a>00826     <span class="keywordflow">if</span> (ext <= 0 || ext > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> -1 ;
-<a name="l00827"></a>00827 
-<a name="l00828"></a>00828     <span class="comment">/* Load the extension  */</span>
-<a name="l00829"></a>00829     plist=cpl_propertylist_load(fname, ext) ;
-<a name="l00830"></a>00830     <span class="keywordflow">if</span> (plist == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00831"></a>00831     sval = <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(plist) ;
-<a name="l00832"></a>00832     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, &chip) != 1) chip = -1 ;
-<a name="l00833"></a>00833     cpl_propertylist_delete(plist) ;
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835     <span class="keywordflow">return</span> chip ;
-<a name="l00836"></a>00836 }
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00845"></a>00845 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00846"></a><a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1">00846</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(
-<a name="l00847"></a>00847         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,
-<a name="l00848"></a>00848         <span class="keywordtype">int</span>             chip)
-<a name="l00849"></a>00849 {
-<a name="l00850"></a>00850     cpl_propertylist    *   plist ;
-<a name="l00851"></a>00851     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;
-<a name="l00852"></a>00852     <span class="keywordtype">char</span>                    chipval[512] ;
-<a name="l00853"></a>00853     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00854"></a>00854     <span class="keywordtype">int</span>                     iext;
-<a name="l00855"></a>00855 
-<a name="l00856"></a>00856     <span class="comment">/* Test entries */</span>
-<a name="l00857"></a>00857     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> -1;
-<a name="l00858"></a>00858     <span class="keywordflow">if</span> (chip <= 0 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> -1 ;
-<a name="l00859"></a>00859 
-<a name="l00860"></a>00860     <span class="comment">/* Initialise */</span>
-<a name="l00861"></a>00861     ext_nb = -1 ;
-<a name="l00862"></a>00862 
-<a name="l00863"></a>00863     <span class="comment">/* Create  the wished chipval */</span>
-<a name="l00864"></a>00864     snprintf(chipval, 512, <span class="stringliteral">"CHIP%d.INT1"</span>, chip) ;
-<a name="l00865"></a>00865 
-<a name="l00866"></a>00866     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS extensions */</span>
-<a name="l00867"></a>00867     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {
-<a name="l00868"></a>00868         <span class="comment">/* Load the propertylist of the current extension */</span>
-<a name="l00869"></a>00869         <span class="keywordflow">if</span> ((plist = cpl_propertylist_load(fname, iext+1)) == NULL) {
-<a name="l00870"></a>00870             cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the Extname keyword"</span>) ;
-<a name="l00871"></a>00871             <span class="keywordflow">return</span> -1 ;
-<a name="l00872"></a>00872         }
-<a name="l00873"></a>00873         <span class="keywordflow">if</span> ((sval = <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(plist)) == NULL) {
-<a name="l00874"></a>00874             cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the Extname keyword"</span>) ;
-<a name="l00875"></a>00875             cpl_propertylist_delete(plist) ;
-<a name="l00876"></a>00876             <span class="keywordflow">return</span> -1 ;
-<a name="l00877"></a>00877         }
-<a name="l00878"></a>00878         <span class="comment">/* Check if the chip is found */</span>
-<a name="l00879"></a>00879         <span class="keywordflow">if</span> (!strcmp(chipval, sval)) {
-<a name="l00880"></a>00880             ext_nb = iext+1 ;
-<a name="l00881"></a>00881             cpl_propertylist_delete(plist) ;
-<a name="l00882"></a>00882             <span class="keywordflow">break</span>;
-<a name="l00883"></a>00883         }
-<a name="l00884"></a>00884         cpl_propertylist_delete(plist) ;
-<a name="l00885"></a>00885     }
-<a name="l00886"></a>00886     <span class="keywordflow">return</span> ext_nb ;
-<a name="l00887"></a>00887 }
-<a name="l00888"></a>00888 
-<a name="l00889"></a>00889 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00895"></a>00895 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00896"></a>00896 <span class="keywordtype">int</span> * <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a>
-<a name="l00897"></a><a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9">00897</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>  *  fname)
-<a name="l00898"></a>00898 {
-<a name="l00899"></a>00899     <span class="keywordtype">int</span>           iext;
-<a name="l00900"></a>00900     <span class="keywordtype">int</span>         * ext_chip_mapping;   
-<a name="l00901"></a>00901     
-<a name="l00902"></a>00902 
-<a name="l00903"></a>00903     <span class="comment">/* Test entries */</span>
-<a name="l00904"></a>00904     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> NULL;
-<a name="l00905"></a>00905     
-<a name="l00906"></a>00906     <span class="comment">/* Initialise */</span>
-<a name="l00907"></a>00907     ext_chip_mapping = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * HAWKI_NB_DETECTORS);
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     <span class="comment">/* Loop on the HAWKI_NB_DETECTORS extensions */</span>
-<a name="l00910"></a>00910     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {
-<a name="l00911"></a>00911         <span class="keywordtype">int</span> ichip = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext + 1);
-<a name="l00912"></a>00912         ext_chip_mapping[ichip-1] = iext + 1; 
-<a name="l00913"></a>00913     }
-<a name="l00914"></a>00914     <span class="keywordflow">return</span> ext_chip_mapping;
-<a name="l00915"></a>00915 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_load.c,v 1.40 2009/12/04 10:39: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/12/04 10:39:14 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.40 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "hawki_load.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_dfs.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="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="l00053"></a><span class="lineno">   53</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a">   63</a></span> cpl_frameset * <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>         <span class="keyword">const</span> cpl_frameset  *   in,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   tag)</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    *   out ;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="keyword">const</span> cpl_frame *   cur_frame ;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     cpl_frame       *   loc_frame ;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <span class="keywordtype">int</span>                 nbframes, nbext ;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordtype">int</span>                 i ;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="keywordflow">if</span> (tag == NULL) <span class="keywordflow">return</span> 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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     nbframes = cpl_frameset_get_size(in) ;</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">/* Count the frames with the tag */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</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="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="comment">/* Create the output frameset */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     out = cpl_frameset_new() ;</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">/* Loop on the requested frames and store them in out */</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     nbext = 0 ;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <span class="keywordflow">for</span> (i=0 ; i<nbframes ; i++) {</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         cur_frame = cpl_frameset_get_frame_const(in, i) ;</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         <span class="keywordflow">if</span> (!strcmp(cpl_frame_get_tag(cur_frame), tag)) {</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>             loc_frame = cpl_frame_duplicate(cur_frame) ;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>             cpl_frameset_insert(out, loc_frame) ;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>             nbext ++ ;</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> out ;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a">  110</a></span> cpl_image * <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         <span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         <span class="keywordtype">int</span>                     fnum,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         <span class="keywordtype">int</span>                     chip,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         <span class="keywordtype">int</span>                     quad,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         cpl_type                ptype)</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">const</span> cpl_frame     *   frame ;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_image           *   ima ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> NULL ;</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">/* Load the fnum frame */</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     frame = cpl_frameset_get_frame_const(fset, fnum) ;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     fname = cpl_frame_get_filename(frame) ;</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">/* Load */</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="keywordflow">if</span> ((ima=<a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(fname, chip, quad, ptype)) == NULL) {</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d quarter %d)"</span>,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                 fnum+1, chip, quad) ;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         <span class="keywordflow">return</span> 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="keywordflow">return</span> ima ;</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> <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"><a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7">  149</a></span> cpl_image * <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         <span class="keywordtype">int</span>             chip,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         <span class="keywordtype">int</span>             quad,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         cpl_type        ptype)</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_image           *   ima ;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordtype">int</span>                     llx, lly, urx, ury ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> 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>     <span class="comment">/* Define the window */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordflow">if</span> (quad == 1) {</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>         llx = lly = 1 ;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         urx = ury = 1024 ;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 2) {</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>         llx = 1025 ;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>         lly = 1 ;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>         urx = 2048 ;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         ury = 1024 ;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 3) {</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>         llx = 1 ;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         lly = 1025 ;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         urx = 1024 ;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>         ury = 2048 ;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (quad == 4) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         llx = lly = 1025 ;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>         urx = ury = 2048 ;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     } <span class="keywordflow">else</span> <span class="keywordflow">return</span> 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>     <span class="comment">/* Get the extension with the wished chip */</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                 chip+1) ;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 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>     <span class="comment">/* Load */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="keywordflow">if</span> ((ima=cpl_image_load_window(fname, ptype, 0, ext_nb, llx, lly, urx,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                     ury)) == NULL) {</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d quarter %d from %s"</span>,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                 chip, quad, fname) ;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         <span class="keywordflow">return</span> 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="keywordflow">return</span> ima ;</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="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"><a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895">  209</a></span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>         <span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>         <span class="keywordtype">int</span>                     chip,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         cpl_type                ptype)</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">int</span>                     nframes ;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_imagelist       *   out ;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="keyword">const</span> cpl_frame     *   frame ;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_image           *   ima ;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordtype">int</span>                     i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     nframes = cpl_frameset_get_size(fset) ;</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">/* Create the output list */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     out = cpl_imagelist_new() ;</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">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {</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">/* Load the ith frame */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         frame = cpl_frameset_get_frame_const(fset, i) ;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         fname = cpl_frame_get_filename(frame) ;</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">/* Get the extension with the wished chip */</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>         <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                     chip) ;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>             cpl_imagelist_delete(out);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>             <span class="keywordflow">return</span> 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>         <span class="comment">/* Load */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL) {</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                     i+1, chip) ;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>             cpl_imagelist_delete(out) ;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             <span class="keywordflow">return</span> 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>         cpl_imagelist_set(out, ima, i) ;</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> out ;</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> <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">  265</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d" title="Loads a given extension from a HAWKI frameset in an image list.">hawki_load_extensions</a></div>
+<div class="line"><a name="l00266"></a><span class="lineno"><a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d">  266</a></span> (<span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>  <span class="keywordtype">int</span>                     extension,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>  cpl_type                ptype)</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="keywordtype">int</span>                     nframes ;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_imagelist       *   out ;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keyword">const</span> cpl_frame     *   frame ;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     cpl_image           *   ima ;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordtype">int</span>                     iframe;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     nframes = cpl_frameset_get_size(fset) ;</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">/* Create the output list */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     out = cpl_imagelist_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>     <span class="comment">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) {</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">/* Load the ith frame */</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         frame = cpl_frameset_get_frame_const(fset, iframe) ;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         fname = cpl_frame_get_filename(frame) ;</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">/* Load */</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, extension)) == NULL) {</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (extension %d)"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                     iframe+1, extension) ;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>             cpl_imagelist_delete(out) ;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>             <span class="keywordflow">return</span> NULL ;</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_imagelist_set(out, ima, iframe) ;</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> out ;</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="l00312"></a><span class="lineno">  312</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno"><a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed">  313</a></span> cpl_image * <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         <span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         <span class="keywordtype">int</span>                     fnum,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         <span class="keywordtype">int</span>                     chip,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         cpl_type                ptype)</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> cpl_frame     *   frame ;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_image           *   ima ;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordtype">int</span>                     ext_nb ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> 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">/* Load the fnum frame */</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     frame = cpl_frameset_get_frame_const(fset, fnum) ;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     fname = cpl_frame_get_filename(frame) ;</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">/* Check that the frame has the right number of extension */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordflow">if</span>(cpl_frame_get_nextensions(frame) != HAWKI_NB_DETECTORS)</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_error(__func__, <span class="stringliteral">"File %s contains less than %d extensions"</span>,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                       fname, HAWKI_NB_DETECTORS);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         <span class="keywordflow">return</span> NULL ;</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="l00340"></a><span class="lineno">  340</span>     <span class="comment">/* Get the extension with the wished chip */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, chip)) == -1) {</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                 chip+1) ;</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>     <span class="comment">/* Load */</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL) {</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                 fnum+1, chip) ;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         <span class="keywordflow">return</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>     <span class="keywordflow">return</span> ima ;</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="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__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438">  365</a></span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         <span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>         <span class="keywordtype">int</span>                     chip,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         <span class="keywordtype">int</span>                     quad,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         cpl_type                ptype)</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_imagelist       *   out ;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     cpl_image           *   ima ;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordtype">int</span>                     i ;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">if</span> (quad < 1 || quad > 4) <span class="keywordflow">return</span> 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>     <span class="comment">/* Create the output imagelist */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     out = cpl_imagelist_new() ;</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">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">for</span> (i=0 ; i<cpl_frameset_get_size(fset) ; i++) {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         ima = <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(fset, i, chip, quad, ptype) ;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         <span class="keywordflow">if</span> (ima == NULL) {</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d, quad %d)"</span>,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                     i+1, chip, quad) ;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>             cpl_imagelist_delete(out) ;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>             <span class="keywordflow">return</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>         cpl_imagelist_set(out, ima, i) ;</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">return</span> out ;</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="l00406"></a><span class="lineno">  406</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00407"></a><span class="lineno"><a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32">  407</a></span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32" title="Load the chip of HAWKI images from a frameset in an image list.">hawki_load_frameset</a>(</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         <span class="keyword">const</span> cpl_frameset  *   fset,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         <span class="keywordtype">int</span>                     chip,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         cpl_type                ptype)</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>     cpl_imagelist       *   out ;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_image           *   ima ;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordtype">int</span>                     i ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <span class="keywordflow">if</span> (chip < 1 || chip > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> 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="comment">/* Create the output imagelist */</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     out = cpl_imagelist_new() ;</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">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordflow">for</span> (i=0 ; i<cpl_frameset_get_size(fset) ; i++) {</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         ima = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(fset, i, chip, ptype) ;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         <span class="keywordflow">if</span> (ima == NULL) {</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load %dth frame (chip %d)"</span>,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                     i+1, chip) ;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             cpl_imagelist_delete(out) ;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             <span class="keywordflow">return</span> 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_imagelist_set(out, ima, i) ;</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">return</span> out ;</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> </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"><a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751">  445</a></span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         <span class="keyword">const</span> cpl_frame  *   frame,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         cpl_type             ptype)</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>     cpl_imagelist       *   out;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_image           *   ima;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordtype">int</span>                     ext_nb;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     <span class="keywordtype">int</span>                 *   ext_chip_mapping;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> NULL ;</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="comment">/* Create the output imagelist */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     out = cpl_imagelist_new() ;</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="comment">/* Get the filename */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     fname = cpl_frame_get_filename(frame);</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">/* Check that the frame has the right number of extension */</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">if</span>(cpl_frame_get_nextensions(frame) != HAWKI_NB_DETECTORS)</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>         cpl_msg_error(__func__, <span class="stringliteral">"File %s contains less than %d extensions"</span>,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                       fname, HAWKI_NB_DETECTORS);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         cpl_imagelist_delete(out);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <span class="comment">/* Get the extension-chip mapping */</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     ext_chip_mapping = <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a>(fname);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     <span class="keywordflow">if</span> (ext_chip_mapping == NULL)</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_msg_error(__func__,<span class="stringliteral">"Cannot get mapping between extension and chip"</span>);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_imagelist_delete(out);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         <span class="keywordflow">return</span> NULL;</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">/* Loop on the chips */</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension */</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         ext_nb = ext_chip_mapping[idet];</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">/* Load */</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == NULL)</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_msg_error(__func__, <span class="stringliteral">"Cannot load frame (detector %d)"</span>,</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                           idet);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>             cpl_imagelist_delete(out);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             <span class="keywordflow">return</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>         cpl_imagelist_set(out, ima, idet);</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>     <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     cpl_free(ext_chip_mapping);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     <span class="keywordflow">return</span> out;</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="l00512"></a><span class="lineno">  512</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00513"></a><span class="lineno"><a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef">  513</a></span> cpl_image * <a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef" title="Load one the extensions of HAWKI images from a frame into an image.">hawki_load_frame_extension</a>(</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keyword">const</span> cpl_frame  *   frame,</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         <span class="keywordtype">int</span>                  iextension,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         cpl_type             ptype)</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_image        *   ima;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *   fname;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> 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">/* Get filename */</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     fname = cpl_frame_get_filename(frame);</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">/* Load */</span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, iextension)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load frame (extension %d)"</span>,</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>                       iextension) ;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">return</span> ima;</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="l00546"></a><span class="lineno">  546</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00547"></a><span class="lineno"><a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1">  547</a></span> cpl_image * <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>(</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         <span class="keyword">const</span> cpl_frame  *   frame,</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         <span class="keywordtype">int</span>                  idet,</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         cpl_type             ptype)</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>     cpl_image        *   ima;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *   fname;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordtype">int</span>                  ext_nb;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">if</span> (frame == NULL) <span class="keywordflow">return</span> NULL ;</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">/* Get filename */</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     fname = cpl_frame_get_filename(frame);</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">/* Get the extension with the wished chip */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(fname, idet)) == -1)</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_msg_error(__func__, <span class="stringliteral">"Cannot get the extension with chip %d"</span>,</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                       idet) ;</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>     <span class="comment">/* Load */</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <span class="keywordflow">if</span> ((ima=cpl_image_load(fname, ptype, 0, ext_nb)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load frame (chip %d)"</span>,</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>                       idet) ;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keywordflow">return</span> ima;</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="l00588"></a><span class="lineno">  588</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00589"></a><span class="lineno"><a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0">  589</a></span> cpl_table  ** <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(<span class="keyword">const</span> cpl_frame * frame)</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_table  ** tables;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *  filename;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordtype">int</span>           idet;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordtype">int</span>           j;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">int</span>           ext_nb;</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="comment">/* Allocate the set of tables */</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     tables = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</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">/* Get the filename */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     filename = cpl_frame_get_filename(frame);</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension with the wished chip */</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename, idet+1)) == -1)</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_error(__func__, <span class="stringliteral">"Cannot get the extension with detector %d"</span>,</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                           idet+1) ;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>             <span class="keywordflow">return</span> NULL ;</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">/* Load the table */</span></div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         <span class="keywordflow">if</span>((tables[idet] = cpl_table_load(filename, ext_nb, 0) ) == NULL)</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">for</span> (j=0 ; j< idet ; j++)</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_table_delete(tables[j]);</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(tables);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>             <span class="keywordflow">return</span> 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>     }</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">return</span>  tables;</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="l00632"></a><span class="lineno">  632</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00633"></a><span class="lineno"><a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1">  633</a></span> cpl_bivector  ** <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a>(<span class="keyword">const</span> cpl_frame * offsets_frame)</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>     cpl_errorstate    previous_state;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     cpl_table      ** offsets_tables;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_bivector   ** offsets;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordtype">int</span>               idet;</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">/* Get the error state */</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     previous_state = cpl_errorstate_get();</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="comment">/* Read the offsets table */</span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keywordflow">if</span>((offsets_tables = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(offsets_frame)) == NULL)</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         <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>     <span class="comment">/* Convert the table to offsets bivectors */</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordflow">if</span>(offsets == NULL)</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="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>             cpl_table_delete(offsets_tables[idet]);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         <span class="keywordflow">return</span> NULL;</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">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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_vector * off_x;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         cpl_vector * off_y;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordtype">int</span>          noff;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         <span class="keywordtype">int</span>          ioff;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>         <span class="keywordtype">int</span>          jdet;</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>         noff = cpl_table_get_nrow(offsets_tables[idet]);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         offsets[idet] = cpl_bivector_new(noff);</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>         <span class="keywordflow">if</span>(offsets[idet] == 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>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                 cpl_table_delete(offsets_tables[idet]);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                 cpl_bivector_delete(offsets[jdet]);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>             cpl_free(offsets[jdet]);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>             <span class="keywordflow">return</span> 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>         off_x = cpl_bivector_get_x(offsets[idet]);</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>         off_y = cpl_bivector_get_y(offsets[idet]);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         <span class="keywordflow">for</span>(ioff = 0; ioff < noff; ++ioff)</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="keywordtype">double</span> xoffset, yoffset;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>             xoffset = cpl_table_get</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                 (offsets_tables[idet], HAWKI_COL_OFFSET_X, ioff, NULL);</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>             yoffset = cpl_table_get</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                 (offsets_tables[idet], HAWKI_COL_OFFSET_Y, ioff, NULL);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>             cpl_vector_set(off_x, ioff, xoffset);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>             cpl_vector_set(off_y, ioff, yoffset);</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> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     <span class="comment">/* Check error state */</span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordflow">if</span>(cpl_errorstate_get() != previous_state)</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">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>             cpl_table_delete(offsets_tables[idet]);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>             cpl_bivector_delete(offsets[idet]);</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>         cpl_free(offsets);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="comment">/* Free and exit */</span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         cpl_table_delete(offsets_tables[idet]);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     cpl_free(offsets_tables);</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> offsets;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0">  718</a></span> cpl_image * <a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0" title="Rebuild the 4 chips.">hawki_rebuild_detectors</a>(</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         <span class="keyword">const</span> cpl_image *   ima1,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         <span class="keyword">const</span> cpl_image *   ima2,</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         <span class="keyword">const</span> cpl_image *   ima3,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         <span class="keyword">const</span> cpl_image *   ima4)</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_image           *   ima ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <span class="keywordflow">if</span> (ima1 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keywordflow">if</span> (ima2 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     <span class="keywordflow">if</span> (ima3 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <span class="keywordflow">if</span> (ima4 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima2)) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima3)) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima4)) <span class="keywordflow">return</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>     <span class="comment">/* Create the image */</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     ima = cpl_image_new(4096, 4096, cpl_image_get_type(ima1)) ;</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">/* Paste the input images */</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima1, 1, 1) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         <span class="keywordflow">return</span> NULL ;</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="keywordflow">if</span> (cpl_image_copy(ima, ima2, 2049, 1) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>         <span class="keywordflow">return</span> NULL ;</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_image_copy(ima, ima3, 2049, 2049) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         <span class="keywordflow">return</span> 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>     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima4, 1, 2049) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         <span class="keywordflow">return</span> 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>     <span class="keywordflow">return</span> ima ;</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> <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"><a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df">  769</a></span> cpl_image * <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         <span class="keyword">const</span> cpl_image *   ima1,</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>         <span class="keyword">const</span> cpl_image *   ima2,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="keyword">const</span> cpl_image *   ima3,</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         <span class="keyword">const</span> cpl_image *   ima4)</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           *   ima ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="keywordflow">if</span> (ima1 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     <span class="keywordflow">if</span> (ima2 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     <span class="keywordflow">if</span> (ima3 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>     <span class="keywordflow">if</span> (ima4 == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima2)) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima3)) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="keywordflow">if</span> (cpl_image_get_type(ima1)!=cpl_image_get_type(ima4)) <span class="keywordflow">return</span> 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="comment">/* Create the image */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     ima = cpl_image_new(2048, 2048, cpl_image_get_type(ima1)) ;</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">/* Paste the input images */</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <span class="keywordflow">if</span> (cpl_image_copy(ima, ima1, 1, 1) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>         <span class="keywordflow">return</span> NULL ;</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="keywordflow">if</span> (cpl_image_copy(ima, ima2, 1025, 1) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         <span class="keywordflow">return</span> 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> (cpl_image_copy(ima, ima3, 1, 1025) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         <span class="keywordflow">return</span> 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="keywordflow">if</span> (cpl_image_copy(ima, ima4, 1025, 1025) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>         cpl_image_delete(ima) ;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         <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>     <span class="keywordflow">return</span> ima ;</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> </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00817"></a><span class="lineno"><a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756">  817</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         <span class="keywordtype">int</span>             ext)</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>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     <span class="keywordtype">int</span>                     chip ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>     <span class="keywordflow">if</span> (ext <= 0 || ext > HAWKI_NB_DETECTORS) <span class="keywordflow">return</span> -1 ;</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="comment">/* Load the extension  */</span></div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>     plist=cpl_propertylist_load(fname, ext) ;</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     <span class="keywordflow">if</span> (plist == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     sval = <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(plist) ;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, &chip) != 1) chip = -1 ;</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>     cpl_propertylist_delete(plist) ;</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">return</span> chip ;</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> </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00846"></a><span class="lineno"><a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1">  846</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *   fname,</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         <span class="keywordtype">int</span>             chip)</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_propertylist    *   plist ;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   sval ;</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     <span class="keywordtype">char</span>                    chipval[512] ;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>     <span class="keywordtype">int</span>                     iext;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>     <span class="keywordflow">if</span> (chip <= 0 || chip > HAWKI_NB_DETECTORS) <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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     ext_nb = -1 ;</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="comment">/* Create  the wished chipval */</span></div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     snprintf(chipval, 512, <span class="stringliteral">"CHIP%d.INT1"</span>, chip) ;</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">/* Loop on the HAWKI_NB_DETECTORS extensions */</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         <span class="comment">/* Load the propertylist of the current extension */</span></div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         <span class="keywordflow">if</span> ((plist = cpl_propertylist_load(fname, iext+1)) == NULL) {</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the Extname keyword"</span>) ;</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>             <span class="keywordflow">return</span> -1 ;</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> ((sval = <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(plist)) == NULL) {</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the Extname keyword"</span>) ;</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>             cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             <span class="keywordflow">return</span> -1 ;</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="comment">/* Check if the chip is found */</span></div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         <span class="keywordflow">if</span> (!strcmp(chipval, sval)) {</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             ext_nb = iext+1 ;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             <span class="keywordflow">break</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>         cpl_propertylist_delete(plist) ;</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">return</span> ext_nb ;</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="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> * <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a></div>
+<div class="line"><a name="l00897"></a><span class="lineno"><a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9">  897</a></span> (<span class="keyword">const</span> <span class="keywordtype">char</span>  *  fname)</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="keywordtype">int</span>           iext;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>     <span class="keywordtype">int</span>         * ext_chip_mapping;   </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">/* Test entries */</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     <span class="keywordflow">if</span> (fname == NULL) <span class="keywordflow">return</span> 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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>     ext_chip_mapping = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * HAWKI_NB_DETECTORS);</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="comment">/* Loop on the HAWKI_NB_DETECTORS extensions */</span></div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>         <span class="keywordtype">int</span> ichip = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext + 1);</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         ext_chip_mapping[ichip-1] = iext + 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>     <span class="keywordflow">return</span> ext_chip_mapping;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</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/hawki__load_8h_source.html b/html/hawki__load_8h_source.html
index b8a5ad8..5e4c1c4 100644
--- a/html/hawki__load_8h_source.html
+++ b/html/hawki__load_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_load.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,80 +40,81 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_load.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_load.h,v 1.22 2012/12/05 14:56: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/05 14:56:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.22 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_LOAD_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_LOAD_H</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">                                Functions prototypes</span>
-<a name="l00033"></a>00033 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 CPL_BEGIN_DECLS
-<a name="l00036"></a>00036 cpl_frameset  * <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *) ;
-<a name="l00037"></a>00037 cpl_imagelist * <a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32" title="Load the chip of HAWKI images from a frameset in an image list.">hawki_load_frameset</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00038"></a>00038 cpl_imagelist * <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(<span class="keyword">const</span> cpl_frame *, cpl_type) ;
-<a name="l00039"></a>00039 cpl_image     * <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>(<span class="keyword">const</span> cpl_frame *, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00040"></a>00040 cpl_image     * <a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef" title="Load one the extensions of HAWKI images from a frame into an image.">hawki_load_frame_extension</a>(<span class="keyword">const</span> cpl_frame *, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00041"></a>00041 cpl_image     * <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00042"></a>00042 cpl_imagelist * <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00043"></a>00043 cpl_imagelist * <a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d" title="Loads a given extension from a HAWKI frameset in an image list.">hawki_load_extensions</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00044"></a>00044 cpl_imagelist * <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00045"></a>00045 cpl_image     * <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00046"></a>00046 cpl_image     * <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;
-<a name="l00047"></a>00047 cpl_table    ** <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(<span class="keyword">const</span> cpl_frame * frame);
-<a name="l00048"></a>00048 cpl_bivector ** <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a>(<span class="keyword">const</span> cpl_frame * offsets_frame);
-<a name="l00049"></a>00049 cpl_image     * <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, 
-<a name="l00050"></a>00050                                         <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *) ;
-<a name="l00051"></a>00051 cpl_image     * <a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0" title="Rebuild the 4 chips.">hawki_rebuild_detectors</a>(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, 
-<a name="l00052"></a>00052                                         <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *) ;
-<a name="l00053"></a>00053 <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>) ;
-<a name="l00054"></a>00054 <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>) ;
-<a name="l00055"></a>00055 <span class="keywordtype">int</span> * <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a>
-<a name="l00056"></a>00056 (<span class="keyword">const</span> <span class="keywordtype">char</span>  *  fname);
-<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></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_load.h,v 1.22 2012/12/05 14:56: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/05 14:56:52 $</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: hawki-1_8_12 $</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 HAWKI_LOAD_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_LOAD_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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment">                                Functions prototypes</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> cpl_frameset  * <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *) ;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gacfb4bdd556642042208b93924ee13a32" title="Load the chip of HAWKI images from a frameset in an image list.">hawki_load_frameset</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(<span class="keyword">const</span> cpl_frame *, cpl_type) ;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> cpl_image     * <a class="code" href="group__hawki__load.html#gada33a0608b91dc44f69f821e6f40b8d1" title="Load one the chips of HAWKI images from a frame into an image.">hawki_load_frame_detector</a>(<span class="keyword">const</span> cpl_frame *, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> cpl_image     * <a class="code" href="group__hawki__load.html#ga43ebac74ab2f9da7a452f23ec76803ef" title="Load one the extensions of HAWKI images from a frame into an image.">hawki_load_frame_extension</a>(<span class="keyword">const</span> cpl_frame *, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> cpl_image     * <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#ga1cf51c1b905de7941d7fcf3e249e536d" title="Loads a given extension from a HAWKI frameset in an image list.">hawki_load_extensions</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> cpl_imagelist * <a class="code" href="group__hawki__load.html#gad5cbc1d866e88c8776ed605e5afa9438" title="Load the quarter of a chip from a frameset in an image list.">hawki_load_quadrants</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> cpl_image     * <a class="code" href="group__hawki__load.html#gaf2bd8a92a7abfe4adc8eb7b6b917739a" title="Load the quarter of a chip from a frameset in an image.">hawki_load_quadrant</a>(<span class="keyword">const</span> cpl_frameset *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> cpl_image     * <a class="code" href="group__hawki__load.html#ga686f0c5897e92abd1b6aff98636f56c7" title="Load the quarter of a chip from a file in an image.">hawki_load_quadrant_from_file</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, cpl_type) ;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> cpl_table    ** <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(<span class="keyword">const</span> cpl_frame * frame);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> cpl_bivector ** <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a>(<span class="keyword">const</span> cpl_frame * offsets_frame);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> cpl_image     * <a class="code" href="group__hawki__load.html#ga2e96e882a8e61743837030dcc2db02df" title="Rebuild the 4 quadrants.">hawki_rebuild_quadrants</a>(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>                                         <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *) ;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> cpl_image     * <a class="code" href="group__hawki__load.html#ga0ee685ab967af593a9fd9f5f90cc7dd0" title="Rebuild the 4 chips.">hawki_rebuild_detectors</a>(<span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *, </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>                                         <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> cpl_image *) ;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keywordtype">int</span> * <a class="code" href="group__hawki__load.html#ga509bd22f6e838f82f7b2c6bc97ccc3a9" title="Get the mapping between extensions and detectors.">hawki_get_ext_detector_mapping</a></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> (<span class="keyword">const</span> <span class="keywordtype">char</span>  *  fname);</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/hawki__mask_8c_source.html b/html/hawki__mask_8c_source.html
index ad7f724..2f148b1 100644
--- a/html/hawki__mask_8c_source.html
+++ b/html/hawki__mask_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_mask.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,143 +40,144 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_mask.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_mask.c,v 1.3 2010/03/12 12:55: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/03/12 12:55:17 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl_mask.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl_matrix.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_mask.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00056"></a><a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">00056</a> cpl_error_code <a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(
-<a name="l00057"></a>00057         cpl_mask            *   in,
-<a name="l00058"></a>00058         <span class="keyword">const</span> cpl_matrix    *   ker)
-<a name="l00059"></a>00059 {
-<a name="l00060"></a>00060     cpl_mask        *   out;
-<a name="l00061"></a>00061     <span class="keyword">const</span> <span class="keywordtype">double</span>    *   ker_arr;
-<a name="l00062"></a>00062     <span class="keywordtype">int</span>                 nc, nr;
-<a name="l00063"></a>00063     <span class="keywordtype">int</span>                 hsx, hsy;
-<a name="l00064"></a>00064     <span class="keywordtype">int</span>                 curr_pos, im_pos, filt_pos;
-<a name="l00065"></a>00065     <span class="keywordtype">int</span>                 i, j, k, l;
-<a name="l00066"></a>00066     <span class="keywordtype">double</span>              sum;
-<a name="l00067"></a>00067     <span class="keywordtype">int</span>                 nx;
-<a name="l00068"></a>00068     <span class="keywordtype">int</span>                 ny;
-<a name="l00069"></a>00069     cpl_binary      *   in_data;
-<a name="l00070"></a>00070     cpl_binary      *   out_data;
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072     <span class="comment">/* Test entries */</span>
-<a name="l00073"></a>00073     cpl_ensure_code(in && ker, CPL_ERROR_NULL_INPUT);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075     <span class="comment">/* Get kernel informations */</span>
-<a name="l00076"></a>00076     nr = cpl_matrix_get_nrow(ker);
-<a name="l00077"></a>00077     nc = cpl_matrix_get_ncol(ker);
-<a name="l00078"></a>00078     ker_arr = cpl_matrix_get_data_const(ker);
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="comment">/* Test the kernel validity */</span>
-<a name="l00081"></a>00081     cpl_ensure_code(nc%2 && nr%2, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00082"></a>00082     cpl_ensure_code(nc<=31 && nr<=31, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     <span class="comment">/* Initialise */</span>
-<a name="l00085"></a>00085     hsx = (nc-1) / 2;
-<a name="l00086"></a>00086     hsy = (nr-1) / 2;
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088     <span class="comment">/* Create a tmp binary image */</span>
-<a name="l00089"></a>00089     nx = cpl_mask_get_size_x(in);
-<a name="l00090"></a>00090     ny = cpl_mask_get_size_y(in);
-<a name="l00091"></a>00091     out = cpl_mask_new(nx, ny);
-<a name="l00092"></a>00092     in_data = cpl_mask_get_data(in);
-<a name="l00093"></a>00093     out_data = cpl_mask_get_data(out);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095     <span class="comment">/* Main filter loop */</span>
-<a name="l00096"></a>00096     <span class="keywordflow">for</span> (j=0; j<ny; j++) {
-<a name="l00097"></a>00097         <span class="keywordflow">for</span> (i=0; i<nx; i++) {
-<a name="l00098"></a>00098             <span class="comment">/* Curent pixel position */</span>
-<a name="l00099"></a>00099             curr_pos = i + j*nx;
-<a name="l00100"></a>00100             <span class="comment">/* Edges are not computed   */</span>
-<a name="l00101"></a>00101             <span class="keywordflow">if</span> ((i<hsx) || (i>=nx-hsx) || (j<hsy) || (j>=ny-hsy)) {
-<a name="l00102"></a>00102                 (out_data)[curr_pos] = CPL_BINARY_0;
-<a name="l00103"></a>00103             } <span class="keywordflow">else</span> {
-<a name="l00104"></a>00104                 <span class="comment">/* Initialise */</span>
-<a name="l00105"></a>00105                 (out_data)[curr_pos] = CPL_BINARY_0;
-<a name="l00106"></a>00106                 <span class="comment">/* Go into upper left corner of current pixel   */</span>
-<a name="l00107"></a>00107                 im_pos = curr_pos - hsx + hsy*nx;
-<a name="l00108"></a>00108                 filt_pos = 0;
-<a name="l00109"></a>00109                 sum      = 0;
-<a name="l00110"></a>00110                 <span class="keywordflow">for</span> (k=0; k<nr; k++) {
-<a name="l00111"></a>00111                     <span class="keywordflow">for</span> (l=0; l<nc; l++) {
-<a name="l00112"></a>00112                         <span class="keywordflow">if</span> (((in_data)[im_pos] == CPL_BINARY_1) &&
-<a name="l00113"></a>00113                                 (fabs(ker_arr[filt_pos]) > FLT_MIN))
-<a name="l00114"></a>00114                             sum+=fabs(ker_arr[filt_pos]);
-<a name="l00115"></a>00115                         <span class="comment">/* Next col */</span>
-<a name="l00116"></a>00116                         filt_pos++;
-<a name="l00117"></a>00117                         im_pos++;
-<a name="l00118"></a>00118                     }
-<a name="l00119"></a>00119                     <span class="comment">/* Next row */</span>
-<a name="l00120"></a>00120                     im_pos -= nx + nc;
-<a name="l00121"></a>00121                 }
-<a name="l00122"></a>00122                 <span class="keywordflow">if</span>(sum>0.5)
-<a name="l00123"></a>00123                     (out_data)[curr_pos] = CPL_BINARY_1;
-<a name="l00124"></a>00124             }
-<a name="l00125"></a>00125         }
-<a name="l00126"></a>00126     }
-<a name="l00127"></a>00127     memcpy(in_data, out_data, nx * ny * <span class="keyword">sizeof</span>(cpl_binary));
-<a name="l00128"></a>00128     cpl_mask_delete(out);
-<a name="l00129"></a>00129     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00130"></a>00130 }
-<a name="l00131"></a>00131 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_mask.c,v 1.3 2010/03/12 12:55: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/03/12 12:55:17 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <string.h></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> <span class="preprocessor">#include <cpl_mask.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl_matrix.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 "hawki_mask.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="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="l00056"></a><span class="lineno"><a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">   56</a></span> cpl_error_code <a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>         cpl_mask            *   in,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>         <span class="keyword">const</span> cpl_matrix    *   ker)</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>     cpl_mask        *   out;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>    *   ker_arr;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keywordtype">int</span>                 nc, nr;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">int</span>                 hsx, hsy;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="keywordtype">int</span>                 curr_pos, im_pos, filt_pos;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">int</span>                 i, j, k, l;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keywordtype">double</span>              sum;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordtype">int</span>                 nx;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="keywordtype">int</span>                 ny;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     cpl_binary      *   in_data;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     cpl_binary      *   out_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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_ensure_code(in && ker, CPL_ERROR_NULL_INPUT);</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">/* Get kernel informations */</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     nr = cpl_matrix_get_nrow(ker);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     nc = cpl_matrix_get_ncol(ker);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     ker_arr = cpl_matrix_get_data_const(ker);</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">/* Test the kernel validity */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     cpl_ensure_code(nc%2 && nr%2, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     cpl_ensure_code(nc<=31 && nr<=31, CPL_ERROR_ILLEGAL_INPUT);</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">/* Initialise */</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     hsx = (nc-1) / 2;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     hsy = (nr-1) / 2;</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">/* Create a tmp binary image */</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     nx = cpl_mask_get_size_x(in);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     ny = cpl_mask_get_size_y(in);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     out = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     in_data = cpl_mask_get_data(in);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     out_data = cpl_mask_get_data(out);</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">/* Main filter loop */</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordflow">for</span> (j=0; j<ny; j++) {</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         <span class="keywordflow">for</span> (i=0; i<nx; i++) {</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             <span class="comment">/* Curent pixel position */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>             curr_pos = i + j*nx;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>             <span class="comment">/* Edges are not computed   */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>             <span class="keywordflow">if</span> ((i<hsx) || (i>=nx-hsx) || (j<hsy) || (j>=ny-hsy)) {</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                 (out_data)[curr_pos] = CPL_BINARY_0;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                 <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                 (out_data)[curr_pos] = CPL_BINARY_0;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                 <span class="comment">/* Go into upper left corner of current pixel   */</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                 im_pos = curr_pos - hsx + hsy*nx;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                 filt_pos = 0;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                 sum      = 0;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                 <span class="keywordflow">for</span> (k=0; k<nr; k++) {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <span class="keywordflow">for</span> (l=0; l<nc; l++) {</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                         <span class="keywordflow">if</span> (((in_data)[im_pos] == CPL_BINARY_1) &&</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                 (fabs(ker_arr[filt_pos]) > FLT_MIN))</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                             sum+=fabs(ker_arr[filt_pos]);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                         <span class="comment">/* Next col */</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                         filt_pos++;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                         im_pos++;</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">/* Next row */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     im_pos -= nx + nc;</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">if</span>(sum>0.5)</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     (out_data)[curr_pos] = CPL_BINARY_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>         }</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>     memcpy(in_data, out_data, nx * ny * <span class="keyword">sizeof</span>(cpl_binary));</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     cpl_mask_delete(out);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</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><!-- 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/hawki__mask_8h_source.html b/html/hawki__mask_8h_source.html
index 8413030..56c0798 100644
--- a/html/hawki__mask_8h_source.html
+++ b/html/hawki__mask_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_mask.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,64 +40,65 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_mask.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_mask.h,v 1.1 2009/11/26 09:51: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/11/26 09:51:54 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_MASK_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_MASK_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 <span class="preprocessor">#include "cpl_mask.h"</span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include "cpl_matrix.h"</span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00036"></a>00036 <span class="comment">                                Functions prototypes</span>
-<a name="l00037"></a>00037 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 cpl_error_code <a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(
-<a name="l00040"></a>00040         cpl_mask            *   in,
-<a name="l00041"></a>00041         <span class="keyword">const</span> cpl_matrix    *   ker);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_mask.h,v 1.1 2009/11/26 09:51:54 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/11/26 09:51:54 $</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: hawki-1_8_12 $</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 HAWKI_MASK_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_MASK_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> <span class="preprocessor">#include "cpl_mask.h"</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include "cpl_matrix.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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="comment">                                Functions prototypes</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="comment"> -----------------------------------------------------------------------------*/</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> cpl_error_code <a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>         cpl_mask            *   in,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>         <span class="keyword">const</span> cpl_matrix    *   ker);</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">#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/hawki__match__cats_8c_source.html b/html/hawki__match__cats_8c_source.html
index 3c8cd58..3c74ef7 100644
--- a/html/hawki__match__cats_8c_source.html
+++ b/html/hawki__match__cats_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_match_cats.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,101 +40,102 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_match_cats.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_match_cats.c,v 1.1 2009/11/26 09:52:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/11/26 09:52:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_match_cats.h"</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00054"></a>00054 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00075"></a>00075 <span class="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a>
-<a name="l00076"></a><a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593">00076</a> (cpl_table * catalogue1,
-<a name="l00077"></a>00077  cpl_table * catalogue2,
-<a name="l00078"></a>00078  <span class="keywordtype">int</span>         iobj1,
-<a name="l00079"></a>00079  <span class="keywordtype">int</span>         iobj2)
-<a name="l00080"></a>00080 {
-<a name="l00081"></a>00081     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> max_dist2 = 25;
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     <span class="keywordtype">int</span>                 null;
-<a name="l00084"></a>00084     <span class="keywordtype">double</span>              posx1;
-<a name="l00085"></a>00085     <span class="keywordtype">double</span>              posy1;
-<a name="l00086"></a>00086     <span class="keywordtype">double</span>              posx2;
-<a name="l00087"></a>00087     <span class="keywordtype">double</span>              posy2;
-<a name="l00088"></a>00088     <span class="keywordtype">double</span>              dist2;
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     posx1 =
-<a name="l00091"></a>00091         cpl_table_get_double(catalogue1, HAWKI_COL_OBJ_POSX, iobj1, &null);
-<a name="l00092"></a>00092     posy1 =
-<a name="l00093"></a>00093         cpl_table_get_double(catalogue1, HAWKI_COL_OBJ_POSY, iobj1, &null);
-<a name="l00094"></a>00094     posx2 =
-<a name="l00095"></a>00095         cpl_table_get_double(catalogue2, HAWKI_COL_OBJ_POSX, iobj2, &null);
-<a name="l00096"></a>00096     posy2 =
-<a name="l00097"></a>00097         cpl_table_get_double(catalogue2, HAWKI_COL_OBJ_POSY, iobj2, &null);
-<a name="l00098"></a>00098     
-<a name="l00099"></a>00099     dist2 = (posx1 - posx2) * (posx1 - posx2) + (posy1 - posy2) * (posy1 - posy2);
-<a name="l00100"></a>00100     <span class="keywordflow">if</span>(dist2 <= max_dist2)
-<a name="l00101"></a>00101         <span class="keywordflow">return</span> 1;
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103     <span class="keywordflow">return</span> 0;
-<a name="l00104"></a>00104 }
-<a name="l00105"></a>00105 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_match_cats.c,v 1.1 2009/11/26 09:52: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/11/26 09:52:32 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_match_cats.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">/*----------------------------------------------------------------------------*/</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> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a></div>
+<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593">   76</a></span> (cpl_table * catalogue1,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  cpl_table * catalogue2,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  <span class="keywordtype">int</span>         iobj1,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keywordtype">int</span>         iobj2)</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="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> max_dist2 = 25;</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">int</span>                 null;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordtype">double</span>              posx1;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     <span class="keywordtype">double</span>              posy1;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordtype">double</span>              posx2;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keywordtype">double</span>              posy2;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <span class="keywordtype">double</span>              dist2;</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>     posx1 =</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         cpl_table_get_double(catalogue1, HAWKI_COL_OBJ_POSX, iobj1, &null);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     posy1 =</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         cpl_table_get_double(catalogue1, HAWKI_COL_OBJ_POSY, iobj1, &null);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     posx2 =</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         cpl_table_get_double(catalogue2, HAWKI_COL_OBJ_POSX, iobj2, &null);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     posy2 =</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         cpl_table_get_double(catalogue2, HAWKI_COL_OBJ_POSY, iobj2, &null);</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>     dist2 = (posx1 - posx2) * (posx1 - posx2) + (posy1 - posy2) * (posy1 - posy2);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordflow">if</span>(dist2 <= max_dist2)</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         <span class="keywordflow">return</span> 1;</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="keywordflow">return</span> 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> </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/hawki__match__cats_8h_source.html b/html/hawki__match__cats_8h_source.html
index 6cecfa4..ccb7f92 100644
--- a/html/hawki__match__cats_8h_source.html
+++ b/html/hawki__match__cats_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_match_cats.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,64 +40,65 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_match_cats.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_match_cats.h,v 1.1 2009/11/26 09:52:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/11/26 09:52:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_MATCH_CATS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_MATCH_CATS_H</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="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a>
-<a name="l00038"></a>00038 (cpl_table * catalogue1,
-<a name="l00039"></a>00039  cpl_table * catalogue2,
-<a name="l00040"></a>00040  <span class="keywordtype">int</span>         iobj1,
-<a name="l00041"></a>00041  <span class="keywordtype">int</span>         iobj2);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_match_cats.h,v 1.1 2009/11/26 09:52: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/11/26 09:52:32 $</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: hawki-1_8_12 $</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 HAWKI_MATCH_CATS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_MATCH_CATS_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="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="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga7255ba5ecf2bd6539c02c1f7d765e593" title="Compare two objects positions and determine whetherthey are within a 5 pix tolerance.">hawki_match_condition_5_pix</a></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> (cpl_table * catalogue1,</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>  cpl_table * catalogue2,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>  <span class="keywordtype">int</span>         iobj1,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>  <span class="keywordtype">int</span>         iobj2);</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">#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/hawki__obj__det_8c_source.html b/html/hawki__obj__det_8c_source.html
index a73d580..f4acbb9 100644
--- a/html/hawki__obj__det_8c_source.html
+++ b/html/hawki__obj__det_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_obj_det.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,124 +40,125 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_obj_det.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_obj_det.c,v 1.2 2009/09/29 09:13:00 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/09/29 09:13:00 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_obj_det.h"</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00054"></a>00054 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00067"></a>00067 <span class="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>
-<a name="l00068"></a><a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb">00068</a> (cpl_table ** objs_prop, cpl_propertylist ** objs_prop_stats)
-<a name="l00069"></a>00069 {
-<a name="l00070"></a>00070     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00071"></a>00071     <span class="keywordtype">int</span>             idet;
-<a name="l00072"></a>00072     
-<a name="l00073"></a>00073     <span class="comment">/* Checking input */</span>
-<a name="l00074"></a>00074     <span class="keywordflow">if</span>(objs_prop == NULL || objs_prop_stats == NULL)
-<a name="l00075"></a>00075     {
-<a name="l00076"></a>00076         cpl_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);
-<a name="l00077"></a>00077         <span class="keywordflow">return</span> -1;
-<a name="l00078"></a>00078     }
-<a name="l00079"></a>00079     
-<a name="l00080"></a>00080     <span class="comment">/* Compute the statistics */</span>
-<a name="l00081"></a>00081     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00082"></a>00082     {
-<a name="l00083"></a>00083         cpl_propertylist_append_double
-<a name="l00084"></a>00084             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MEAN"</span>,
-<a name="l00085"></a>00085              cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));
-<a name="l00086"></a>00086         cpl_propertylist_append_double
-<a name="l00087"></a>00087             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MED"</span>,
-<a name="l00088"></a>00088              cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));
-<a name="l00089"></a>00089         cpl_propertylist_append_double
-<a name="l00090"></a>00090             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MIN"</span>,
-<a name="l00091"></a>00091              cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));
-<a name="l00092"></a>00092         cpl_propertylist_append_double
-<a name="l00093"></a>00093             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MAX"</span>,
-<a name="l00094"></a>00094              cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));
-<a name="l00095"></a>00095         cpl_propertylist_append_double
-<a name="l00096"></a>00096             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE STDEV"</span>,
-<a name="l00097"></a>00097              cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099         cpl_propertylist_append_double
-<a name="l00100"></a>00100             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MEAN"</span>,
-<a name="l00101"></a>00101              cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));
-<a name="l00102"></a>00102         cpl_propertylist_append_double
-<a name="l00103"></a>00103             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MED"</span>,
-<a name="l00104"></a>00104              cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));
-<a name="l00105"></a>00105         cpl_propertylist_append_double
-<a name="l00106"></a>00106             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MIN"</span>,
-<a name="l00107"></a>00107              cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));
-<a name="l00108"></a>00108         cpl_propertylist_append_double
-<a name="l00109"></a>00109             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MAX"</span>,
-<a name="l00110"></a>00110              cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));
-<a name="l00111"></a>00111         cpl_propertylist_append_double
-<a name="l00112"></a>00112             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP STDEV"</span>,
-<a name="l00113"></a>00113              cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));
-<a name="l00114"></a>00114     }
-<a name="l00115"></a>00115     
-<a name="l00116"></a>00116     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00117"></a>00117         <span class="keywordflow">return</span> -1;
-<a name="l00118"></a>00118     <span class="keywordflow">return</span> 0;
-<a name="l00119"></a>00119 }
-<a name="l00120"></a>00120 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_obj_det.c,v 1.2 2009/09/29 09:13:00 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/09/29 09:13:00 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_obj_det.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">/*----------------------------------------------------------------------------*/</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> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a></div>
+<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb">   68</a></span> (cpl_table ** objs_prop, cpl_propertylist ** objs_prop_stats)</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>     cpl_errorstate  prestate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordtype">int</span>             idet;</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="comment">/* Checking input */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordflow">if</span>(objs_prop == NULL || objs_prop_stats == 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>         cpl_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="keywordflow">return</span> -1;</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="l00080"></a><span class="lineno">   80</span>     <span class="comment">/* Compute the statistics */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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_append_double</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MEAN"</span>,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>              cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MED"</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>              cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MIN"</span>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>              cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE MAX"</span>,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>              cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ANGLE STDEV"</span>,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>              cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ANGLE));</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_propertylist_append_double</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MEAN"</span>,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>              cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MED"</span>,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>              cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MIN"</span>,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>              cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP MAX"</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>              cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>             (objs_prop_stats[idet], <span class="stringliteral">"ESO QC OBJ ELLIP STDEV"</span>,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>              cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ELLIP));</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="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordflow">return</span> 0;</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><!-- 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/hawki__obj__det_8h_source.html b/html/hawki__obj__det_8h_source.html
index 435f341..610dd39 100644
--- a/html/hawki__obj__det_8h_source.html
+++ b/html/hawki__obj__det_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_obj_det.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,61 +40,62 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_obj_det.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_obj_det.h,v 1.1 2008/10/22 10:42: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/10/22 10:42:04 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_OBJ_DET_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_OBJ_DET_H</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="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>
-<a name="l00038"></a>00038 (cpl_table ** objs_prop, cpl_propertylist ** objs_prop_stats);
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_obj_det.h,v 1.1 2008/10/22 10:42:04 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008/10/22 10:42:04 $</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: hawki-1_8_12 $</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 HAWKI_OBJ_DET_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_OBJ_DET_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="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="keywordtype">int</span> <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> (cpl_table ** objs_prop, cpl_propertylist ** objs_prop_stats);</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">#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/hawki__pfits_8c_source.html b/html/hawki__pfits_8c_source.html
index 475a2d5..21916aa 100644
--- a/html/hawki__pfits_8c_source.html
+++ b/html/hawki__pfits_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_pfits.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,466 +40,485 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_pfits.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_pfits.c,v 1.18 2010/02/23 10:58: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/02/23 10:58:44 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.18 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <string.h></span>
-<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 "hawki_pfits.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00051"></a>00051 <span class="comment">                            Function codes</span>
-<a name="l00052"></a>00052 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00060"></a>00060 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00061"></a><a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df">00061</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00062"></a>00062 {
-<a name="l00063"></a>00063     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AIRM START"</span>) ;
-<a name="l00064"></a>00064 }
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00072"></a>00072 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00073"></a><a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3">00073</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00074"></a>00074 {
-<a name="l00075"></a>00075     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AIRM END"</span>) ;
-<a name="l00076"></a>00076 }
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00084"></a>00084 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00085"></a><a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a">00085</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00086"></a>00086 {
-<a name="l00087"></a>00087     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI RHUM"</span>) ;
-<a name="l00088"></a>00088 }
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00096"></a>00096 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00097"></a><a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d">00097</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d" title="find out the PRO.CATG">hawki_pfits_get_procatg</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00098"></a>00098 {
-<a name="l00099"></a>00099     <span class="keywordflow">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO PRO CATG"</span>);
-<a name="l00100"></a>00100 }
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00110"></a>00110 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00111"></a><a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc">00111</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00112"></a>00112 {
-<a name="l00113"></a>00113     <span class="keywordtype">double</span> alpha_coded;
-<a name="l00114"></a>00114     <span class="keywordtype">double</span> ra_hh, ra_mm, ra_ss;
-<a name="l00115"></a>00115     <span class="keywordtype">double</span> ra_deg;
-<a name="l00116"></a>00116     alpha_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG ALPHA"</span>);
-<a name="l00117"></a>00117     ra_hh = (int)(alpha_coded / 10000);
-<a name="l00118"></a>00118     ra_mm = (int)((alpha_coded - ra_hh * 10000) / 100);
-<a name="l00119"></a>00119     ra_ss = alpha_coded - ra_hh * 10000 - ra_mm * 100;
-<a name="l00120"></a>00120     ra_deg = ra_hh * 15. + ra_mm / 4. + ra_ss / 240.;
-<a name="l00121"></a>00121     <span class="keywordflow">return</span> ra_deg;
-<a name="l00122"></a>00122 }
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00132"></a>00132 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00133"></a><a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c">00133</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00134"></a>00134 {
-<a name="l00135"></a>00135     <span class="keywordtype">double</span> delta_coded;
-<a name="l00136"></a>00136     <span class="keywordtype">double</span> dec_dd, dec_mm, dec_ss;
-<a name="l00137"></a>00137     <span class="keywordtype">double</span> dec_deg;
-<a name="l00138"></a>00138     delta_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG DELTA"</span>);
-<a name="l00139"></a>00139     dec_dd = (int)(delta_coded / 10000);
-<a name="l00140"></a>00140     dec_mm = (int)((delta_coded - dec_dd * 10000) / 100);
-<a name="l00141"></a>00141     dec_ss = delta_coded - dec_dd * 10000 - dec_mm * 100;
-<a name="l00142"></a>00142     dec_deg = dec_dd + dec_mm / 60. + dec_ss / 3600.;
-<a name="l00143"></a>00143     <span class="keywordflow">return</span> dec_deg;
-<a name="l00144"></a>00144 }
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00153"></a>00153 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00154"></a><a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad">00154</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00155"></a>00155 {
-<a name="l00156"></a>00156     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG EQUINOX"</span>) ;
-<a name="l00157"></a>00157 }
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00166"></a>00166 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00167"></a><a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168">00167</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00168"></a>00168 {
-<a name="l00169"></a>00169     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG EPOCH"</span>) ;
-<a name="l00170"></a>00170 }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00178"></a>00178 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00179"></a><a class="code" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d">00179</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d" title="find out the RA">hawki_pfits_get_ra</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00180"></a>00180 {
-<a name="l00181"></a>00181     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"RA"</span>) ;
-<a name="l00182"></a>00182 }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00191"></a><a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4">00191</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4" title="find out the DEC">hawki_pfits_get_dec</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00192"></a>00192 {
-<a name="l00193"></a>00193     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"DEC"</span>) ;
-<a name="l00194"></a>00194 }
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00202"></a>00202 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00203"></a><a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea">00203</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00204"></a>00204 {
-<a name="l00205"></a>00205     <span class="keywordflow">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"EXTNAME"</span>);
-<a name="l00206"></a>00206 }
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00214"></a>00214 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00215"></a><a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056">00215</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056" title="find out the arcfile">hawki_pfits_get_arcfile</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217     <span class="keywordflow">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"ARCFILE"</span>);
-<a name="l00218"></a>00218 }
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00226"></a>00226 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00227"></a><a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0">00227</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0" title="find out the date of observation">hawki_pfits_get_date_obs</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00228"></a>00228 {
-<a name="l00229"></a>00229     <span class="keywordflow">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"DATE-OBS"</span>) ;
-<a name="l00230"></a>00230 }
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00238"></a>00238 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00239"></a><a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2">00239</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2" title="find out the NEXP value">hawki_pfits_get_nexp</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00240"></a>00240 {
-<a name="l00241"></a>00241     <span class="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO TPL NEXP"</span>)  ;
-<a name="l00242"></a>00242 }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00250"></a>00250 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00251"></a><a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f">00251</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00252"></a>00252 {
-<a name="l00253"></a>00253     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO DET DIT"</span>)  ;
-<a name="l00254"></a>00254 }
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00262"></a>00262 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00263"></a><a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788">00263</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00264"></a>00264 {
-<a name="l00265"></a>00265     <span class="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO DET NDIT"</span>)  ;
-<a name="l00266"></a>00266 }
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00274"></a>00274 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00275"></a><a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190">00275</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00276"></a>00276 {
-<a name="l00277"></a>00277     <span class="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO DET NDSAMPLES"</span>)  ;
-<a name="l00278"></a>00278 }
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00286"></a>00286 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00287"></a><a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b">00287</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00288"></a>00288 {
-<a name="l00289"></a>00289     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO INS PIXSCALE"</span>) ;
-<a name="l00290"></a>00290 }
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00298"></a>00298 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00299"></a><a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102">00299</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00300"></a>00300 {
-<a name="l00301"></a>00301     <span class="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"NAXIS1"</span>) ;
-<a name="l00302"></a>00302 }
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00310"></a>00310 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00311"></a><a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356">00311</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00312"></a>00312 {
-<a name="l00313"></a>00313     <span class="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"NAXIS2"</span>) ;
-<a name="l00314"></a>00314 }
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00322"></a>00322 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00323"></a><a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea">00323</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea" title="find out the value in WCS coordinates of the reference pixel (axe 1)">hawki_pfits_get_crval1</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00324"></a>00324 {
-<a name="l00325"></a>00325     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</span>) ;
-<a name="l00326"></a>00326 }
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00334"></a>00334 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00335"></a><a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692">00335</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692" title="find out the value in WCS coordinates of the reference pixel (axe 2)">hawki_pfits_get_crval2</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00336"></a>00336 {
-<a name="l00337"></a>00337     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</span>) ;
-<a name="l00338"></a>00338 }
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00346"></a>00346 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00347"></a><a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80">00347</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix1</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00348"></a>00348 {
-<a name="l00349"></a>00349     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</span>) ;
-<a name="l00350"></a>00350 }
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00358"></a>00358 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00359"></a><a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10">00359</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix2</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00360"></a>00360 {
-<a name="l00361"></a>00361     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</span>) ;
-<a name="l00362"></a>00362 }
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00370"></a>00370 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00371"></a><a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78">00371</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78" title="find out the increment of coordinate in one pixel (axe 1)">hawki_pfits_get_cdelta1</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00372"></a>00372 {
-<a name="l00373"></a>00373     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELTA1"</span>) ;
-<a name="l00374"></a>00374 }
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00382"></a>00382 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00383"></a><a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c">00383</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c" title="find out the increment of coordinate in one pixel (axe 2)">hawki_pfits_get_cdelta2</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00384"></a>00384 {
-<a name="l00385"></a>00385     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELTA2"</span>) ;
-<a name="l00386"></a>00386 }
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00394"></a>00394 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00395"></a><a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53">00395</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00396"></a>00396 {
-<a name="l00397"></a>00397     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETA"</span>) ;
-<a name="l00398"></a>00398 }
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00406"></a>00406 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00407"></a><a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d">00407</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00408"></a>00408 {
-<a name="l00409"></a>00409     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETD"</span>) ;
-<a name="l00410"></a>00410 }
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00418"></a>00418 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00419"></a><a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e">00419</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00420"></a>00420 {
-<a name="l00421"></a>00421     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETX"</span>) ;
-<a name="l00422"></a>00422 }
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00430"></a>00430 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00431"></a><a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca">00431</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00432"></a>00432 {
-<a name="l00433"></a>00433     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETY"</span>) ;
-<a name="l00434"></a>00434 }
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00442"></a>00442 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00443"></a><a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951">00443</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951" title="find out the position angle">hawki_pfits_get_posangle</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00444"></a>00444 {
-<a name="l00445"></a>00445     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA POSANG"</span>) ;
-<a name="l00446"></a>00446 }
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00454"></a>00454 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00455"></a><a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501">00455</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00456"></a>00456 {
-<a name="l00457"></a>00457     <span class="keyword">const</span> <span class="keywordtype">char</span>  *   val ;
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     val = cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO INS FILT1 NAME"</span>) ;
-<a name="l00460"></a>00460     <span class="keywordflow">if</span> (val == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00461"></a>00461     <span class="comment">/* If FILT1 is not open, return its value */</span>
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (strcmp(val, <span class="stringliteral">"open"</span>) && strcmp(val, <span class="stringliteral">"OPEN"</span>)) <span class="keywordflow">return</span> val ;
-<a name="l00463"></a>00463     <span class="comment">/* FILT1 is open, return value from FILT2 */</span>
-<a name="l00464"></a>00464     val = cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO INS FILT2 NAME"</span>) ;
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (val == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00466"></a>00466     <span class="keywordflow">if</span> (strcmp(val, <span class="stringliteral">"open"</span>) && strcmp(val, <span class="stringliteral">"OPEN"</span>)) <span class="keywordflow">return</span> val ;
-<a name="l00467"></a>00467     <span class="keywordflow">return</span> NULL ;
-<a name="l00468"></a>00468 }
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00476"></a>00476 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00477"></a><a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4">00477</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4" title="find out the focus position of M2">hawki_pfits_get_focus</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00478"></a>00478 {
-<a name="l00479"></a>00479     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL FOCU VALUE"</span>) ;
-<a name="l00480"></a>00480 }
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00488"></a>00488 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00489"></a><a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246">00489</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00490"></a>00490 {
-<a name="l00491"></a>00491     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL ALT"</span>) ;
-<a name="l00492"></a>00492 }
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00500"></a>00500 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00501"></a><a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58">00501</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00502"></a>00502 {
-<a name="l00503"></a>00503     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AZ"</span>) ;
-<a name="l00504"></a>00504 }
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00512"></a>00512 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00513"></a><a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b">00513</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00514"></a>00514 {
-<a name="l00515"></a>00515     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI RHUM"</span>) ;
-<a name="l00516"></a>00516 }
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00524"></a>00524 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00525"></a><a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b">00525</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00526"></a>00526 {
-<a name="l00527"></a>00527     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI TAU0"</span>) ;
-<a name="l00528"></a>00528 }
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00536"></a>00536 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00537"></a><a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b">00537</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00538"></a>00538 {
-<a name="l00539"></a>00539     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI TEMP"</span>) ;
-<a name="l00540"></a>00540 }
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00548"></a>00548 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00549"></a><a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125">00549</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00550"></a>00550 {
-<a name="l00551"></a>00551     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI WINDDIR"</span>) ;
-<a name="l00552"></a>00552 }
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00560"></a>00560 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00561"></a><a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708">00561</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00562"></a>00562 {
-<a name="l00563"></a>00563     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI WINDSP"</span>) ;
-<a name="l00564"></a>00564 }
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00572"></a>00572 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00573"></a><a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121">00573</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00574"></a>00574 {
-<a name="l00575"></a>00575     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL IA FWHM"</span>) ;
-<a name="l00576"></a>00576 }
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00584"></a>00584 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00585"></a><a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2">00585</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00586"></a>00586 {
-<a name="l00587"></a>00587     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA ABSROT START"</span>) ;
-<a name="l00588"></a>00588 }
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00596"></a>00596 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00597"></a><a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2">00597</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00598"></a>00598 {
-<a name="l00599"></a>00599     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA ABSROT END"</span>) ;
-<a name="l00600"></a>00600 }
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00608"></a>00608 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00609"></a><a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259">00609</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00610"></a>00610 {
-<a name="l00611"></a>00611     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI FWHM START"</span>) ;
-<a name="l00612"></a>00612 }
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00620"></a>00620 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00621"></a><a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21">00621</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00622"></a>00622 {
-<a name="l00623"></a>00623     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI FWHM END"</span>) ;
-<a name="l00624"></a>00624 }
-<a name="l00625"></a>00625 
-<a name="l00626"></a>00626 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00632"></a>00632 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00633"></a><a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4">00633</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00634"></a>00634 {
-<a name="l00635"></a>00635     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI PRES START"</span>) ;
-<a name="l00636"></a>00636 }
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00644"></a>00644 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00645"></a><a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813">00645</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00646"></a>00646 {
-<a name="l00647"></a>00647     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI PRES END"</span>) ;
-<a name="l00648"></a>00648 }
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00656"></a>00656 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00657"></a><a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274">00657</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00658"></a>00658 {
-<a name="l00659"></a>00659     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL PARANG START"</span>) ;
-<a name="l00660"></a>00660 }
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00668"></a>00668 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00669"></a><a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b">00669</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00670"></a>00670 {
-<a name="l00671"></a>00671     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL PARANG END"</span>) ;
-<a name="l00672"></a>00672 }
-<a name="l00673"></a>00673 
-<a name="l00674"></a>00674 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00680"></a>00680 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00681"></a>00681 
-<a name="l00682"></a><a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c">00682</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00683"></a>00683 {
-<a name="l00684"></a>00684     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</span>);
-<a name="l00685"></a>00685 }
-<a name="l00686"></a>00686 
-<a name="l00687"></a>00687 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00693"></a>00693 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00694"></a><a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a">00694</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00695"></a>00695 {
-<a name="l00696"></a>00696     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</span>);
-<a name="l00697"></a>00697 }
-<a name="l00698"></a>00698 
-<a name="l00699"></a>00699 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00705"></a>00705 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00706"></a><a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1">00706</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00707"></a>00707 {
-<a name="l00708"></a>00708     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED POSX"</span>);
-<a name="l00709"></a>00709 }
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00717"></a>00717 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00718"></a><a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e">00718</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(<span class="keyword">const</span> cpl_propertylist * plist)
-<a name="l00719"></a>00719 {
-<a name="l00720"></a>00720     <span class="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED POSY"</span>);
-<a name="l00721"></a>00721 }
-<a name="l00722"></a>00722 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_pfits.c,v 1.19 2013/01/15 09:57: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/01/15 09:57:13 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "hawki_pfits.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">/*----------------------------------------------------------------------------*/</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="comment">                            Function codes</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> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df">   61</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AIRM START"</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> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</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"><a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3">   73</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AIRM END"</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> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</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"><a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a">   85</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI RHUM"</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> <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"><a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d">   97</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d" title="find out the PRO.CATG">hawki_pfits_get_procatg</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO PRO CATG"</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> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</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"><a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc">  111</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">double</span> alpha_coded;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="keywordtype">double</span> ra_hh, ra_mm, ra_ss;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordtype">double</span> ra_deg;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     alpha_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG ALPHA"</span>);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     ra_hh = (int)(alpha_coded / 10000);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     ra_mm = (int)((alpha_coded - ra_hh * 10000) / 100);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     ra_ss = alpha_coded - ra_hh * 10000 - ra_mm * 100;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     ra_deg = ra_hh * 15. + ra_mm / 4. + ra_ss / 240.;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordflow">return</span> ra_deg;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga0645065208992d9bf67d189796db4e67">  133</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0645065208992d9bf67d189796db4e67" title="find out the target RA in HHMMSS format">hawki_pfits_get_targ_alpha_hhmmss</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordtype">double</span> alpha_coded;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     alpha_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG ALPHA"</span>);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="keywordflow">return</span> alpha_coded;</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> <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"><a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c">  149</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordtype">double</span> delta_coded;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordtype">double</span> dec_dd, dec_mm, dec_ss;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordtype">double</span> dec_deg;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     delta_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG DELTA"</span>);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     dec_dd = (int)(delta_coded / 10000);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     dec_mm = (int)((delta_coded - dec_dd * 10000) / 100);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     dec_ss = delta_coded - dec_dd * 10000 - dec_mm * 100;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     dec_deg = dec_dd + dec_mm / 60. + dec_ss / 3600.;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordflow">return</span> dec_deg;</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="l00170"></a><span class="lineno">  170</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gae4655f62c9a6997a95fd2794e82640b3">  171</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4655f62c9a6997a95fd2794e82640b3" title="find out the target DEC in DDMMSS format">hawki_pfits_get_targ_delta_ddmmss</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordtype">double</span> delta_coded;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     delta_coded = cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG DELTA"</span>);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keywordflow">return</span> delta_coded;</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="l00185"></a><span class="lineno">  185</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad">  186</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG EQUINOX"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168">  199</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL TARG EPOCH"</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="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__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d">  211</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d" title="find out the RA">hawki_pfits_get_ra</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"RA"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4">  223</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4" title="find out the DEC">hawki_pfits_get_dec</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"DEC"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea">  235</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"EXTNAME"</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="l00246"></a><span class="lineno">  246</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056">  247</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056" title="find out the arcfile">hawki_pfits_get_arcfile</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"ARCFILE"</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="l00252"></a><span class="lineno">  252</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0">  259</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0" title="find out the date of observation">hawki_pfits_get_date_obs</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> (<span class="keyword">const</span> <span class="keywordtype">char</span> *) cpl_propertylist_get_string(plist, <span class="stringliteral">"DATE-OBS"</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="l00264"></a><span class="lineno">  264</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2">  271</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2" title="find out the NEXP value">hawki_pfits_get_nexp</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO TPL NEXP"</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> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f">  283</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO DET DIT"</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> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</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"><a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788">  295</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO DET NDIT"</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="l00306"></a><span class="lineno">  306</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190">  307</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"ESO DET NDSAMPLES"</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> <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"><a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b">  319</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO INS PIXSCALE"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102">  331</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordflow">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"NAXIS1"</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> </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</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"><a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356">  343</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_int(plist, <span class="stringliteral">"NAXIS2"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea">  355</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea" title="find out the value in WCS coordinates of the reference pixel (axe 1)">hawki_pfits_get_crval1</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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_propertylist_get_double(plist, <span class="stringliteral">"CRVAL1"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692">  367</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692" title="find out the value in WCS coordinates of the reference pixel (axe 2)">hawki_pfits_get_crval2</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRVAL2"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80">  379</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix1</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX1"</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="l00390"></a><span class="lineno">  390</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10">  391</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix2</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CRPIX2"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78">  403</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78" title="find out the increment of coordinate in one pixel (axe 1)">hawki_pfits_get_cdelta1</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keywordflow">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELTA1"</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c">  415</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c" title="find out the increment of coordinate in one pixel (axe 2)">hawki_pfits_get_cdelta2</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"CDELTA2"</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="l00426"></a><span class="lineno">  426</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53">  427</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETA"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d">  439</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETD"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e">  451</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETX"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca">  463</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO SEQ CUMOFFSETY"</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="l00468"></a><span class="lineno">  468</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951">  475</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951" title="find out the position angle">hawki_pfits_get_posangle</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA POSANG"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501">  487</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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="keyword">const</span> <span class="keywordtype">char</span>  *   val ;</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>     val = cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO INS FILT1 NAME"</span>) ;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="keywordflow">if</span> (val == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     <span class="comment">/* If FILT1 is not open, return its value */</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     <span class="keywordflow">if</span> (strcmp(val, <span class="stringliteral">"open"</span>) && strcmp(val, <span class="stringliteral">"OPEN"</span>)) <span class="keywordflow">return</span> val ;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="comment">/* FILT1 is open, return value from FILT2 */</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     val = cpl_propertylist_get_string(plist, <span class="stringliteral">"ESO INS FILT2 NAME"</span>) ;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">if</span> (val == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="keywordflow">if</span> (strcmp(val, <span class="stringliteral">"open"</span>) && strcmp(val, <span class="stringliteral">"OPEN"</span>)) <span class="keywordflow">return</span> val ;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     <span class="keywordflow">return</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> </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4">  509</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4" title="find out the focus position of M2">hawki_pfits_get_focus</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL FOCU VALUE"</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="l00520"></a><span class="lineno">  520</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00521"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246">  521</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL ALT"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58">  533</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AZ"</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="l00538"></a><span class="lineno">  538</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b">  545</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI RHUM"</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> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00557"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b">  557</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI TAU0"</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="l00568"></a><span class="lineno">  568</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00569"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b">  569</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI TEMP"</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00581"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125">  581</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI WINDDIR"</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> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708">  593</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI WINDSP"</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> </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</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__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121">  605</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL IA FWHM"</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> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00617"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2">  617</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA ABSROT START"</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="l00628"></a><span class="lineno">  628</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2">  629</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO ADA ABSROT END"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259">  641</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI FWHM START"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21">  653</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI FWHM END"</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4">  665</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI PRES START"</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> </div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813">  677</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL AMBI PRES END"</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> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274">  689</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL PARANG START"</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> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b">  701</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO TEL PARANG END"</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> </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c">  714</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</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> </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</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"><a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a">  726</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</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> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1">  738</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED POSX"</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> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00750"></a><span class="lineno"><a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e">  750</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(<span class="keyword">const</span> cpl_propertylist * plist)</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">return</span> cpl_propertylist_get_double(plist, <span class="stringliteral">"ESO QC COMBINED POSY"</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> </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/hawki__pfits_8h_source.html b/html/hawki__pfits_8h_source.html
index bb360a6..4a63c58 100644
--- a/html/hawki__pfits_8h_source.html
+++ b/html/hawki__pfits_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_pfits.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,118 +40,121 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_pfits.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_pfits.h,v 1.15 2012/12/07 13:45: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/07 13:45:43 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.15 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_PFITS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PFITS_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                Functions prototypes</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 CPL_BEGIN_DECLS
-<a name="l00042"></a>00042 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00043"></a>00043 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00044"></a>00044 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00045"></a>00045 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00046"></a>00046 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00047"></a>00047 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00048"></a>00048 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00049"></a>00049 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00050"></a>00050 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d" title="find out the RA">hawki_pfits_get_ra</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00051"></a>00051 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4" title="find out the DEC">hawki_pfits_get_dec</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00052"></a>00052 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056" title="find out the arcfile">hawki_pfits_get_arcfile</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00053"></a>00053 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d" title="find out the PRO.CATG">hawki_pfits_get_procatg</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00054"></a>00054 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0" title="find out the date of observation">hawki_pfits_get_date_obs</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00055"></a>00055 <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00056"></a>00056 <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00057"></a>00057 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea" title="find out the value in WCS coordinates of the reference pixel (axe 1)">hawki_pfits_get_crval1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00058"></a>00058 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692" title="find out the value in WCS coordinates of the reference pixel (axe 2)">hawki_pfits_get_crval2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00059"></a>00059 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00060"></a>00060 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00061"></a>00061 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78" title="find out the increment of coordinate in one pixel (axe 1)">hawki_pfits_get_cdelta1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00062"></a>00062 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c" title="find out the increment of coordinate in one pixel (axe 2)">hawki_pfits_get_cdelta2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00063"></a>00063 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00064"></a>00064 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00065"></a>00065 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00066"></a>00066 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00067"></a>00067 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00068"></a>00068 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951" title="find out the position angle">hawki_pfits_get_posangle</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00069"></a>00069 <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2" title="find out the NEXP value">hawki_pfits_get_nexp</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00070"></a>00070 <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00071"></a>00071 <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00072"></a>00072 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00073"></a>00073 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00074"></a>00074 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4" title="find out the focus position of M2">hawki_pfits_get_focus</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;
-<a name="l00075"></a>00075 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00076"></a>00076 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00077"></a>00077 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00078"></a>00078 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00079"></a>00079 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00080"></a>00080 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00081"></a>00081 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00082"></a>00082 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00083"></a>00083 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00084"></a>00084 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00085"></a>00085 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00086"></a>00086 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00087"></a>00087 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00088"></a>00088 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00089"></a>00089 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00090"></a>00090 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00091"></a>00091 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00092"></a>00092 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00093"></a>00093 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00094"></a>00094 <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(<span class="keyword">const</span> cpl_propertylist * plist);
-<a name="l00095"></a>00095 CPL_END_DECLS
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_pfits.h,v 1.16 2013/01/15 09:57: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/01/15 09:57:13 $</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: hawki-1_8_12 $</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 HAWKI_PFITS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                Functions prototypes</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga5161743d5b650a637d543959b5bd54ea" title="find out the extname">hawki_pfits_get_extname</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga643c35f35f7f49a3e1c6bafd022e364a" title="find out the humidity level">hawki_pfits_get_humidity_level</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0645065208992d9bf67d189796db4e67" title="find out the target RA in HHMMSS format">hawki_pfits_get_targ_alpha_hhmmss</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4655f62c9a6997a95fd2794e82640b3" title="find out the target DEC in DDMMSS format">hawki_pfits_get_targ_delta_ddmmss</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga662be8ce410cbfa244f51ec8e5f0baad" title="find out the target equinox">hawki_pfits_get_targ_equinox</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga07110c618d0772882174838d8ce9a168" title="find out the target epoch">hawki_pfits_get_targ_epoch</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga6f490d48a329331dc3b1bc48c1e9ed1d" title="find out the RA">hawki_pfits_get_ra</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaca47ff94f05c2bb322ea83ce4cf9b4d4" title="find out the DEC">hawki_pfits_get_dec</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gae4f45ff97625d37b9354392b0c5e1056" title="find out the arcfile">hawki_pfits_get_arcfile</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#gad9c95c0d3bc75d347bf9acbcb8fe549d" title="find out the PRO.CATG">hawki_pfits_get_procatg</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga87aca0d821694845e43e06dca5ace1a0" title="find out the date of observation">hawki_pfits_get_date_obs</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga98f777c6f085878ba095b1ccd40ef6ea" title="find out the value in WCS coordinates of the reference pixel (axe 1)">hawki_pfits_get_crval1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7fbf6de80172c991e4a9d7f427741692" title="find out the value in WCS coordinates of the reference pixel (axe 2)">hawki_pfits_get_crval2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaaeee5723004e441f48fb8cc804370f80" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab4e70f9071230674a49cb8df1975f10" title="find out the reference pixel in axe 1">hawki_pfits_get_crpix2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga39d06faa1dcc2d3601e07e79064f9e78" title="find out the increment of coordinate in one pixel (axe 1)">hawki_pfits_get_cdelta1</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaeea4d2dba260fc663a4aa5d5a616086c" title="find out the increment of coordinate in one pixel (axe 2)">hawki_pfits_get_cdelta2</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88a2db02738f3881bad0e2bde2768951" title="find out the position angle">hawki_pfits_get_posangle</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#gae157c2c48d5b4e41ffafef1348c939d2" title="find out the NEXP value">hawki_pfits_get_nexp</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga1cd57f592c68d5e084ee049bdbe979a4" title="find out the focus position of M2">hawki_pfits_get_focus</a>(<span class="keyword">const</span> cpl_propertylist * plist) ;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(<span class="keyword">const</span> cpl_propertylist * plist);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> CPL_END_DECLS</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">#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/hawki__properties__tel_8c_source.html b/html/hawki__properties__tel_8c_source.html
index 5f4d402..d9acd4b 100644
--- a/html/hawki__properties__tel_8c_source.html
+++ b/html/hawki__properties__tel_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_properties_tel.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,813 +40,814 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_properties_tel.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_properties_tel.c,v 1.2 2008/07/08 14:23:18 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/07/08 14:23:18 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_properties_tel.h"</span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00053"></a>00053 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00070"></a>00070 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00071"></a>00071 
-<a name="l00072"></a><a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9">00072</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a>(cpl_table * telescope_prop)
-<a name="l00073"></a>00073 {
-<a name="l00074"></a>00074     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00075"></a>00075     cpl_table_new_column(telescope_prop,
-<a name="l00076"></a>00076                          HAWKI_COL_RAW_JITTER_QC_TEL_ALT,
-<a name="l00077"></a>00077                          CPL_TYPE_DOUBLE);
-<a name="l00078"></a>00078     cpl_table_new_column(telescope_prop,
-<a name="l00079"></a>00079                          HAWKI_COL_RAW_JITTER_QC_TEL_AZ,
-<a name="l00080"></a>00080                          CPL_TYPE_DOUBLE);
-<a name="l00081"></a>00081     cpl_table_new_column(telescope_prop,
-<a name="l00082"></a>00082                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM,
-<a name="l00083"></a>00083                          CPL_TYPE_DOUBLE);
-<a name="l00084"></a>00084     cpl_table_new_column(telescope_prop,
-<a name="l00085"></a>00085                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0,
-<a name="l00086"></a>00086                          CPL_TYPE_DOUBLE);
-<a name="l00087"></a>00087     cpl_table_new_column(telescope_prop,
-<a name="l00088"></a>00088                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP,
-<a name="l00089"></a>00089                          CPL_TYPE_DOUBLE);
-<a name="l00090"></a>00090     cpl_table_new_column(telescope_prop,
-<a name="l00091"></a>00091                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR,
-<a name="l00092"></a>00092                          CPL_TYPE_DOUBLE);
-<a name="l00093"></a>00093     cpl_table_new_column(telescope_prop,
-<a name="l00094"></a>00094                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP,
-<a name="l00095"></a>00095                          CPL_TYPE_DOUBLE);
-<a name="l00096"></a>00096     cpl_table_new_column(telescope_prop,
-<a name="l00097"></a>00097                          HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM,
-<a name="l00098"></a>00098                          CPL_TYPE_DOUBLE);
-<a name="l00099"></a>00099     cpl_table_new_column(telescope_prop,
-<a name="l00100"></a>00100                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START,
-<a name="l00101"></a>00101                          CPL_TYPE_DOUBLE);
-<a name="l00102"></a>00102     cpl_table_new_column(telescope_prop,
-<a name="l00103"></a>00103                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END,
-<a name="l00104"></a>00104                          CPL_TYPE_DOUBLE);
-<a name="l00105"></a>00105     cpl_table_new_column(telescope_prop,
-<a name="l00106"></a>00106                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA,
-<a name="l00107"></a>00107                          CPL_TYPE_DOUBLE);
-<a name="l00108"></a>00108     cpl_table_new_column(telescope_prop,
-<a name="l00109"></a>00109                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START,
-<a name="l00110"></a>00110                          CPL_TYPE_DOUBLE);
-<a name="l00111"></a>00111     cpl_table_new_column(telescope_prop,
-<a name="l00112"></a>00112                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END,
-<a name="l00113"></a>00113                          CPL_TYPE_DOUBLE);
-<a name="l00114"></a>00114     cpl_table_new_column(telescope_prop,
-<a name="l00115"></a>00115                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM,
-<a name="l00116"></a>00116                          CPL_TYPE_DOUBLE);
-<a name="l00117"></a>00117     cpl_table_new_column(telescope_prop,
-<a name="l00118"></a>00118                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START,
-<a name="l00119"></a>00119                          CPL_TYPE_DOUBLE);
-<a name="l00120"></a>00120     cpl_table_new_column(telescope_prop,
-<a name="l00121"></a>00121                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END,
-<a name="l00122"></a>00122                          CPL_TYPE_DOUBLE);
-<a name="l00123"></a>00123     cpl_table_new_column(telescope_prop,
-<a name="l00124"></a>00124                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM,
-<a name="l00125"></a>00125                          CPL_TYPE_DOUBLE);
-<a name="l00126"></a>00126     cpl_table_new_column(telescope_prop,
-<a name="l00127"></a>00127                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START,
-<a name="l00128"></a>00128                          CPL_TYPE_DOUBLE);
-<a name="l00129"></a>00129     cpl_table_new_column(telescope_prop,
-<a name="l00130"></a>00130                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END,
-<a name="l00131"></a>00131                          CPL_TYPE_DOUBLE);
-<a name="l00132"></a>00132     cpl_table_new_column(telescope_prop,
-<a name="l00133"></a>00133                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES,
-<a name="l00134"></a>00134                          CPL_TYPE_DOUBLE);
-<a name="l00135"></a>00135     cpl_table_new_column(telescope_prop,
-<a name="l00136"></a>00136                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START,
-<a name="l00137"></a>00137                          CPL_TYPE_DOUBLE);
-<a name="l00138"></a>00138     cpl_table_new_column(telescope_prop,
-<a name="l00139"></a>00139                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END,
-<a name="l00140"></a>00140                          CPL_TYPE_DOUBLE);
-<a name="l00141"></a>00141     cpl_table_new_column(telescope_prop,
-<a name="l00142"></a>00142                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG,
-<a name="l00143"></a>00143                          CPL_TYPE_DOUBLE);
-<a name="l00144"></a>00144     cpl_table_new_column(telescope_prop,
-<a name="l00145"></a>00145                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA,
-<a name="l00146"></a>00146                          CPL_TYPE_DOUBLE);
-<a name="l00147"></a>00147     cpl_table_new_column(telescope_prop,
-<a name="l00148"></a>00148                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA,
-<a name="l00149"></a>00149                          CPL_TYPE_DOUBLE);
-<a name="l00150"></a>00150     cpl_table_new_column(telescope_prop,
-<a name="l00151"></a>00151                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD,
-<a name="l00152"></a>00152                          CPL_TYPE_DOUBLE);
-<a name="l00153"></a>00153     cpl_table_new_column(telescope_prop,
-<a name="l00154"></a>00154                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX,
-<a name="l00155"></a>00155                          CPL_TYPE_DOUBLE);
-<a name="l00156"></a>00156     cpl_table_new_column(telescope_prop,
-<a name="l00157"></a>00157                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY,
-<a name="l00158"></a>00158                          CPL_TYPE_DOUBLE);
-<a name="l00159"></a>00159     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00160"></a>00160         <span class="keywordflow">return</span> -1;
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00186"></a>00186 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00187"></a>00187 <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a>
-<a name="l00188"></a><a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612">00188</a> (<span class="keyword">const</span> cpl_propertylist * all_property_list,
-<a name="l00189"></a>00189  cpl_table              * telescope_prop,
-<a name="l00190"></a>00190  <span class="keywordtype">int</span>                      irow)
-<a name="l00191"></a>00191 {
-<a name="l00192"></a>00192     <span class="keywordtype">int</span> ncol;
-<a name="l00193"></a>00193     <span class="keywordtype">int</span> nused;
-<a name="l00194"></a>00194     <span class="keywordtype">double</span> temp_val;
-<a name="l00195"></a>00195     <span class="keywordtype">double</span> temp_start;
-<a name="l00196"></a>00196     <span class="keywordtype">double</span> temp_end;
-<a name="l00197"></a>00197     cpl_errorstate  prestate;
-<a name="l00198"></a>00198     
-<a name="l00199"></a>00199     <span class="comment">/* Error check */</span>
-<a name="l00200"></a>00200     prestate = cpl_errorstate_get();
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202     <span class="comment">/* Checking input */</span>
-<a name="l00203"></a>00203     <span class="keywordflow">if</span>(all_property_list == NULL || telescope_prop == NULL)
-<a name="l00204"></a>00204     {
-<a name="l00205"></a>00205         cpl_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);
-<a name="l00206"></a>00206         <span class="keywordflow">return</span> -1;
-<a name="l00207"></a>00207     }
-<a name="l00208"></a>00208     
-<a name="l00209"></a>00209     <span class="comment">/* Checking columns in the table */</span>
-<a name="l00210"></a>00210     ncol = 0;
-<a name="l00211"></a>00211     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00212"></a>00212                                  HAWKI_COL_RAW_JITTER_QC_TEL_ALT);
-<a name="l00213"></a>00213     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00214"></a>00214                                  HAWKI_COL_RAW_JITTER_QC_TEL_AZ);
-<a name="l00215"></a>00215     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00216"></a>00216                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM);
-<a name="l00217"></a>00217     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00218"></a>00218                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0);
-<a name="l00219"></a>00219     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00220"></a>00220                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP);
-<a name="l00221"></a>00221     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00222"></a>00222                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR);
-<a name="l00223"></a>00223     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00224"></a>00224                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP);
-<a name="l00225"></a>00225     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00226"></a>00226                                  HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM);
-<a name="l00227"></a>00227     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00228"></a>00228                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START);
-<a name="l00229"></a>00229     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00230"></a>00230                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END);
-<a name="l00231"></a>00231     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00232"></a>00232                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA);
-<a name="l00233"></a>00233     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00234"></a>00234                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START);
-<a name="l00235"></a>00235     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00236"></a>00236                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END);
-<a name="l00237"></a>00237     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00238"></a>00238                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM);
-<a name="l00239"></a>00239     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00240"></a>00240                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START);
-<a name="l00241"></a>00241     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00242"></a>00242                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END);
-<a name="l00243"></a>00243     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00244"></a>00244                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM);
-<a name="l00245"></a>00245     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00246"></a>00246                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START);
-<a name="l00247"></a>00247     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00248"></a>00248                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END);
-<a name="l00249"></a>00249     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00250"></a>00250                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES);
-<a name="l00251"></a>00251     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00252"></a>00252                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START);
-<a name="l00253"></a>00253     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00254"></a>00254                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END);
-<a name="l00255"></a>00255     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00256"></a>00256                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG);
-<a name="l00257"></a>00257     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00258"></a>00258                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA);
-<a name="l00259"></a>00259     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00260"></a>00260                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA);
-<a name="l00261"></a>00261     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00262"></a>00262                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD);
-<a name="l00263"></a>00263     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00264"></a>00264                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX);
-<a name="l00265"></a>00265     ncol += cpl_table_has_column(telescope_prop,
-<a name="l00266"></a>00266                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY);
-<a name="l00267"></a>00267     <span class="keywordflow">if</span>(ncol != 28)
-<a name="l00268"></a>00268     {
-<a name="l00269"></a>00269         cpl_msg_error(__func__,<span class="stringliteral">"Table does not have the proper format"</span>);
-<a name="l00270"></a>00270         <span class="keywordflow">return</span> -1;
-<a name="l00271"></a>00271     }
-<a name="l00272"></a>00272        
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274     <span class="comment">/* Getting and saving the keywords */</span>
-<a name="l00275"></a>00275     cpl_table_set_double(telescope_prop,
-<a name="l00276"></a>00276                          HAWKI_COL_RAW_JITTER_QC_TEL_ALT,
-<a name="l00277"></a>00277                          irow,
-<a name="l00278"></a>00278                          <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(all_property_list));
-<a name="l00279"></a>00279     cpl_table_set_double(telescope_prop,
-<a name="l00280"></a>00280                          HAWKI_COL_RAW_JITTER_QC_TEL_AZ,
-<a name="l00281"></a>00281                          irow,
-<a name="l00282"></a>00282                          <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(all_property_list));
-<a name="l00283"></a>00283     cpl_table_set_double(telescope_prop,
-<a name="l00284"></a>00284                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM,
-<a name="l00285"></a>00285                          irow,
-<a name="l00286"></a>00286                          <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(all_property_list));
-<a name="l00287"></a>00287     cpl_table_set_double(telescope_prop,
-<a name="l00288"></a>00288                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0,
-<a name="l00289"></a>00289                          irow,
-<a name="l00290"></a>00290                          <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(all_property_list));
-<a name="l00291"></a>00291     cpl_table_set_double(telescope_prop,
-<a name="l00292"></a>00292                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP,
-<a name="l00293"></a>00293                          irow,
-<a name="l00294"></a>00294                          <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(all_property_list));
-<a name="l00295"></a>00295     cpl_table_set_double(telescope_prop,
-<a name="l00296"></a>00296                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR,
-<a name="l00297"></a>00297                          irow,
-<a name="l00298"></a>00298                          <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(all_property_list));
-<a name="l00299"></a>00299     cpl_table_set_double(telescope_prop,
-<a name="l00300"></a>00300                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP,
-<a name="l00301"></a>00301                          irow,
-<a name="l00302"></a>00302                          <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(all_property_list));
-<a name="l00303"></a>00303     cpl_table_set_double(telescope_prop,
-<a name="l00304"></a>00304                          HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM,
-<a name="l00305"></a>00305                          irow,
-<a name="l00306"></a>00306                          <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(all_property_list));
-<a name="l00307"></a>00307     cpl_table_set_double(telescope_prop,
-<a name="l00308"></a>00308                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START,
-<a name="l00309"></a>00309                          irow,
-<a name="l00310"></a>00310                          <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list));
-<a name="l00311"></a>00311     cpl_table_set_double(telescope_prop,
-<a name="l00312"></a>00312                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END,
-<a name="l00313"></a>00313                          irow,
-<a name="l00314"></a>00314                          <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list));
-<a name="l00315"></a>00315     cpl_table_set_double(telescope_prop,
-<a name="l00316"></a>00316                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START,
-<a name="l00317"></a>00317                          irow,
-<a name="l00318"></a>00318                          <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(all_property_list));
-<a name="l00319"></a>00319     cpl_table_set_double(telescope_prop,
-<a name="l00320"></a>00320                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END,
-<a name="l00321"></a>00321                          irow,
-<a name="l00322"></a>00322                          <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(all_property_list));
-<a name="l00323"></a>00323     cpl_table_set_double(telescope_prop,
-<a name="l00324"></a>00324                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START,
-<a name="l00325"></a>00325                          irow,
-<a name="l00326"></a>00326                          <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(all_property_list));
-<a name="l00327"></a>00327     cpl_table_set_double(telescope_prop,
-<a name="l00328"></a>00328                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END,
-<a name="l00329"></a>00329                          irow,
-<a name="l00330"></a>00330                          <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(all_property_list));
-<a name="l00331"></a>00331     cpl_table_set_double(telescope_prop,
-<a name="l00332"></a>00332                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START,
-<a name="l00333"></a>00333                          irow,
-<a name="l00334"></a>00334                          <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(all_property_list));
-<a name="l00335"></a>00335     cpl_table_set_double(telescope_prop,
-<a name="l00336"></a>00336                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END,
-<a name="l00337"></a>00337                          irow,
-<a name="l00338"></a>00338                          <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(all_property_list));
-<a name="l00339"></a>00339     cpl_table_set_double(telescope_prop,
-<a name="l00340"></a>00340                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START,
-<a name="l00341"></a>00341                          irow,
-<a name="l00342"></a>00342                          <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(all_property_list));
-<a name="l00343"></a>00343     cpl_table_set_double(telescope_prop,
-<a name="l00344"></a>00344                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END,
-<a name="l00345"></a>00345                          irow,
-<a name="l00346"></a>00346                          <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(all_property_list));
-<a name="l00347"></a>00347     cpl_table_set_double(telescope_prop,
-<a name="l00348"></a>00348                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA,
-<a name="l00349"></a>00349                          irow,
-<a name="l00350"></a>00350                          <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(all_property_list));
-<a name="l00351"></a>00351     cpl_table_set_double(telescope_prop,
-<a name="l00352"></a>00352                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD,
-<a name="l00353"></a>00353                          irow,
-<a name="l00354"></a>00354                          <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(all_property_list));
-<a name="l00355"></a>00355     cpl_table_set_double(telescope_prop,
-<a name="l00356"></a>00356                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX,
-<a name="l00357"></a>00357                          irow,
-<a name="l00358"></a>00358                          <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(all_property_list));
-<a name="l00359"></a>00359     cpl_table_set_double(telescope_prop,
-<a name="l00360"></a>00360                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY,
-<a name="l00361"></a>00361                          irow,
-<a name="l00362"></a>00362                          <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(all_property_list));
-<a name="l00363"></a>00363     
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365     <span class="comment">/* Compute and write derived quantities */</span>
-<a name="l00366"></a>00366     temp_val = <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list) -
-<a name="l00367"></a>00367                <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list);
-<a name="l00368"></a>00368     cpl_table_set_double(telescope_prop,
-<a name="l00369"></a>00369                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA,
-<a name="l00370"></a>00370                          irow,
-<a name="l00371"></a>00371                          temp_val);
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373     temp_val = (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(all_property_list) +
-<a name="l00374"></a>00374                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(all_property_list) ) / 2.0;
-<a name="l00375"></a>00375     cpl_table_set_double(telescope_prop,
-<a name="l00376"></a>00376                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM,
-<a name="l00377"></a>00377                          irow,
-<a name="l00378"></a>00378                          temp_val);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="comment">//The "mean" FWHM is computed rejecting one of the values if </span>
-<a name="l00381"></a>00381     <span class="comment">//is equal to -1. If both are -1, the mean  FWHM is -1.</span>
-<a name="l00382"></a>00382     temp_start = <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(all_property_list);
-<a name="l00383"></a>00383     temp_end = <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(all_property_list);
-<a name="l00384"></a>00384     temp_val = 0;
-<a name="l00385"></a>00385     nused = 0;
-<a name="l00386"></a>00386     <span class="keywordflow">if</span>(temp_start != -1)
-<a name="l00387"></a>00387     {
-<a name="l00388"></a>00388         temp_val += temp_start;
-<a name="l00389"></a>00389         nused++;
-<a name="l00390"></a>00390     }
-<a name="l00391"></a>00391     <span class="keywordflow">if</span>(temp_end != -1)
-<a name="l00392"></a>00392     {
-<a name="l00393"></a>00393         temp_val += temp_end;
-<a name="l00394"></a>00394         nused++;
-<a name="l00395"></a>00395     }
-<a name="l00396"></a>00396     <span class="keywordflow">if</span>(nused != 0)
-<a name="l00397"></a>00397         temp_val = temp_val / nused;
-<a name="l00398"></a>00398     <span class="keywordflow">else</span>
-<a name="l00399"></a>00399         temp_val = -1;
-<a name="l00400"></a>00400     cpl_table_set_double(telescope_prop,
-<a name="l00401"></a>00401                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM,
-<a name="l00402"></a>00402                          irow,
-<a name="l00403"></a>00403                          temp_val);
-<a name="l00404"></a>00404     
-<a name="l00405"></a>00405     temp_val = (<a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(all_property_list) +
-<a name="l00406"></a>00406                 <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(all_property_list) ) / 2.0;
-<a name="l00407"></a>00407     cpl_table_set_double(telescope_prop,
-<a name="l00408"></a>00408                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES,
-<a name="l00409"></a>00409                          irow,
-<a name="l00410"></a>00410                          temp_val);
-<a name="l00411"></a>00411     
-<a name="l00412"></a>00412     temp_val = (<a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(all_property_list) +
-<a name="l00413"></a>00413                 <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(all_property_list) ) / 2.0;
-<a name="l00414"></a>00414     cpl_table_set_double(telescope_prop,
-<a name="l00415"></a>00415                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG,
-<a name="l00416"></a>00416                          irow,
-<a name="l00417"></a>00417                          temp_val);
-<a name="l00418"></a>00418     
-<a name="l00419"></a>00419     temp_val = <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list) -
-<a name="l00420"></a>00420                <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list);
-<a name="l00421"></a>00421     cpl_table_set_double(telescope_prop,
-<a name="l00422"></a>00422                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA,
-<a name="l00423"></a>00423                          irow,
-<a name="l00424"></a>00424                          temp_val);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00428"></a>00428         <span class="keywordflow">return</span> -1;
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430     <span class="keywordflow">return</span> 0;
-<a name="l00431"></a>00431 }
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433 <span class="keywordtype">int</span> hawki_compute_prop_tel_qc_stats
-<a name="l00434"></a>00434 (<span class="keyword">const</span> cpl_table  * telescope_prop,
-<a name="l00435"></a>00435  cpl_propertylist * stats_prop)
-<a name="l00436"></a>00436 {
-<a name="l00437"></a>00437     cpl_errorstate  prestate = cpl_errorstate_get();
-<a name="l00438"></a>00438     <span class="comment">/* Checking input */</span>
-<a name="l00439"></a>00439     <span class="keywordflow">if</span>(telescope_prop == NULL || stats_prop == NULL)
-<a name="l00440"></a>00440     {
-<a name="l00441"></a>00441         cpl_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);
-<a name="l00442"></a>00442         <span class="keywordflow">return</span> -1;
-<a name="l00443"></a>00443     }
-<a name="l00444"></a>00444     
-<a name="l00445"></a>00445     <span class="comment">/* Compute the statistics */</span>
-<a name="l00446"></a>00446     cpl_propertylist_append_double
-<a name="l00447"></a>00447       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MEAN"</span>,cpl_table_get_column_mean
-<a name="l00448"></a>00448               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));
-<a name="l00449"></a>00449     cpl_propertylist_append_double
-<a name="l00450"></a>00450       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MED"</span>,cpl_table_get_column_median
-<a name="l00451"></a>00451               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));
-<a name="l00452"></a>00452     cpl_propertylist_append_double
-<a name="l00453"></a>00453       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MIN"</span>,cpl_table_get_column_min
-<a name="l00454"></a>00454               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));
-<a name="l00455"></a>00455     cpl_propertylist_append_double
-<a name="l00456"></a>00456       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MAX"</span>,cpl_table_get_column_max
-<a name="l00457"></a>00457               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));
-<a name="l00458"></a>00458     cpl_propertylist_append_double
-<a name="l00459"></a>00459       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00460"></a>00460               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     cpl_propertylist_append_double
-<a name="l00463"></a>00463       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MEAN"</span>,cpl_table_get_column_mean
-<a name="l00464"></a>00464               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));
-<a name="l00465"></a>00465     cpl_propertylist_append_double
-<a name="l00466"></a>00466       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MED"</span>,cpl_table_get_column_median
-<a name="l00467"></a>00467               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));
-<a name="l00468"></a>00468     cpl_propertylist_append_double
-<a name="l00469"></a>00469       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MIN"</span>,cpl_table_get_column_min
-<a name="l00470"></a>00470               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));
-<a name="l00471"></a>00471     cpl_propertylist_append_double
-<a name="l00472"></a>00472       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MAX"</span>,cpl_table_get_column_max
-<a name="l00473"></a>00473               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));
-<a name="l00474"></a>00474     cpl_propertylist_append_double
-<a name="l00475"></a>00475       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00476"></a>00476               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478     cpl_propertylist_append_double
-<a name="l00479"></a>00479       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MEAN"</span>,cpl_table_get_column_mean
-<a name="l00480"></a>00480               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));
-<a name="l00481"></a>00481     cpl_propertylist_append_double
-<a name="l00482"></a>00482       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MED"</span>,cpl_table_get_column_median
-<a name="l00483"></a>00483               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));
-<a name="l00484"></a>00484     cpl_propertylist_append_double
-<a name="l00485"></a>00485       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MIN"</span>,cpl_table_get_column_min
-<a name="l00486"></a>00486               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));
-<a name="l00487"></a>00487     cpl_propertylist_append_double
-<a name="l00488"></a>00488       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MAX"</span>,cpl_table_get_column_max
-<a name="l00489"></a>00489               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));
-<a name="l00490"></a>00490     cpl_propertylist_append_double
-<a name="l00491"></a>00491       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00492"></a>00492               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     cpl_propertylist_append_double
-<a name="l00495"></a>00495       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MEAN"</span>,cpl_table_get_column_mean
-<a name="l00496"></a>00496               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));
-<a name="l00497"></a>00497     cpl_propertylist_append_double
-<a name="l00498"></a>00498       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MED"</span>,cpl_table_get_column_median
-<a name="l00499"></a>00499               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));
-<a name="l00500"></a>00500     cpl_propertylist_append_double
-<a name="l00501"></a>00501       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MIN"</span>,cpl_table_get_column_min
-<a name="l00502"></a>00502               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));
-<a name="l00503"></a>00503     cpl_propertylist_append_double
-<a name="l00504"></a>00504       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MAX"</span>,cpl_table_get_column_max
-<a name="l00505"></a>00505               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));
-<a name="l00506"></a>00506     cpl_propertylist_append_double
-<a name="l00507"></a>00507       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00508"></a>00508               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     cpl_propertylist_append_double
-<a name="l00511"></a>00511       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MEAN"</span>,cpl_table_get_column_mean
-<a name="l00512"></a>00512               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));
-<a name="l00513"></a>00513     cpl_propertylist_append_double
-<a name="l00514"></a>00514       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MED"</span>,cpl_table_get_column_median
-<a name="l00515"></a>00515               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));
-<a name="l00516"></a>00516     cpl_propertylist_append_double
-<a name="l00517"></a>00517       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MIN"</span>,cpl_table_get_column_min
-<a name="l00518"></a>00518               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));
-<a name="l00519"></a>00519     cpl_propertylist_append_double
-<a name="l00520"></a>00520       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MAX"</span>,cpl_table_get_column_max
-<a name="l00521"></a>00521               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));
-<a name="l00522"></a>00522     cpl_propertylist_append_double
-<a name="l00523"></a>00523       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00524"></a>00524               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     cpl_propertylist_append_double
-<a name="l00527"></a>00527       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MEAN"</span>,cpl_table_get_column_mean
-<a name="l00528"></a>00528               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));
-<a name="l00529"></a>00529     cpl_propertylist_append_double
-<a name="l00530"></a>00530       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MED"</span>,cpl_table_get_column_median
-<a name="l00531"></a>00531               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));
-<a name="l00532"></a>00532     cpl_propertylist_append_double
-<a name="l00533"></a>00533       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MIN"</span>,cpl_table_get_column_min
-<a name="l00534"></a>00534               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));
-<a name="l00535"></a>00535     cpl_propertylist_append_double
-<a name="l00536"></a>00536       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MAX"</span>,cpl_table_get_column_max
-<a name="l00537"></a>00537               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));
-<a name="l00538"></a>00538     cpl_propertylist_append_double
-<a name="l00539"></a>00539       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00540"></a>00540               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     cpl_propertylist_append_double
-<a name="l00543"></a>00543       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MEAN"</span>,cpl_table_get_column_mean
-<a name="l00544"></a>00544               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));
-<a name="l00545"></a>00545     cpl_propertylist_append_double
-<a name="l00546"></a>00546       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MED"</span>,cpl_table_get_column_median
-<a name="l00547"></a>00547               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));
-<a name="l00548"></a>00548     cpl_propertylist_append_double
-<a name="l00549"></a>00549       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MIN"</span>,cpl_table_get_column_min
-<a name="l00550"></a>00550               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));
-<a name="l00551"></a>00551     cpl_propertylist_append_double
-<a name="l00552"></a>00552       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MAX"</span>,cpl_table_get_column_max
-<a name="l00553"></a>00553               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));
-<a name="l00554"></a>00554     cpl_propertylist_append_double
-<a name="l00555"></a>00555       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00556"></a>00556               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558     cpl_propertylist_append_double
-<a name="l00559"></a>00559       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MEAN"</span>,cpl_table_get_column_mean
-<a name="l00560"></a>00560               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));
-<a name="l00561"></a>00561     cpl_propertylist_append_double
-<a name="l00562"></a>00562       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MED"</span>,cpl_table_get_column_median
-<a name="l00563"></a>00563               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));
-<a name="l00564"></a>00564     cpl_propertylist_append_double
-<a name="l00565"></a>00565       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MIN"</span>,cpl_table_get_column_min
-<a name="l00566"></a>00566               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));
-<a name="l00567"></a>00567     cpl_propertylist_append_double
-<a name="l00568"></a>00568       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MAX"</span>,cpl_table_get_column_max
-<a name="l00569"></a>00569               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));
-<a name="l00570"></a>00570     cpl_propertylist_append_double
-<a name="l00571"></a>00571       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00572"></a>00572               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     cpl_propertylist_append_double
-<a name="l00575"></a>00575       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MEAN"</span>,cpl_table_get_column_mean
-<a name="l00576"></a>00576               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));
-<a name="l00577"></a>00577     cpl_propertylist_append_double
-<a name="l00578"></a>00578       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MED"</span>,cpl_table_get_column_median
-<a name="l00579"></a>00579               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));
-<a name="l00580"></a>00580     cpl_propertylist_append_double
-<a name="l00581"></a>00581       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MIN"</span>,cpl_table_get_column_min
-<a name="l00582"></a>00582               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));
-<a name="l00583"></a>00583     cpl_propertylist_append_double
-<a name="l00584"></a>00584       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MAX"</span>,cpl_table_get_column_max
-<a name="l00585"></a>00585               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));
-<a name="l00586"></a>00586     cpl_propertylist_append_double
-<a name="l00587"></a>00587       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00588"></a>00588               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     cpl_propertylist_append_double
-<a name="l00591"></a>00591       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MEAN"</span>,cpl_table_get_column_mean
-<a name="l00592"></a>00592               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));
-<a name="l00593"></a>00593     cpl_propertylist_append_double
-<a name="l00594"></a>00594       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MED"</span>,cpl_table_get_column_median
-<a name="l00595"></a>00595               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));
-<a name="l00596"></a>00596     cpl_propertylist_append_double
-<a name="l00597"></a>00597       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MIN"</span>,cpl_table_get_column_min
-<a name="l00598"></a>00598               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));
-<a name="l00599"></a>00599     cpl_propertylist_append_double
-<a name="l00600"></a>00600       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MAX"</span>,cpl_table_get_column_max
-<a name="l00601"></a>00601               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));
-<a name="l00602"></a>00602     cpl_propertylist_append_double
-<a name="l00603"></a>00603       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00604"></a>00604               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606     cpl_propertylist_append_double
-<a name="l00607"></a>00607       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MEAN"</span>,cpl_table_get_column_mean
-<a name="l00608"></a>00608               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));
-<a name="l00609"></a>00609     cpl_propertylist_append_double
-<a name="l00610"></a>00610       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MED"</span>,cpl_table_get_column_median
-<a name="l00611"></a>00611               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));
-<a name="l00612"></a>00612     cpl_propertylist_append_double
-<a name="l00613"></a>00613       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MIN"</span>,cpl_table_get_column_min
-<a name="l00614"></a>00614               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));
-<a name="l00615"></a>00615     cpl_propertylist_append_double
-<a name="l00616"></a>00616       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MAX"</span>,cpl_table_get_column_max
-<a name="l00617"></a>00617               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));
-<a name="l00618"></a>00618     cpl_propertylist_append_double
-<a name="l00619"></a>00619       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00620"></a>00620               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));
-<a name="l00621"></a>00621 
-<a name="l00622"></a>00622     cpl_propertylist_append_double
-<a name="l00623"></a>00623       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MEAN"</span>,cpl_table_get_column_mean
-<a name="l00624"></a>00624               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));
-<a name="l00625"></a>00625     cpl_propertylist_append_double
-<a name="l00626"></a>00626       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MED"</span>,cpl_table_get_column_median
-<a name="l00627"></a>00627               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));
-<a name="l00628"></a>00628     cpl_propertylist_append_double
-<a name="l00629"></a>00629       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MIN"</span>,cpl_table_get_column_min
-<a name="l00630"></a>00630               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));
-<a name="l00631"></a>00631     cpl_propertylist_append_double
-<a name="l00632"></a>00632       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MAX"</span>,cpl_table_get_column_max
-<a name="l00633"></a>00633               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));
-<a name="l00634"></a>00634     cpl_propertylist_append_double
-<a name="l00635"></a>00635       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00636"></a>00636               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638     cpl_propertylist_append_double
-<a name="l00639"></a>00639       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MEAN"</span>,cpl_table_get_column_mean
-<a name="l00640"></a>00640               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));
-<a name="l00641"></a>00641     cpl_propertylist_append_double
-<a name="l00642"></a>00642       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MED"</span>,cpl_table_get_column_median
-<a name="l00643"></a>00643               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));
-<a name="l00644"></a>00644     cpl_propertylist_append_double
-<a name="l00645"></a>00645       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MIN"</span>,cpl_table_get_column_min
-<a name="l00646"></a>00646               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));
-<a name="l00647"></a>00647     cpl_propertylist_append_double
-<a name="l00648"></a>00648       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MAX"</span>,cpl_table_get_column_max
-<a name="l00649"></a>00649               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));
-<a name="l00650"></a>00650     cpl_propertylist_append_double
-<a name="l00651"></a>00651       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00652"></a>00652               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     cpl_propertylist_append_double
-<a name="l00655"></a>00655       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MEAN"</span>,cpl_table_get_column_mean
-<a name="l00656"></a>00656               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));
-<a name="l00657"></a>00657     cpl_propertylist_append_double
-<a name="l00658"></a>00658       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MED"</span>,cpl_table_get_column_median
-<a name="l00659"></a>00659               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));
-<a name="l00660"></a>00660     cpl_propertylist_append_double
-<a name="l00661"></a>00661       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MIN"</span>,cpl_table_get_column_min
-<a name="l00662"></a>00662               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));
-<a name="l00663"></a>00663     cpl_propertylist_append_double
-<a name="l00664"></a>00664       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MAX"</span>,cpl_table_get_column_max
-<a name="l00665"></a>00665               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));
-<a name="l00666"></a>00666     cpl_propertylist_append_double
-<a name="l00667"></a>00667       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00668"></a>00668               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));
-<a name="l00669"></a>00669 
-<a name="l00670"></a>00670     cpl_propertylist_append_double
-<a name="l00671"></a>00671       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MEAN"</span>,cpl_table_get_column_mean
-<a name="l00672"></a>00672               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));
-<a name="l00673"></a>00673     cpl_propertylist_append_double
-<a name="l00674"></a>00674       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MED"</span>,cpl_table_get_column_median
-<a name="l00675"></a>00675               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));
-<a name="l00676"></a>00676     cpl_propertylist_append_double
-<a name="l00677"></a>00677       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MIN"</span>,cpl_table_get_column_min
-<a name="l00678"></a>00678               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));
-<a name="l00679"></a>00679     cpl_propertylist_append_double
-<a name="l00680"></a>00680       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MAX"</span>,cpl_table_get_column_max
-<a name="l00681"></a>00681               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));
-<a name="l00682"></a>00682     cpl_propertylist_append_double
-<a name="l00683"></a>00683       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00684"></a>00684               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     cpl_propertylist_append_double
-<a name="l00687"></a>00687       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MEAN"</span>,cpl_table_get_column_mean
-<a name="l00688"></a>00688               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));
-<a name="l00689"></a>00689     cpl_propertylist_append_double
-<a name="l00690"></a>00690       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MED"</span>,cpl_table_get_column_median
-<a name="l00691"></a>00691               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));
-<a name="l00692"></a>00692     cpl_propertylist_append_double
-<a name="l00693"></a>00693       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MIN"</span>,cpl_table_get_column_min
-<a name="l00694"></a>00694               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));
-<a name="l00695"></a>00695     cpl_propertylist_append_double
-<a name="l00696"></a>00696       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MAX"</span>,cpl_table_get_column_max
-<a name="l00697"></a>00697               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));
-<a name="l00698"></a>00698     cpl_propertylist_append_double
-<a name="l00699"></a>00699       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00700"></a>00700               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     cpl_propertylist_append_double
-<a name="l00703"></a>00703       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MEAN"</span>,cpl_table_get_column_mean
-<a name="l00704"></a>00704               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));
-<a name="l00705"></a>00705     cpl_propertylist_append_double
-<a name="l00706"></a>00706       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MED"</span>,cpl_table_get_column_median
-<a name="l00707"></a>00707               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));
-<a name="l00708"></a>00708     cpl_propertylist_append_double
-<a name="l00709"></a>00709       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MIN"</span>,cpl_table_get_column_min
-<a name="l00710"></a>00710               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));
-<a name="l00711"></a>00711     cpl_propertylist_append_double
-<a name="l00712"></a>00712       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MAX"</span>,cpl_table_get_column_max
-<a name="l00713"></a>00713               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));
-<a name="l00714"></a>00714     cpl_propertylist_append_double
-<a name="l00715"></a>00715       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00716"></a>00716               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));
-<a name="l00717"></a>00717 
-<a name="l00718"></a>00718     cpl_propertylist_append_double
-<a name="l00719"></a>00719       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MEAN"</span>,cpl_table_get_column_mean
-<a name="l00720"></a>00720               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));
-<a name="l00721"></a>00721     cpl_propertylist_append_double
-<a name="l00722"></a>00722       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MED"</span>,cpl_table_get_column_median
-<a name="l00723"></a>00723               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));
-<a name="l00724"></a>00724     cpl_propertylist_append_double
-<a name="l00725"></a>00725       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MIN"</span>,cpl_table_get_column_min
-<a name="l00726"></a>00726               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));
-<a name="l00727"></a>00727     cpl_propertylist_append_double
-<a name="l00728"></a>00728       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MAX"</span>,cpl_table_get_column_max
-<a name="l00729"></a>00729               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));
-<a name="l00730"></a>00730     cpl_propertylist_append_double
-<a name="l00731"></a>00731       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00732"></a>00732               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734     cpl_propertylist_append_double
-<a name="l00735"></a>00735       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MEAN"</span>,cpl_table_get_column_mean
-<a name="l00736"></a>00736               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));
-<a name="l00737"></a>00737     cpl_propertylist_append_double
-<a name="l00738"></a>00738       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MED"</span>,cpl_table_get_column_median
-<a name="l00739"></a>00739               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));
-<a name="l00740"></a>00740     cpl_propertylist_append_double
-<a name="l00741"></a>00741       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MIN"</span>,cpl_table_get_column_min
-<a name="l00742"></a>00742               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));
-<a name="l00743"></a>00743     cpl_propertylist_append_double
-<a name="l00744"></a>00744       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MAX"</span>,cpl_table_get_column_max
-<a name="l00745"></a>00745               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));
-<a name="l00746"></a>00746     cpl_propertylist_append_double
-<a name="l00747"></a>00747       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00748"></a>00748               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     cpl_propertylist_append_double
-<a name="l00751"></a>00751       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MEAN"</span>,cpl_table_get_column_mean
-<a name="l00752"></a>00752               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));
-<a name="l00753"></a>00753     cpl_propertylist_append_double
-<a name="l00754"></a>00754       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MED"</span>,cpl_table_get_column_median
-<a name="l00755"></a>00755               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));
-<a name="l00756"></a>00756     cpl_propertylist_append_double
-<a name="l00757"></a>00757       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MIN"</span>,cpl_table_get_column_min
-<a name="l00758"></a>00758               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));
-<a name="l00759"></a>00759     cpl_propertylist_append_double
-<a name="l00760"></a>00760       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MAX"</span>,cpl_table_get_column_max
-<a name="l00761"></a>00761               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));
-<a name="l00762"></a>00762     cpl_propertylist_append_double
-<a name="l00763"></a>00763       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00764"></a>00764               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     cpl_propertylist_append_double
-<a name="l00767"></a>00767       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MEAN"</span>,cpl_table_get_column_mean
-<a name="l00768"></a>00768               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));
-<a name="l00769"></a>00769     cpl_propertylist_append_double
-<a name="l00770"></a>00770       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MED"</span>,cpl_table_get_column_median
-<a name="l00771"></a>00771               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));
-<a name="l00772"></a>00772     cpl_propertylist_append_double
-<a name="l00773"></a>00773       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MIN"</span>,cpl_table_get_column_min
-<a name="l00774"></a>00774               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));
-<a name="l00775"></a>00775     cpl_propertylist_append_double
-<a name="l00776"></a>00776       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MAX"</span>,cpl_table_get_column_max
-<a name="l00777"></a>00777               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));
-<a name="l00778"></a>00778     cpl_propertylist_append_double
-<a name="l00779"></a>00779       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00780"></a>00780               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782     cpl_propertylist_append_double
-<a name="l00783"></a>00783       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MEAN"</span>,cpl_table_get_column_mean
-<a name="l00784"></a>00784               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));
-<a name="l00785"></a>00785     cpl_propertylist_append_double
-<a name="l00786"></a>00786       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MED"</span>,cpl_table_get_column_median
-<a name="l00787"></a>00787               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));
-<a name="l00788"></a>00788     cpl_propertylist_append_double
-<a name="l00789"></a>00789       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MIN"</span>,cpl_table_get_column_min
-<a name="l00790"></a>00790               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));
-<a name="l00791"></a>00791     cpl_propertylist_append_double
-<a name="l00792"></a>00792       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MAX"</span>,cpl_table_get_column_max
-<a name="l00793"></a>00793               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));
-<a name="l00794"></a>00794     cpl_propertylist_append_double
-<a name="l00795"></a>00795       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00796"></a>00796               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798     cpl_propertylist_append_double
-<a name="l00799"></a>00799       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MEAN"</span>,cpl_table_get_column_mean
-<a name="l00800"></a>00800               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));
-<a name="l00801"></a>00801     cpl_propertylist_append_double
-<a name="l00802"></a>00802       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MED"</span>,cpl_table_get_column_median
-<a name="l00803"></a>00803               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));
-<a name="l00804"></a>00804     cpl_propertylist_append_double
-<a name="l00805"></a>00805       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MIN"</span>,cpl_table_get_column_min
-<a name="l00806"></a>00806               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));
-<a name="l00807"></a>00807     cpl_propertylist_append_double
-<a name="l00808"></a>00808       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MAX"</span>,cpl_table_get_column_max
-<a name="l00809"></a>00809               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));
-<a name="l00810"></a>00810     cpl_propertylist_append_double
-<a name="l00811"></a>00811       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00812"></a>00812               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814     cpl_propertylist_append_double
-<a name="l00815"></a>00815       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MEAN"</span>,cpl_table_get_column_mean
-<a name="l00816"></a>00816               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));
-<a name="l00817"></a>00817     cpl_propertylist_append_double
-<a name="l00818"></a>00818       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MED"</span>,cpl_table_get_column_median
-<a name="l00819"></a>00819               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));
-<a name="l00820"></a>00820     cpl_propertylist_append_double
-<a name="l00821"></a>00821       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MIN"</span>,cpl_table_get_column_min
-<a name="l00822"></a>00822               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));
-<a name="l00823"></a>00823     cpl_propertylist_append_double
-<a name="l00824"></a>00824       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MAX"</span>,cpl_table_get_column_max
-<a name="l00825"></a>00825               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));
-<a name="l00826"></a>00826     cpl_propertylist_append_double
-<a name="l00827"></a>00827       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA STDEV"</span>,cpl_table_get_column_stdev
-<a name="l00828"></a>00828               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));
-<a name="l00829"></a>00829 
-<a name="l00830"></a>00830     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))
-<a name="l00831"></a>00831         <span class="keywordflow">return</span> -1;
-<a name="l00832"></a>00832     <span class="keywordflow">return</span> 0;
-<a name="l00833"></a>00833 }
-<a name="l00834"></a>00834 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_properties_tel.c,v 1.2 2008/07/08 14:23:18 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008/07/08 14:23:18 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_properties_tel.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">/*----------------------------------------------------------------------------*/</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="l00053"></a><span class="lineno">   53</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9">   72</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a>(cpl_table * telescope_prop)</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_errorstate  prestate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_ALT,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AZ,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END,</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>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES,</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX,</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_table_new_column(telescope_prop,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                          CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(prestate))</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>     <span class="keywordflow">return</span> 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="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="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a></div>
+<div class="line"><a name="l00188"></a><span class="lineno"><a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612">  188</a></span> (<span class="keyword">const</span> cpl_propertylist * all_property_list,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>  cpl_table              * telescope_prop,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>  <span class="keywordtype">int</span>                      irow)</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> ncol;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordtype">int</span> nused;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordtype">double</span> temp_val;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordtype">double</span> temp_start;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordtype">double</span> temp_end;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_errorstate  prestate;</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">/* Error check */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     prestate = cpl_errorstate_get();</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">/* Checking input */</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordflow">if</span>(all_property_list == NULL || telescope_prop == NULL)</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_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Checking columns in the table */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     ncol = 0;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_ALT);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AZ);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                  HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AIRM);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                  HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     ncol += cpl_table_has_column(telescope_prop,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                                  HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keywordflow">if</span>(ncol != 28)</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_msg_error(__func__,<span class="stringliteral">"Table does not have the proper format"</span>);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Getting and saving the keywords */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_ALT,</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                          irow,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                          <a class="code" href="group__hawki__pfits.html#ga965d40d225307d5a40d697a0a532f246" title="find out the telescope altitude">hawki_pfits_get_elevation</a>(all_property_list));</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AZ,</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                          irow,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                          <a class="code" href="group__hawki__pfits.html#gaf18030b75b198e924f296cdd13356b58" title="find out the telescope azimut">hawki_pfits_get_azimut</a>(all_property_list));</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                          irow,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                          <a class="code" href="group__hawki__pfits.html#gafc9299ed697db3ecfd1bb4c7e548cf3b" title="find out the relative humidity">hawki_pfits_get_relhum</a>(all_property_list));</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                          irow,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                          <a class="code" href="group__hawki__pfits.html#gaab1203aaa32935d1e81db6bb0aeec96b" title="find out the average coherence time">hawki_pfits_get_tau0</a>(all_property_list));</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                          irow,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                          <a class="code" href="group__hawki__pfits.html#gae4c54267b67c5efdcf93afb99ecaeb3b" title="find out the ambient temperatur">hawki_pfits_get_obs_temp</a>(all_property_list));</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                          irow,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                          <a class="code" href="group__hawki__pfits.html#ga7bd674c51f4cd62ce34c208888cea125" title="find out the wind direction">hawki_pfits_get_wind_dir</a>(all_property_list));</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                          irow,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                          <a class="code" href="group__hawki__pfits.html#ga45e0b30ba22df26f4d061dee26735708" title="find out the wind speed">hawki_pfits_get_wind_speed</a>(all_property_list));</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                          irow,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                          <a class="code" href="group__hawki__pfits.html#gac9b88815381f3f61c10dc88730d77121" title="find out the fwhm from the AO system">hawki_pfits_get_ao_fwhm</a>(all_property_list));</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START,</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                          irow,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                          <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list));</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                          irow,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                          <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list));</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                          irow,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                          <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(all_property_list));</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                          irow,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                          <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(all_property_list));</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                          irow,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                          <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(all_property_list));</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                          irow,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                          <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(all_property_list));</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START,</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                          irow,</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>                          <a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(all_property_list));</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                          irow,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                          <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(all_property_list));</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START,</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                          irow,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                          <a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(all_property_list));</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END,</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                          irow,</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                          <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(all_property_list));</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETA,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                          irow,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                          <a class="code" href="group__hawki__pfits.html#ga62ff6ef5b06d163b64e8eff779e5fb53" title="find out the cumulative offset in alpha">hawki_pfits_get_cumoffseta</a>(all_property_list));</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETD,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                          irow,</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                          <a class="code" href="group__hawki__pfits.html#ga0f4a0efe2116535b882eddeeb272042d" title="find out the cumulative offset in delta">hawki_pfits_get_cumoffsetd</a>(all_property_list));</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETX,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                          irow,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                          <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(all_property_list));</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                          HAWKI_COL_RAW_JITTER_QC_SEQ_CUMOFFSETY,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                          irow,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                          <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(all_property_list));</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> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="comment">/* Compute and write derived quantities */</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     temp_val = <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list) -</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                          HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                          irow,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                          temp_val);</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>     temp_val = (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(all_property_list) +</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(all_property_list) ) / 2.0;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AIRM,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                          irow,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                          temp_val);</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="comment">//The "mean" FWHM is computed rejecting one of the values if </span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="comment">//is equal to -1. If both are -1, the mean  FWHM is -1.</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     temp_start = <a class="code" href="group__hawki__pfits.html#gae005518fe79a76ee9b1cea2c3403a259" title="find out the observatory seeing at start">hawki_pfits_get_obs_seeing_start</a>(all_property_list);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     temp_end = <a class="code" href="group__hawki__pfits.html#gaa400a879086340c841865fc6c2a1cc21" title="find out the observatory seeing at end">hawki_pfits_get_obs_seeing_end</a>(all_property_list);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     temp_val = 0;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     nused = 0;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">if</span>(temp_start != -1)</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>         temp_val += temp_start;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         nused++;</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>(temp_end != -1)</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>         temp_val += temp_end;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         nused++;</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>(nused != 0)</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         temp_val = temp_val / nused;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         temp_val = -1;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM,</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                          irow,</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                          temp_val);</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>     temp_val = (<a class="code" href="group__hawki__pfits.html#ga87d6ba1cd310181f2eab02fc4688bad4" title="find out the observatory atmospheric pressure at start">hawki_pfits_get_pressure_start</a>(all_property_list) +</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                 <a class="code" href="group__hawki__pfits.html#ga11eecff7f4c8031ff6ea929e15c20813" title="find out the observatory atmospheric pressure at end">hawki_pfits_get_pressure_end</a>(all_property_list) ) / 2.0;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                          irow,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                          temp_val);</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>     temp_val = (<a class="code" href="group__hawki__pfits.html#ga2dc1b31621ecbeec49d3e390ad601274" title="find out the paralactic angle at start">hawki_pfits_get_parangle_start</a>(all_property_list) +</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                 <a class="code" href="group__hawki__pfits.html#ga3465a5cbb9e21e8cbd7680affc75355b" title="find out the paralactic angle at start">hawki_pfits_get_parangle_end</a>(all_property_list) ) / 2.0;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                          irow,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                          temp_val);</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>     temp_val = <a class="code" href="group__hawki__pfits.html#gac8b9879cdc3c2e82f3b169eef3355ef2" title="find out the absolute rotator position at end">hawki_pfits_get_rotator_end</a>(all_property_list) -</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                <a class="code" href="group__hawki__pfits.html#gaa91a5e47c4661209f97f4399cbceb9d2" title="find out the absolute rotator position at start">hawki_pfits_get_rotator_start</a>(all_property_list);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_table_set_double(telescope_prop,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                          HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                          irow,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                          temp_val);</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">if</span>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">return</span> -1;</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">return</span> 0;</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="keywordtype">int</span> hawki_compute_prop_tel_qc_stats</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> (<span class="keyword">const</span> cpl_table  * telescope_prop,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>  cpl_propertylist * stats_prop)</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_errorstate  prestate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="comment">/* Checking input */</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordflow">if</span>(telescope_prop == NULL || stats_prop == 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>         cpl_msg_error(__func__, <span class="stringliteral">"The property list or the tel table is null"</span>);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Compute the statistics */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL ALT STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_ALT));</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_propertylist_append_double</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AZ STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AZ));</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_propertylist_append_double</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI RHUM STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_RHUM));</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_propertylist_append_double</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TAU0 STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TAU0));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI TEMP STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_TEMP));</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_propertylist_append_double</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDDIR STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDDIR));</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_propertylist_append_double</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI WINDSP STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_WINDSP));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL IA FWHM STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_IA_FWHM));</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_propertylist_append_double</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT DELTA STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_DELTA));</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_append_double</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT START STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_START));</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_propertylist_append_double</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>       (stats_prop, <span class="stringliteral">"ESO QC ADA ABSROT END STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_ADA_ABSROT_END));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM));</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_append_double</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM START STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_START));</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_propertylist_append_double</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AIRM END STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AIRM_END));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM));</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_propertylist_append_double</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM START STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_START));</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_propertylist_append_double</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI FWHM END STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_FWHM_END));</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_propertylist_append_double</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES START STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_START));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL AMBI PRES END STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_AMBI_PRES_END));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG));</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_propertylist_append_double</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG START STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_START));</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>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG END STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_END));</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_propertylist_append_double</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MEAN"</span>,cpl_table_get_column_mean</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MED"</span>,cpl_table_get_column_median</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MIN"</span>,cpl_table_get_column_min</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA MAX"</span>,cpl_table_get_column_max</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>     cpl_propertylist_append_double</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>       (stats_prop, <span class="stringliteral">"ESO QC TEL PARANG DELTA STDEV"</span>,cpl_table_get_column_stdev</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>               (telescope_prop, HAWKI_COL_RAW_JITTER_QC_TEL_PARANG_DELTA));</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>(!cpl_errorstate_is_equal(prestate))</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     <span class="keywordflow">return</span> 0;</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> </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/hawki__properties__tel_8h_source.html b/html/hawki__properties__tel_8h_source.html
index bc6d1ce..47e571f 100644
--- a/html/hawki__properties__tel_8h_source.html
+++ b/html/hawki__properties__tel_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_properties_tel.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,69 +40,70 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_properties_tel.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_properties_tel.h,v 1.1 2008/06/25 13:04:25 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/06/25 13:04:25 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_PROPERTIES_TEL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROPERTIES_TEL_H</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 
-<a name="l00038"></a>00038 <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a>
-<a name="l00039"></a>00039 (cpl_table * telescope_prop);
-<a name="l00040"></a>00040 <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a>
-<a name="l00041"></a>00041 (<span class="keyword">const</span> cpl_propertylist * all_property_list,
-<a name="l00042"></a>00042  cpl_table              * telescope_prop,
-<a name="l00043"></a>00043  <span class="keywordtype">int</span>                      irow);
-<a name="l00044"></a>00044 <span class="keywordtype">int</span> hawki_compute_prop_tel_qc_stats
-<a name="l00045"></a>00045 (<span class="keyword">const</span> cpl_table  * telescope_prop,
-<a name="l00046"></a>00046  cpl_propertylist * stats_prop);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_properties_tel.h,v 1.1 2008/06/25 13:04: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008/06/25 13:04:25 $</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: hawki-1_8_12 $</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 HAWKI_PROPERTIES_TEL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PROPERTIES_TEL_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="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> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> (cpl_table * telescope_prop);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> (<span class="keyword">const</span> cpl_propertylist * all_property_list,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>  cpl_table              * telescope_prop,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  <span class="keywordtype">int</span>                      irow);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keywordtype">int</span> hawki_compute_prop_tel_qc_stats</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> (<span class="keyword">const</span> cpl_table  * telescope_prop,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>  cpl_propertylist * stats_prop);</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">#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/hawki__saa_8c_source.html b/html/hawki__saa_8c_source.html
index 064c0a1..54cc3bc 100644
--- a/html/hawki__saa_8c_source.html
+++ b/html/hawki__saa_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_saa.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,140 +40,141 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_saa.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_saa.c,v 1.10 2010/03/08 16:20: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/03/08 16:20:54 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.10 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_saa.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00053"></a>00053 <span class="keywordtype">int</span> hawki_geom_refine_images_offsets
-<a name="l00054"></a>00054 (cpl_imagelist  *  in,
-<a name="l00055"></a>00055  cpl_bivector   *  approx_offsets,
-<a name="l00056"></a>00056  cpl_bivector   *  reference_objects,
-<a name="l00057"></a>00057  <span class="keywordtype">int</span>               s_hx,
-<a name="l00058"></a>00058  <span class="keywordtype">int</span>               s_hy,
-<a name="l00059"></a>00059  <span class="keywordtype">int</span>               m_hx,
-<a name="l00060"></a>00060  <span class="keywordtype">int</span>               m_hy,
-<a name="l00061"></a>00061  cpl_bivector   *  refined_offsets,
-<a name="l00062"></a>00062  cpl_vector     *  correl)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_bivector        *   offs_ref ;
-<a name="l00065"></a>00065     <span class="keywordtype">double</span>              *   offs_ref_x ;
-<a name="l00066"></a>00066     <span class="keywordtype">double</span>              *   offs_ref_y ;
-<a name="l00067"></a>00067     <span class="keywordtype">double</span>              *   correl_data ;
-<a name="l00068"></a>00068     <span class="keywordtype">int</span>                     nimages;
-<a name="l00069"></a>00069     <span class="keywordtype">int</span>                     ngood;
-<a name="l00070"></a>00070     <span class="keywordtype">int</span>                     i;
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072     <span class="comment">/* Check entries */</span>
-<a name="l00073"></a>00073     <span class="keywordflow">if</span> (approx_offsets  == NULL) <span class="keywordflow">return</span> -1;
-<a name="l00074"></a>00074     <span class="keywordflow">if</span> (refined_offsets == NULL) <span class="keywordflow">return</span> -1;
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     <span class="comment">/* Get the number of images */</span>
-<a name="l00077"></a>00077     nimages = cpl_imagelist_get_size(in) ;
-<a name="l00078"></a>00078     <span class="keywordflow">if</span> (cpl_bivector_get_size(approx_offsets) != nimages) 
-<a name="l00079"></a>00079     {
-<a name="l00080"></a>00080         cpl_msg_error(__func__, <span class="stringliteral">"Invalid input objects sizes"</span>) ; 
-<a name="l00081"></a>00081         <span class="keywordflow">return</span> -1;
-<a name="l00082"></a>00082     }
-<a name="l00083"></a>00083     
-<a name="l00084"></a>00084     <span class="comment">/* Refine the offsets */</span>
-<a name="l00085"></a>00085     cpl_msg_info(__func__, <span class="stringliteral">"Refine the offsets"</span>) ;
-<a name="l00086"></a>00086     cpl_msg_indent_more() ;
-<a name="l00087"></a>00087     <span class="keywordflow">if</span> ((offs_ref = cpl_geom_img_offset_fine
-<a name="l00088"></a>00088             (in, approx_offsets, reference_objects,
-<a name="l00089"></a>00089              s_hx, s_hy, m_hx, m_hy, correl)) == NULL)
-<a name="l00090"></a>00090     {
-<a name="l00091"></a>00091         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot refine the offsets"</span>);
-<a name="l00092"></a>00092         cpl_vector_delete(correl) ;
-<a name="l00093"></a>00093         <span class="keywordflow">return</span> -1;
-<a name="l00094"></a>00094     }
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096     <span class="comment">/* Display the results */</span>
-<a name="l00097"></a>00097     offs_ref_x = cpl_bivector_get_x_data(offs_ref) ;
-<a name="l00098"></a>00098     offs_ref_y = cpl_bivector_get_y_data(offs_ref) ;
-<a name="l00099"></a>00099     correl_data = cpl_vector_get_data(correl) ;
-<a name="l00100"></a>00100     cpl_msg_info(cpl_func, <span class="stringliteral">"Refined relative offsets [correlation factor]"</span>) ;
-<a name="l00101"></a>00101     ngood = 0 ;
-<a name="l00102"></a>00102     <span class="keywordflow">for</span> (i=0 ; i<nimages ; i++) 
-<a name="l00103"></a>00103     {
-<a name="l00104"></a>00104         cpl_msg_info(cpl_func, <span class="stringliteral">"#%02d: %8.2f %8.2f [%12.2f]"</span>,
-<a name="l00105"></a>00105                      i+1, offs_ref_x[i], offs_ref_y[i], correl_data[i]) ;
-<a name="l00106"></a>00106         <span class="keywordflow">if</span> (correl_data[i] > -0.5) ngood++ ;
-<a name="l00107"></a>00107     }
-<a name="l00108"></a>00108     <span class="keywordflow">if</span> (ngood == 0) 
-<a name="l00109"></a>00109     {
-<a name="l00110"></a>00110         cpl_msg_error(__func__, <span class="stringliteral">"No frame correctly correlated"</span>) ;
-<a name="l00111"></a>00111         cpl_bivector_delete(offs_ref) ;
-<a name="l00112"></a>00112         cpl_vector_delete(correl) ;
-<a name="l00113"></a>00113         <span class="keywordflow">return</span> -1;
-<a name="l00114"></a>00114     }
-<a name="l00115"></a>00115     cpl_msg_indent_less();
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     <span class="comment">/* Copy the result */</span>
-<a name="l00118"></a>00118     cpl_vector_copy(cpl_bivector_get_x(refined_offsets),
-<a name="l00119"></a>00119                     cpl_bivector_get_x(offs_ref));
-<a name="l00120"></a>00120     cpl_vector_copy(cpl_bivector_get_y(refined_offsets),
-<a name="l00121"></a>00121                     cpl_bivector_get_y(offs_ref));
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     <span class="comment">/* Free and return */</span>
-<a name="l00124"></a>00124     cpl_bivector_delete(offs_ref);
-<a name="l00125"></a>00125     cpl_msg_indent_less() ;
-<a name="l00126"></a>00126     <span class="keywordflow">return</span> 0;
-<a name="l00127"></a>00127 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_saa.c,v 1.10 2010/03/08 16:20:54 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/03/08 16:20:54 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_saa.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="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> hawki_geom_refine_images_offsets</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> (cpl_imagelist  *  in,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>  cpl_bivector   *  approx_offsets,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>  cpl_bivector   *  reference_objects,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>  <span class="keywordtype">int</span>               s_hx,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>  <span class="keywordtype">int</span>               s_hy,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  <span class="keywordtype">int</span>               m_hx,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  <span class="keywordtype">int</span>               m_hy,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  cpl_bivector   *  refined_offsets,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>  cpl_vector     *  correl)</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_bivector        *   offs_ref ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">double</span>              *   offs_ref_x ;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keywordtype">double</span>              *   offs_ref_y ;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordtype">double</span>              *   correl_data ;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="keywordtype">int</span>                     nimages;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keywordtype">int</span>                     ngood;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <span class="keywordtype">int</span>                     i;</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="comment">/* Check entries */</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keywordflow">if</span> (approx_offsets  == NULL) <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordflow">if</span> (refined_offsets == NULL) <span class="keywordflow">return</span> -1;</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="comment">/* Get the number of images */</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     nimages = cpl_imagelist_get_size(in) ;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordflow">if</span> (cpl_bivector_get_size(approx_offsets) != nimages) </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_msg_error(__func__, <span class="stringliteral">"Invalid input objects sizes"</span>) ; </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Refine the offsets */</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_msg_info(__func__, <span class="stringliteral">"Refine the offsets"</span>) ;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keywordflow">if</span> ((offs_ref = cpl_geom_img_offset_fine</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>             (in, approx_offsets, reference_objects,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>              s_hx, s_hy, m_hx, m_hy, correl)) == NULL)</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_msg_error(cpl_func, <span class="stringliteral">"Cannot refine the offsets"</span>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         cpl_vector_delete(correl) ;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         <span class="keywordflow">return</span> -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> </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="comment">/* Display the results */</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     offs_ref_x = cpl_bivector_get_x_data(offs_ref) ;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     offs_ref_y = cpl_bivector_get_y_data(offs_ref) ;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     correl_data = cpl_vector_get_data(correl) ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Refined relative offsets [correlation factor]"</span>) ;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     ngood = 0 ;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordflow">for</span> (i=0 ; i<nimages ; i++) </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_msg_info(cpl_func, <span class="stringliteral">"#%02d: %8.2f %8.2f [%12.2f]"</span>,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                      i+1, offs_ref_x[i], offs_ref_y[i], correl_data[i]) ;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         <span class="keywordflow">if</span> (correl_data[i] > -0.5) ngood++ ;</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">if</span> (ngood == 0) </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_msg_error(__func__, <span class="stringliteral">"No frame correctly correlated"</span>) ;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         cpl_bivector_delete(offs_ref) ;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         cpl_vector_delete(correl) ;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         <span class="keywordflow">return</span> -1;</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_indent_less();</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">/* Copy the result */</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     cpl_vector_copy(cpl_bivector_get_x(refined_offsets),</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     cpl_bivector_get_x(offs_ref));</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_vector_copy(cpl_bivector_get_y(refined_offsets),</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     cpl_bivector_get_y(offs_ref));</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">/* Free and return */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_bivector_delete(offs_ref);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_msg_indent_less() ;</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><!-- 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/hawki__saa_8h_source.html b/html/hawki__saa_8h_source.html
index a1d2f30..149656c 100644
--- a/html/hawki__saa_8h_source.html
+++ b/html/hawki__saa_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_saa.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,73 +40,74 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_saa.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_saa.h,v 1.5 2009/02/05 12:51: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/02/05 12:51:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_SAA_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_SAA_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                    Prototypes</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keywordtype">int</span> hawki_geom_refine_images_offsets
-<a name="l00042"></a>00042 (cpl_imagelist  *  in,
-<a name="l00043"></a>00043  cpl_bivector   *  approx_offsets,
-<a name="l00044"></a>00044  cpl_bivector   *  reference_objects,
-<a name="l00045"></a>00045  <span class="keywordtype">int</span>               s_hx,
-<a name="l00046"></a>00046  <span class="keywordtype">int</span>               s_hy,
-<a name="l00047"></a>00047  <span class="keywordtype">int</span>               m_hx,
-<a name="l00048"></a>00048  <span class="keywordtype">int</span>               m_hy,
-<a name="l00049"></a>00049  cpl_bivector   *  refined_offsets,
-<a name="l00050"></a>00050  cpl_vector     *  correl);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_saa.h,v 1.5 2009/02/05 12:51: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/02/05 12:51:14 $</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: hawki-1_8_12 $</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 HAWKI_SAA_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_SAA_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                    Prototypes</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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">int</span> hawki_geom_refine_images_offsets</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> (cpl_imagelist  *  in,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  cpl_bivector   *  approx_offsets,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>  cpl_bivector   *  reference_objects,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>  <span class="keywordtype">int</span>               s_hx,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>  <span class="keywordtype">int</span>               s_hy,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>  <span class="keywordtype">int</span>               m_hx,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>  <span class="keywordtype">int</span>               m_hy,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>  cpl_bivector   *  refined_offsets,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>  cpl_vector     *  correl);</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></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/hawki__save_8c_source.html b/html/hawki__save_8c_source.html
index 8039ca0..176b64a 100644
--- a/html/hawki__save_8c_source.html
+++ b/html/hawki__save_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_save.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,618 +40,619 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_save.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_save.c,v 1.11 2010/11/29 03:37: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/11/29 03:37:15 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <string.h></span>
-<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 "hawki_distortion.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 
-<a name="l00055"></a>00055 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00071"></a>00071 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00072"></a><a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d">00072</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(
-<a name="l00073"></a>00073         cpl_frameset                *   allframes,
-<a name="l00074"></a>00074         <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00075"></a>00075         <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00076"></a>00076         <span class="keyword">const</span> cpl_imagelist         *   images,
-<a name="l00077"></a>00077         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00078"></a>00078         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00079"></a>00079         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00080"></a>00080         <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00081"></a>00081         <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00082"></a>00082         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)
-<a name="l00083"></a>00083 {
-<a name="l00084"></a>00084     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname;
-<a name="l00085"></a>00085     cpl_propertylist    *   pro_list;
-<a name="l00086"></a>00086     cpl_type_bpp            pixeltype;
-<a name="l00087"></a>00087     <span class="keywordtype">char</span>                    sval[16];
-<a name="l00088"></a>00088     <span class="keywordtype">int</span>                     chip_nb;
-<a name="l00089"></a>00089     <span class="keywordtype">int</span>                     iext;
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091     <span class="comment">/* Test entries */</span>
-<a name="l00092"></a>00092     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094     <span class="comment">/* Get a suitable reference frame */</span>
-<a name="l00095"></a>00095     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)
-<a name="l00096"></a>00096     {
-<a name="l00097"></a>00097         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);
-<a name="l00098"></a>00098         <span class="keywordflow">return</span> -1;
-<a name="l00099"></a>00099     }
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101     <span class="comment">/* Add the PRO keys */</span>
-<a name="l00102"></a>00102     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;
-<a name="l00103"></a>00103     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;
-<a name="l00104"></a>00104     <span class="keywordflow">if</span> (protype != NULL)
-<a name="l00105"></a>00105         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;
-<a name="l00106"></a>00106     <span class="keywordflow">if</span> (procat != NULL)
-<a name="l00107"></a>00107         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109     <span class="comment">/* File with extensions */</span>
-<a name="l00110"></a>00110     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,
-<a name="l00111"></a>00111                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, 
-<a name="l00112"></a>00112                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00113"></a>00113                 filename) != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,
-<a name="l00115"></a>00115                 filename);
-<a name="l00116"></a>00116         cpl_propertylist_delete(pro_list);
-<a name="l00117"></a>00117         <span class="keywordflow">return</span> -1 ;
-<a name="l00118"></a>00118     }
-<a name="l00119"></a>00119 
-<a name="l00120"></a>00120     <span class="comment">/* Delete PRO LIST */</span>
-<a name="l00121"></a>00121     cpl_propertylist_delete(pro_list);
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     <span class="comment">/* Get the file type */</span>
-<a name="l00124"></a>00124     <span class="keywordflow">if</span> (cpl_image_get_type(cpl_imagelist_get_const(images, 0)) == CPL_TYPE_INT)
-<a name="l00125"></a>00125         pixeltype = CPL_BPP_32_SIGNED ;
-<a name="l00126"></a>00126     <span class="keywordflow">else</span>
-<a name="l00127"></a>00127         pixeltype = CPL_BPP_IEEE_FLOAT ;
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129     <span class="comment">/* Save the extensions */</span>
-<a name="l00130"></a>00130     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {
-<a name="l00131"></a>00131         cpl_propertylist    *   qc_ext_list;
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133         <span class="comment">/* Get the chip number to store in this extension */</span>
-<a name="l00134"></a>00134         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {
-<a name="l00135"></a>00135             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d when "</span>
-<a name="l00136"></a>00136                     <span class="stringliteral">"writing file %s"</span>, iext+1, filename);
-<a name="l00137"></a>00137             <span class="keywordflow">return</span> -1 ;
-<a name="l00138"></a>00138         }
-<a name="l00139"></a>00139         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))
-<a name="l00140"></a>00140             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;
-<a name="l00141"></a>00141         <span class="keywordflow">else</span>
-<a name="l00142"></a>00142             qc_ext_list = cpl_propertylist_new() ;
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;
-<a name="l00145"></a>00145         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00146"></a>00146         <span class="keywordflow">if</span>(cpl_image_save(cpl_imagelist_get_const(images, chip_nb-1), filename,
-<a name="l00147"></a>00147                        pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00148"></a>00148         {
-<a name="l00149"></a>00149             cpl_msg_error(__func__, <span class="stringliteral">"Cannot save extension %d of file %s"</span>,
-<a name="l00150"></a>00150                     iext+1, filename);
-<a name="l00151"></a>00151             cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00152"></a>00152             <span class="keywordflow">return</span> -1;
-<a name="l00153"></a>00153         }
-<a name="l00154"></a>00154         cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00155"></a>00155     }
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00176"></a>00176 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00177"></a>00177 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>
-<a name="l00178"></a><a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54">00178</a> (cpl_frameset                *   allframes,
-<a name="l00179"></a>00179  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00180"></a>00180  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00181"></a>00181  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00182"></a>00182  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00183"></a>00183  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00184"></a>00184  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00185"></a>00185  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)
-<a name="l00186"></a>00186 {
-<a name="l00187"></a>00187     cpl_propertylist    *   pro_list;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* Test entries */</span>
-<a name="l00190"></a>00190     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* Add the PRO keys */</span>
-<a name="l00193"></a>00193     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;
-<a name="l00194"></a>00194     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;
-<a name="l00195"></a>00195     <span class="keywordflow">if</span> (protype != NULL)
-<a name="l00196"></a>00196         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;
-<a name="l00197"></a>00197     <span class="keywordflow">if</span> (procat != NULL)
-<a name="l00198"></a>00198         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200     <span class="comment">/* File with extensions */</span>
-<a name="l00201"></a>00201     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,
-<a name="l00202"></a>00202                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, 
-<a name="l00203"></a>00203                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00204"></a>00204                 filename) != CPL_ERROR_NONE) {
-<a name="l00205"></a>00205         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,
-<a name="l00206"></a>00206                 filename);
-<a name="l00207"></a>00207         cpl_propertylist_delete(pro_list);
-<a name="l00208"></a>00208         <span class="keywordflow">return</span> -1 ;
-<a name="l00209"></a>00209     }
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <span class="comment">/* Delete PRO LIST */</span>
-<a name="l00212"></a>00212     cpl_propertylist_delete(pro_list);
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00225"></a>00225 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00226"></a>00226 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>
-<a name="l00227"></a><a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc">00227</a> (<span class="keyword">const</span> cpl_frameset      *   allframes,
-<a name="l00228"></a>00228  <span class="keyword">const</span> cpl_image         *   image,
-<a name="l00229"></a>00229  <span class="keywordtype">int</span>                         iext,
-<a name="l00230"></a>00230  <span class="keyword">const</span> cpl_propertylist  *   ext_prop_list,
-<a name="l00231"></a>00231  <span class="keyword">const</span> <span class="keywordtype">char</span>              *   filename)
-<a name="l00232"></a>00232 {
-<a name="l00233"></a>00233     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname;
-<a name="l00234"></a>00234     cpl_type_bpp            pixeltype;
-<a name="l00235"></a>00235     cpl_propertylist    *   ext_prop;
-<a name="l00236"></a>00236     <span class="keywordtype">char</span>                    sval[16];
-<a name="l00237"></a>00237     <span class="keywordtype">int</span>                     idet;
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="comment">/* Test entries */</span>
-<a name="l00240"></a>00240     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     <span class="comment">/* Get a suitable reference frame */</span>
-<a name="l00243"></a>00243     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)
-<a name="l00244"></a>00244     {
-<a name="l00245"></a>00245         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);
-<a name="l00246"></a>00246         <span class="keywordflow">return</span> -1;
-<a name="l00247"></a>00247     }
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     <span class="comment">/* Get the file type */</span>
-<a name="l00250"></a>00250     <span class="keywordflow">if</span> (cpl_image_get_type(image) == CPL_TYPE_INT)
-<a name="l00251"></a>00251         pixeltype = CPL_BPP_32_SIGNED ;
-<a name="l00252"></a>00252     <span class="keywordflow">else</span>
-<a name="l00253"></a>00253         pixeltype = CPL_BPP_IEEE_FLOAT ;
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="comment">/* Save the extension */</span>
-<a name="l00256"></a>00256     <span class="comment">/* Get the chip number to store in this extension */</span>
-<a name="l00257"></a>00257     <span class="keywordflow">if</span> ((idet = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext)) == -1) {
-<a name="l00258"></a>00258         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip id for extension %d "</span>
-<a name="l00259"></a>00259                 <span class="stringliteral">"when saving %s"</span>, iext, filename);
-<a name="l00260"></a>00260                 <span class="keywordflow">return</span> -1;
-<a name="l00261"></a>00261     }
-<a name="l00262"></a>00262     <span class="keywordflow">if</span> (ext_prop_list != NULL)
-<a name="l00263"></a>00263         ext_prop = cpl_propertylist_duplicate(ext_prop_list) ;
-<a name="l00264"></a>00264     <span class="keywordflow">else</span>
-<a name="l00265"></a>00265         ext_prop = cpl_propertylist_new() ;
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267     snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, idet) ;
-<a name="l00268"></a>00268     cpl_propertylist_prepend_string(ext_prop, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00269"></a>00269     <span class="keywordflow">if</span>(cpl_image_save(image, filename,
-<a name="l00270"></a>00270                       pixeltype, ext_prop, CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00271"></a>00271     {
-<a name="l00272"></a>00272         cpl_msg_error(__func__,<span class="stringliteral">"Could not save extension %d of file %s"</span>,
-<a name="l00273"></a>00273                 iext, filename);
-<a name="l00274"></a>00274         cpl_propertylist_delete(ext_prop);
-<a name="l00275"></a>00275         <span class="keywordflow">return</span> -1;
-<a name="l00276"></a>00276     }
-<a name="l00277"></a>00277     cpl_propertylist_delete(ext_prop) ;
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     <span class="keywordflow">return</span> 0 ;
-<a name="l00280"></a>00280 }
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00301"></a>00301 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00302"></a><a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4">00302</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(
-<a name="l00303"></a>00303         cpl_frameset                *   allframes,
-<a name="l00304"></a>00304         <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00305"></a>00305         <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00306"></a>00306         <span class="keyword">const</span> cpl_image             **  images,
-<a name="l00307"></a>00307         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00308"></a>00308         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00309"></a>00309         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00310"></a>00310         <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00311"></a>00311         <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00312"></a>00312         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)
-<a name="l00313"></a>00313 {
-<a name="l00314"></a>00314     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00315"></a>00315     cpl_propertylist    *   pro_list ;
-<a name="l00316"></a>00316     cpl_type_bpp            pixeltype ;
-<a name="l00317"></a>00317     cpl_propertylist    *   qc_ext_list ;
-<a name="l00318"></a>00318     <span class="keywordtype">char</span>                    sval[16] ;
-<a name="l00319"></a>00319     <span class="keywordtype">int</span>                     chip_nb ;
-<a name="l00320"></a>00320     <span class="keywordtype">int</span>                     iext;
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="comment">/* Test entries */</span>
-<a name="l00323"></a>00323     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     <span class="comment">/* Get a suitable reference frame */</span>
-<a name="l00326"></a>00326     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)
-<a name="l00327"></a>00327     {
-<a name="l00328"></a>00328         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);
-<a name="l00329"></a>00329         <span class="keywordflow">return</span> -1;
-<a name="l00330"></a>00330     }
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="comment">/* Add the PRO keys */</span>
-<a name="l00333"></a>00333     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;
-<a name="l00334"></a>00334     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;
-<a name="l00335"></a>00335     <span class="keywordflow">if</span> (protype != NULL)
-<a name="l00336"></a>00336         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;
-<a name="l00337"></a>00337     <span class="keywordflow">if</span> (procat != NULL)
-<a name="l00338"></a>00338         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="comment">/* File with extensions */</span>
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,
-<a name="l00342"></a>00342                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, 
-<a name="l00343"></a>00343                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00344"></a>00344                 filename) != CPL_ERROR_NONE) {
-<a name="l00345"></a>00345         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,
-<a name="l00346"></a>00346                 filename);
-<a name="l00347"></a>00347         cpl_propertylist_delete(pro_list) ;
-<a name="l00348"></a>00348         <span class="keywordflow">return</span> -1 ;
-<a name="l00349"></a>00349     }
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <span class="comment">/* Delete PRO LIST */</span>
-<a name="l00352"></a>00352     cpl_propertylist_delete(pro_list) ;
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     <span class="comment">/* Get the file type */</span>
-<a name="l00355"></a>00355     <span class="keywordflow">if</span> (cpl_image_get_type(images[0]) == CPL_TYPE_INT)
-<a name="l00356"></a>00356         pixeltype = CPL_BPP_32_SIGNED ;
-<a name="l00357"></a>00357     <span class="keywordflow">else</span>
-<a name="l00358"></a>00358         pixeltype = CPL_BPP_IEEE_FLOAT ;
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     <span class="comment">/* Save the extensions */</span>
-<a name="l00361"></a>00361     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {
-<a name="l00362"></a>00362         <span class="comment">/* Get the chip number to store in this extension */</span>
-<a name="l00363"></a>00363         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {
-<a name="l00364"></a>00364             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span>
-<a name="l00365"></a>00365                     <span class="stringliteral">"when saving file %s"</span>, iext+1, filename);
-<a name="l00366"></a>00366             <span class="keywordflow">return</span> -1 ;
-<a name="l00367"></a>00367         }
-<a name="l00368"></a>00368         <span class="comment">/* Get the QC list */</span>
-<a name="l00369"></a>00369         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))
-<a name="l00370"></a>00370             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;
-<a name="l00371"></a>00371         <span class="keywordflow">else</span>
-<a name="l00372"></a>00372             qc_ext_list = cpl_propertylist_new() ;
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;
-<a name="l00375"></a>00375         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00376"></a>00376         <span class="keywordflow">if</span>(cpl_image_save(images[chip_nb-1], filename,
-<a name="l00377"></a>00377                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00378"></a>00378         {
-<a name="l00379"></a>00379             cpl_msg_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,
-<a name="l00380"></a>00380                     iext+1, filename);
-<a name="l00381"></a>00381             cpl_propertylist_delete(qc_ext_list);
-<a name="l00382"></a>00382             <span class="keywordflow">return</span> -1;
-<a name="l00383"></a>00383         }
-<a name="l00384"></a>00384         cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00385"></a>00385     }
-<a name="l00386"></a>00386     <span class="keywordflow">return</span> 0 ;
-<a name="l00387"></a>00387 }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00405"></a>00405 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00406"></a><a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9">00406</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(
-<a name="l00407"></a>00407         cpl_frameset                *   allframes,
-<a name="l00408"></a>00408         <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00409"></a>00409         <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00410"></a>00410         <span class="keyword">const</span> cpl_table             **  tables,
-<a name="l00411"></a>00411         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00412"></a>00412         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00413"></a>00413         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00414"></a>00414         <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00415"></a>00415         <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00416"></a>00416         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)
-<a name="l00417"></a>00417 {
-<a name="l00418"></a>00418     cpl_propertylist    *   qc_ext_list ;
-<a name="l00419"></a>00419     cpl_propertylist    *   pro_list ;
-<a name="l00420"></a>00420     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00421"></a>00421     <span class="keywordtype">char</span>                    sval[16] ;
-<a name="l00422"></a>00422     <span class="keywordtype">int</span>                     chip_nb ;
-<a name="l00423"></a>00423     <span class="keywordtype">int</span>                     iext;
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     <span class="comment">/* Test entries */</span>
-<a name="l00426"></a>00426     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     <span class="comment">/* Get a suitable reference frame */</span>
-<a name="l00429"></a>00429     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)
-<a name="l00430"></a>00430     {
-<a name="l00431"></a>00431         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);
-<a name="l00432"></a>00432         <span class="keywordflow">return</span> -1;
-<a name="l00433"></a>00433     }
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     <span class="comment">/* Add the PRO keys */</span>
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;
-<a name="l00437"></a>00437     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;
-<a name="l00438"></a>00438     <span class="keywordflow">if</span> (protype != NULL)
-<a name="l00439"></a>00439         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;
-<a name="l00440"></a>00440     <span class="keywordflow">if</span> (procat != NULL)
-<a name="l00441"></a>00441         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="comment">/* File with extensions */</span>
-<a name="l00444"></a>00444     <span class="keywordflow">if</span> ((applists != NULL) && (applists[0] != NULL))
-<a name="l00445"></a>00445         qc_ext_list = cpl_propertylist_duplicate(applists[0]) ;
-<a name="l00446"></a>00446     <span class="keywordflow">else</span>
-<a name="l00447"></a>00447         qc_ext_list = cpl_propertylist_new() ;
-<a name="l00448"></a>00448     cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, <span class="stringliteral">"CHIP1.INT1"</span>) ;
-<a name="l00449"></a>00449     <span class="keywordflow">if</span> (cpl_dfs_save_table(allframes, NULL, parlist, usedframes, NULL, tables[0],
-<a name="l00450"></a>00450                 qc_ext_list, recipe, pro_list, NULL, 
-<a name="l00451"></a>00451                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00452"></a>00452                 filename) != CPL_ERROR_NONE) {
-<a name="l00453"></a>00453         cpl_msg_error(__func__,
-<a name="l00454"></a>00454                 <span class="stringliteral">"Cannot save the first extension table of file %s"</span>, filename);
-<a name="l00455"></a>00455         cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00456"></a>00456         cpl_propertylist_delete(pro_list) ;
-<a name="l00457"></a>00457         <span class="keywordflow">return</span> -1 ;
-<a name="l00458"></a>00458     }
-<a name="l00459"></a>00459     cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00460"></a>00460     cpl_propertylist_delete(pro_list) ;
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="comment">/* Save the extensions */</span>
-<a name="l00463"></a>00463     <span class="keywordflow">for</span> (iext=1 ; iext<HAWKI_NB_DETECTORS; iext++) {
-<a name="l00464"></a>00464         <span class="comment">/* Get the chip number to store in this extension */</span>
-<a name="l00465"></a>00465         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {
-<a name="l00466"></a>00466             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span>
-<a name="l00467"></a>00467                     <span class="stringliteral">"when writing file %s"</span>, iext+1, filename);
-<a name="l00468"></a>00468             <span class="keywordflow">return</span> -1 ;
-<a name="l00469"></a>00469         }
-<a name="l00470"></a>00470         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))
-<a name="l00471"></a>00471             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;
-<a name="l00472"></a>00472         <span class="keywordflow">else</span>
-<a name="l00473"></a>00473             qc_ext_list = cpl_propertylist_new() ;
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;
-<a name="l00476"></a>00476         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00477"></a>00477         <span class="keywordflow">if</span>(cpl_table_save(tables[chip_nb-1], NULL, qc_ext_list, filename,
-<a name="l00478"></a>00478                 CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00479"></a>00479         {
-<a name="l00480"></a>00480             cpl_msg_error(__func__, <span class="stringliteral">"Cannot save extension %d of table %s"</span>,
-<a name="l00481"></a>00481                     iext+1, filename);
-<a name="l00482"></a>00482             cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00483"></a>00483             <span class="keywordflow">return</span> -1;
-<a name="l00484"></a>00484         }
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486         cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00487"></a>00487     }
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     <span class="keywordflow">return</span> 0 ;
-<a name="l00490"></a>00490 }
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00512"></a>00512 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00513"></a>00513 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a>
-<a name="l00514"></a><a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089">00514</a> (cpl_frameset                *   allframes,
-<a name="l00515"></a>00515  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00516"></a>00516  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00517"></a>00517  <span class="keyword">const</span> hawki_distortion      **  distortion,
-<a name="l00518"></a>00518  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00519"></a>00519  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00520"></a>00520  <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00521"></a>00521  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_x,
-<a name="l00522"></a>00522  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_y)
-<a name="l00523"></a>00523 {
-<a name="l00524"></a>00524     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;
-<a name="l00525"></a>00525     cpl_propertylist    *   pro_list_x;
-<a name="l00526"></a>00526     cpl_propertylist    *   pro_list_y;
-<a name="l00527"></a>00527     cpl_type_bpp            pixeltype ;
-<a name="l00528"></a>00528     cpl_propertylist    *   qc_ext_list ;
-<a name="l00529"></a>00529     <span class="keywordtype">char</span>                    sval[16] ;
-<a name="l00530"></a>00530     <span class="keywordtype">int</span>                     chip_nb ;
-<a name="l00531"></a>00531     <span class="keywordtype">int</span>                     iext;
-<a name="l00532"></a>00532 
-<a name="l00533"></a>00533     <span class="comment">/* Test entries */</span>
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536     <span class="comment">/* Get a suitable reference frame */</span>
-<a name="l00537"></a>00537     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)
-<a name="l00538"></a>00538     {
-<a name="l00539"></a>00539         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);
-<a name="l00540"></a>00540         <span class="keywordflow">return</span> -1;
-<a name="l00541"></a>00541     }
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543     <span class="comment">/* Add the PRO keys */</span>
-<a name="l00544"></a>00544     <span class="keywordflow">if</span>(applist != NULL)
-<a name="l00545"></a>00545         pro_list_x = cpl_propertylist_duplicate(applist);
-<a name="l00546"></a>00546     <span class="keywordflow">else</span>
-<a name="l00547"></a>00547         pro_list_x = cpl_propertylist_new();
-<a name="l00548"></a>00548     <span class="keywordflow">if</span>(applist != NULL) 
-<a name="l00549"></a>00549         pro_list_y = cpl_propertylist_duplicate(applist);
-<a name="l00550"></a>00550     <span class="keywordflow">else</span>
-<a name="l00551"></a>00551         pro_list_y = cpl_propertylist_new();
-<a name="l00552"></a>00552     
-<a name="l00553"></a>00553     cpl_propertylist_append_string(pro_list_x, CPL_DFS_PRO_TYPE, 
-<a name="l00554"></a>00554                                    HAWKI_PROTYPE_DISTORTION_X);
-<a name="l00555"></a>00555     cpl_propertylist_append_string(pro_list_y, CPL_DFS_PRO_TYPE, 
-<a name="l00556"></a>00556                                    HAWKI_PROTYPE_DISTORTION_Y);
-<a name="l00557"></a>00557     cpl_propertylist_append_string(pro_list_x, CPL_DFS_PRO_CATG, 
-<a name="l00558"></a>00558                                    HAWKI_CALPRO_DISTORTION_X);
-<a name="l00559"></a>00559     cpl_propertylist_append_string(pro_list_y, CPL_DFS_PRO_CATG, 
-<a name="l00560"></a>00560                                    HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="comment">/* File with extensions */</span>
-<a name="l00563"></a>00563     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,
-<a name="l00564"></a>00564                 CPL_BPP_IEEE_FLOAT, recipe, pro_list_x, NULL, 
-<a name="l00565"></a>00565                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00566"></a>00566                 filename_x) != CPL_ERROR_NONE) {
-<a name="l00567"></a>00567         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,
-<a name="l00568"></a>00568                 filename_x);
-<a name="l00569"></a>00569         cpl_propertylist_delete(pro_list_x);
-<a name="l00570"></a>00570         cpl_propertylist_delete(pro_list_y);
-<a name="l00571"></a>00571         <span class="keywordflow">return</span> -1 ;
-<a name="l00572"></a>00572     }
-<a name="l00573"></a>00573     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,
-<a name="l00574"></a>00574                 CPL_BPP_IEEE_FLOAT, recipe, pro_list_y, NULL, 
-<a name="l00575"></a>00575                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00576"></a>00576                 filename_y) != CPL_ERROR_NONE) {
-<a name="l00577"></a>00577         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,
-<a name="l00578"></a>00578                 filename_y);
-<a name="l00579"></a>00579         cpl_propertylist_delete(pro_list_x);
-<a name="l00580"></a>00580         cpl_propertylist_delete(pro_list_y);
-<a name="l00581"></a>00581         <span class="keywordflow">return</span> -1 ;
-<a name="l00582"></a>00582     }
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="comment">/* Delete PRO LIST */</span>
-<a name="l00585"></a>00585     cpl_propertylist_delete(pro_list_x);
-<a name="l00586"></a>00586     cpl_propertylist_delete(pro_list_y);
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     <span class="comment">/* Get the file type */</span>
-<a name="l00589"></a>00589     <span class="keywordflow">if</span> (cpl_image_get_type(distortion[0]->dist_x) == CPL_TYPE_INT)
-<a name="l00590"></a>00590         pixeltype = CPL_BPP_32_SIGNED ;
-<a name="l00591"></a>00591     <span class="keywordflow">else</span>
-<a name="l00592"></a>00592         pixeltype = CPL_BPP_IEEE_FLOAT ;
-<a name="l00593"></a>00593 
-<a name="l00594"></a>00594     <span class="comment">/* Save the extensions */</span>
-<a name="l00595"></a>00595     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {
-<a name="l00596"></a>00596         <span class="comment">/* Get the chip number to store in this extension */</span>
-<a name="l00597"></a>00597         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {
-<a name="l00598"></a>00598             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span>
-<a name="l00599"></a>00599                     <span class="stringliteral">"when saving %s and %s"</span>, iext+1, filename_x, filename_y);
-<a name="l00600"></a>00600             <span class="keywordflow">return</span> -1 ;
-<a name="l00601"></a>00601         }
-<a name="l00602"></a>00602         <span class="comment">/* Get the QC list */</span>
-<a name="l00603"></a>00603         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))
-<a name="l00604"></a>00604             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;
-<a name="l00605"></a>00605         <span class="keywordflow">else</span>
-<a name="l00606"></a>00606             qc_ext_list = cpl_propertylist_new() ;
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608         <span class="comment">/* Add the CR* keywords */</span>
-<a name="l00609"></a>00609         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRPIX2"</span>, 1);
-<a name="l00610"></a>00610         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CDELT2"</span>,
-<a name="l00611"></a>00611                                         distortion[chip_nb-1]->y_cdelt);
-<a name="l00612"></a>00612         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRVAL2"</span>,
-<a name="l00613"></a>00613                                         distortion[chip_nb-1]->y_crval);
-<a name="l00614"></a>00614         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRPIX1"</span>, 1);
-<a name="l00615"></a>00615         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CDELT1"</span>,
-<a name="l00616"></a>00616                                         distortion[chip_nb-1]->x_cdelt);
-<a name="l00617"></a>00617         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l00618"></a>00618                                         distortion[chip_nb-1]->x_crval);
-<a name="l00619"></a>00619         
-<a name="l00620"></a>00620         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;
-<a name="l00621"></a>00621         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00622"></a>00622         <span class="keywordflow">if</span>(cpl_image_save(distortion[chip_nb-1]->dist_x, filename_x,
-<a name="l00623"></a>00623                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00624"></a>00624         {
-<a name="l00625"></a>00625             cpl_msg_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,
-<a name="l00626"></a>00626                     iext+1, filename_x);
-<a name="l00627"></a>00627             cpl_propertylist_delete(qc_ext_list);
-<a name="l00628"></a>00628             <span class="keywordflow">return</span> -1;
-<a name="l00629"></a>00629         }
-<a name="l00630"></a>00630         <span class="keywordflow">if</span>(cpl_image_save(distortion[chip_nb-1]->dist_y, filename_y,
-<a name="l00631"></a>00631                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)
-<a name="l00632"></a>00632         {
-<a name="l00633"></a>00633             cpl_msg_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,
-<a name="l00634"></a>00634                     iext+1, filename_y);
-<a name="l00635"></a>00635             cpl_propertylist_delete(qc_ext_list);
-<a name="l00636"></a>00636             <span class="keywordflow">return</span> -1;
-<a name="l00637"></a>00637         }
-<a name="l00638"></a>00638         cpl_propertylist_delete(qc_ext_list) ;
-<a name="l00639"></a>00639     }
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00654"></a>00654 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00655"></a>00655 
-<a name="l00656"></a><a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536">00656</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">const</span> cpl_frameset * frameset)
-<a name="l00657"></a>00657 {
-<a name="l00658"></a>00658     <span class="keywordtype">int</span> iframe;
-<a name="l00659"></a>00659     <span class="keyword">const</span> <span class="keywordtype">char</span>     * fname = NULL;
-<a name="l00660"></a>00660 
-<a name="l00661"></a>00661     <span class="keywordflow">for</span>(iframe = 0 ; iframe < cpl_frameset_get_size(frameset); ++iframe)
-<a name="l00662"></a>00662     {
-<a name="l00663"></a>00663         <span class="keyword">const</span> cpl_frame  * frame;
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665         frame = cpl_frameset_get_frame_const(frameset, iframe);
-<a name="l00666"></a>00666         <span class="comment">/* Check that it belongs to the raw frames</span>
-<a name="l00667"></a>00667 <span class="comment">         * and then check if there are 4 extensions</span>
-<a name="l00668"></a>00668 <span class="comment">         */</span>
-<a name="l00669"></a>00669         <span class="keywordflow">if</span>(cpl_frame_get_group(frame) == CPL_FRAME_GROUP_RAW &&
-<a name="l00670"></a>00670            cpl_frame_get_nextensions(frame) == HAWKI_NB_DETECTORS)
-<a name="l00671"></a>00671         {
-<a name="l00672"></a>00672             fname = cpl_frame_get_filename(frame);
-<a name="l00673"></a>00673             <span class="keywordflow">return</span> fname;
-<a name="l00674"></a>00674         }
-<a name="l00675"></a>00675     }
-<a name="l00676"></a>00676     <span class="comment">//Now look into the products, in case that there is no actual raw</span>
-<a name="l00677"></a>00677     <span class="comment">//reference frame. This is kind of a hack for hawki_util_gendist,</span>
-<a name="l00678"></a>00678     <span class="comment">//which allows to save the distortion images using the distortion</span>
-<a name="l00679"></a>00679     <span class="comment">//table as a reference</span>
-<a name="l00680"></a>00680     <span class="keywordflow">for</span>(iframe = 0 ; iframe < cpl_frameset_get_size(frameset); ++iframe)
-<a name="l00681"></a>00681     {
-<a name="l00682"></a>00682         <span class="keyword">const</span> cpl_frame  * frame;
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684         frame = cpl_frameset_get_frame_const(frameset, iframe);
-<a name="l00685"></a>00685         <span class="comment">/* Check that it belongs to the raw frames</span>
-<a name="l00686"></a>00686 <span class="comment">         * and then check if there are 4 extensions</span>
-<a name="l00687"></a>00687 <span class="comment">         */</span>
-<a name="l00688"></a>00688         <span class="keywordflow">if</span>(cpl_frame_get_group(frame) == CPL_FRAME_GROUP_PRODUCT &&
-<a name="l00689"></a>00689            cpl_frame_get_nextensions(frame) == HAWKI_NB_DETECTORS)
-<a name="l00690"></a>00690         {
-<a name="l00691"></a>00691             fname = cpl_frame_get_filename(frame);
-<a name="l00692"></a>00692             <span class="keywordflow">return</span> fname;
-<a name="l00693"></a>00693         }
-<a name="l00694"></a>00694     }
-<a name="l00695"></a>00695     <span class="comment">//And if it didn't suceed, use the first frame:</span>
-<a name="l00696"></a>00696     fname = cpl_frame_get_filename(cpl_frameset_get_first_const(frameset));
-<a name="l00697"></a>00697 
-<a name="l00698"></a>00698     <span class="keywordflow">return</span> fname;
-<a name="l00699"></a>00699 }
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_save.c,v 1.11 2010/11/29 03:37:15 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010/11/29 03:37:15 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_dfs.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">/*----------------------------------------------------------------------------*/</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="l00055"></a><span class="lineno">   55</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d">   72</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>         cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>         <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>         <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keyword">const</span> cpl_imagelist         *   images,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)</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">const</span> <span class="keywordtype">char</span>          *   fname;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_propertylist    *   pro_list;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_type_bpp            pixeltype;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keywordtype">char</span>                    sval[16];</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <span class="keywordtype">int</span>                     chip_nb;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     <span class="keywordtype">int</span>                     iext;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Get a suitable reference frame */</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)</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_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>         <span class="keywordflow">return</span> -1;</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">/* Add the PRO keys */</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordflow">if</span> (protype != NULL)</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keywordflow">if</span> (procat != NULL)</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;</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">/* File with extensions */</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                 filename) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                 filename);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         cpl_propertylist_delete(pro_list);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         <span class="keywordflow">return</span> -1 ;</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> </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="comment">/* Delete PRO LIST */</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     cpl_propertylist_delete(pro_list);</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 the file type */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keywordflow">if</span> (cpl_image_get_type(cpl_imagelist_get_const(images, 0)) == CPL_TYPE_INT)</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         pixeltype = CPL_BPP_32_SIGNED ;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         pixeltype = CPL_BPP_IEEE_FLOAT ;</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="comment">/* Save the extensions */</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         cpl_propertylist    *   qc_ext_list;</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="comment">/* Get the chip number to store in this extension */</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d when "</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     <span class="stringliteral">"writing file %s"</span>, iext+1, filename);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>             <span class="keywordflow">return</span> -1 ;</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> ((applists != NULL) && (applists[chip_nb-1] != NULL))</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;</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>             qc_ext_list = cpl_propertylist_new() ;</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>         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         <span class="keywordflow">if</span>(cpl_image_save(cpl_imagelist_get_const(images, chip_nb-1), filename,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                        pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot save extension %d of file %s"</span>,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                     iext+1, filename);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>             cpl_propertylist_delete(qc_ext_list) ;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             <span class="keywordflow">return</span> -1;</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>         cpl_propertylist_delete(qc_ext_list) ;</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> 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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a></div>
+<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54">  178</a></span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   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>     cpl_propertylist    *   pro_list;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordflow">if</span> (allframes == NULL) <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">/* Add the PRO keys */</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">if</span> (protype != NULL)</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordflow">if</span> (procat != NULL)</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;</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">/* File with extensions */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                 filename) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                 filename);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         cpl_propertylist_delete(pro_list);</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> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="comment">/* Delete PRO LIST */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_propertylist_delete(pro_list);</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> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a></div>
+<div class="line"><a name="l00227"></a><span class="lineno"><a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc">  227</a></span> (<span class="keyword">const</span> cpl_frameset      *   allframes,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>  <span class="keyword">const</span> cpl_image         *   image,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>  <span class="keywordtype">int</span>                         iext,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>  <span class="keyword">const</span> cpl_propertylist  *   ext_prop_list,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>              *   filename)</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="keyword">const</span> <span class="keywordtype">char</span>          *   fname;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_type_bpp            pixeltype;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_propertylist    *   ext_prop;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordtype">char</span>                    sval[16];</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="keywordtype">int</span>                     idet;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Get a suitable reference frame */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == NULL)</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_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         <span class="keywordflow">return</span> -1;</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">/* Get the file type */</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">if</span> (cpl_image_get_type(image) == CPL_TYPE_INT)</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         pixeltype = CPL_BPP_32_SIGNED ;</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>         pixeltype = CPL_BPP_IEEE_FLOAT ;</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">/* Save the extension */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="comment">/* Get the chip number to store in this extension */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">if</span> ((idet = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext)) == -1) {</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip id for extension %d "</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                 <span class="stringliteral">"when saving %s"</span>, iext, filename);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                 <span class="keywordflow">return</span> -1;</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">if</span> (ext_prop_list != NULL)</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         ext_prop = cpl_propertylist_duplicate(ext_prop_list) ;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>         ext_prop = cpl_propertylist_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>     snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, idet) ;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_propertylist_prepend_string(ext_prop, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">if</span>(cpl_image_save(image, filename,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                       pixeltype, ext_prop, CPL_IO_EXTEND) != CPL_ERROR_NONE)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not save extension %d of file %s"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                 iext, filename);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         cpl_propertylist_delete(ext_prop);</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>     cpl_propertylist_delete(ext_prop) ;</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">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4">  302</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         <span class="keyword">const</span> cpl_image             **  images,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)</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="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_propertylist    *   pro_list ;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_type_bpp            pixeltype ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_propertylist    *   qc_ext_list ;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     <span class="keywordtype">char</span>                    sval[16] ;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordtype">int</span>                     chip_nb ;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keywordtype">int</span>                     iext;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Get a suitable reference frame */</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == 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_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Add the PRO keys */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordflow">if</span> (protype != NULL)</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordflow">if</span> (procat != NULL)</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;</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="comment">/* File with extensions */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                 CPL_BPP_IEEE_FLOAT, recipe, pro_list, NULL, </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                 filename) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                 filename);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         cpl_propertylist_delete(pro_list) ;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Delete PRO LIST */</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_propertylist_delete(pro_list) ;</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">/* Get the file type */</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordflow">if</span> (cpl_image_get_type(images[0]) == CPL_TYPE_INT)</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         pixeltype = CPL_BPP_32_SIGNED ;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>         pixeltype = CPL_BPP_IEEE_FLOAT ;</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">/* Save the extensions */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         <span class="comment">/* Get the chip number to store in this extension */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                     <span class="stringliteral">"when saving file %s"</span>, iext+1, filename);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>             <span class="keywordflow">return</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>         <span class="comment">/* Get the QC list */</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>             qc_ext_list = cpl_propertylist_new() ;</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>         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>         <span class="keywordflow">if</span>(cpl_image_save(images[chip_nb-1], filename,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)</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_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                     iext+1, filename);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>             cpl_propertylist_delete(qc_ext_list);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>             <span class="keywordflow">return</span> -1;</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>         cpl_propertylist_delete(qc_ext_list) ;</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">return</span> 0 ;</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="l00405"></a><span class="lineno">  405</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno"><a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9">  406</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         <span class="keyword">const</span> cpl_table             **  tables,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename)</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_propertylist    *   qc_ext_list ;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_propertylist    *   pro_list ;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordtype">char</span>                    sval[16] ;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keywordtype">int</span>                     chip_nb ;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordtype">int</span>                     iext;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Get a suitable reference frame */</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         <span class="keywordflow">return</span> -1;</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">/* Add the PRO keys */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (applist != NULL) pro_list = cpl_propertylist_duplicate(applist) ;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordflow">else</span> pro_list = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordflow">if</span> (protype != NULL)</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_TYPE, protype) ;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordflow">if</span> (procat != NULL)</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         cpl_propertylist_append_string(pro_list, CPL_DFS_PRO_CATG, procat) ;</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">/* File with extensions */</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keywordflow">if</span> ((applists != NULL) && (applists[0] != NULL))</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         qc_ext_list = cpl_propertylist_duplicate(applists[0]) ;</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>         qc_ext_list = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, <span class="stringliteral">"CHIP1.INT1"</span>) ;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">if</span> (cpl_dfs_save_table(allframes, NULL, parlist, usedframes, NULL, tables[0],</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                 qc_ext_list, recipe, pro_list, NULL, </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                 filename) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                 <span class="stringliteral">"Cannot save the first extension table of file %s"</span>, filename);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>         cpl_propertylist_delete(qc_ext_list) ;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         cpl_propertylist_delete(pro_list) ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         <span class="keywordflow">return</span> -1 ;</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_propertylist_delete(qc_ext_list) ;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_propertylist_delete(pro_list) ;</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="comment">/* Save the extensions */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">for</span> (iext=1 ; iext<HAWKI_NB_DETECTORS; iext++) {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         <span class="comment">/* Get the chip number to store in this extension */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                     <span class="stringliteral">"when writing file %s"</span>, iext+1, filename);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>             <span class="keywordflow">return</span> -1 ;</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> ((applists != NULL) && (applists[chip_nb-1] != NULL))</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>             qc_ext_list = cpl_propertylist_new() ;</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>         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         <span class="keywordflow">if</span>(cpl_table_save(tables[chip_nb-1], NULL, qc_ext_list, filename,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                 CPL_IO_EXTEND) != CPL_ERROR_NONE)</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_error(__func__, <span class="stringliteral">"Cannot save extension %d of table %s"</span>,</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>                     iext+1, filename);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>             cpl_propertylist_delete(qc_ext_list) ;</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> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_propertylist_delete(qc_ext_list) ;</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="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a></div>
+<div class="line"><a name="l00514"></a><span class="lineno"><a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089">  514</a></span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>  <span class="keyword">const</span> hawki_distortion      **  distortion,</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>  <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_x,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_y)</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="keyword">const</span> <span class="keywordtype">char</span>          *   fname ;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     cpl_propertylist    *   pro_list_x;</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     cpl_propertylist    *   pro_list_y;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     cpl_type_bpp            pixeltype ;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     cpl_propertylist    *   qc_ext_list ;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordtype">char</span>                    sval[16] ;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordtype">int</span>                     chip_nb ;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordtype">int</span>                     iext;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">if</span> (allframes == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Get a suitable reference frame */</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">if</span>((fname = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(allframes)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Could not find a suitable reference frame"</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 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="comment">/* Add the PRO keys */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     <span class="keywordflow">if</span>(applist != NULL)</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         pro_list_x = cpl_propertylist_duplicate(applist);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         pro_list_x = cpl_propertylist_new();</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keywordflow">if</span>(applist != NULL) </div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         pro_list_y = cpl_propertylist_duplicate(applist);</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>         pro_list_y = cpl_propertylist_new();</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_propertylist_append_string(pro_list_x, CPL_DFS_PRO_TYPE, </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                                    HAWKI_PROTYPE_DISTORTION_X);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     cpl_propertylist_append_string(pro_list_y, CPL_DFS_PRO_TYPE, </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                                    HAWKI_PROTYPE_DISTORTION_Y);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     cpl_propertylist_append_string(pro_list_x, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                                    HAWKI_CALPRO_DISTORTION_X);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     cpl_propertylist_append_string(pro_list_y, CPL_DFS_PRO_CATG, </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                                    HAWKI_CALPRO_DISTORTION_Y);</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">/* File with extensions */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                 CPL_BPP_IEEE_FLOAT, recipe, pro_list_x, NULL, </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                 filename_x) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                 filename_x);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         cpl_propertylist_delete(pro_list_x);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         cpl_propertylist_delete(pro_list_y);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         <span class="keywordflow">return</span> -1 ;</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> (cpl_dfs_save_image(allframes, NULL, parlist, usedframes, NULL, NULL,</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>                 CPL_BPP_IEEE_FLOAT, recipe, pro_list_y, NULL, </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                 filename_y) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the empty primary HDU of file %s"</span>,</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                 filename_y);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         cpl_propertylist_delete(pro_list_x);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         cpl_propertylist_delete(pro_list_y);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Delete PRO LIST */</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     cpl_propertylist_delete(pro_list_x);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     cpl_propertylist_delete(pro_list_y);</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="comment">/* Get the file type */</span></div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">if</span> (cpl_image_get_type(distortion[0]->dist_x) == CPL_TYPE_INT)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         pixeltype = CPL_BPP_32_SIGNED ;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         pixeltype = CPL_BPP_IEEE_FLOAT ;</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="comment">/* Save the extensions */</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) {</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         <span class="comment">/* Get the chip number to store in this extension */</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         <span class="keywordflow">if</span> ((chip_nb = <a class="code" href="group__hawki__load.html#gac57166de157def8422f2e7e2d12dd756" title="Get the chip to store in the wished extension.">hawki_get_detector_from_ext</a>(fname, iext+1)) == -1) {</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get the chip for extension %d "</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>                     <span class="stringliteral">"when saving %s and %s"</span>, iext+1, filename_x, filename_y);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>             <span class="keywordflow">return</span> -1 ;</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">/* Get the QC list */</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         <span class="keywordflow">if</span> ((applists != NULL) && (applists[chip_nb-1] != NULL))</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>             qc_ext_list = cpl_propertylist_duplicate(applists[chip_nb-1]) ;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>             qc_ext_list = cpl_propertylist_new() ;</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="comment">/* Add the CR* keywords */</span></div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRPIX2"</span>, 1);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CDELT2"</span>,</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>                                         distortion[chip_nb-1]->y_cdelt);</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRVAL2"</span>,</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>                                         distortion[chip_nb-1]->y_crval);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRPIX1"</span>, 1);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CDELT1"</span>,</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>                                         distortion[chip_nb-1]->x_cdelt);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         cpl_propertylist_prepend_double(qc_ext_list, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>                                         distortion[chip_nb-1]->x_crval);</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>         snprintf(sval, 16, <span class="stringliteral">"CHIP%d.INT1"</span>, chip_nb) ;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         cpl_propertylist_prepend_string(qc_ext_list, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         <span class="keywordflow">if</span>(cpl_image_save(distortion[chip_nb-1]->dist_x, filename_x,</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)</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>             cpl_msg_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                     iext+1, filename_x);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             cpl_propertylist_delete(qc_ext_list);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>             <span class="keywordflow">return</span> -1;</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_image_save(distortion[chip_nb-1]->dist_y, filename_y,</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>                 pixeltype, qc_ext_list, CPL_IO_EXTEND) != CPL_ERROR_NONE)</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_msg_error(__func__,<span class="stringliteral">"Cannot save extension %d of file %s"</span>,</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                     iext+1, filename_y);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>             cpl_propertylist_delete(qc_ext_list);</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>             <span class="keywordflow">return</span> -1;</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_delete(qc_ext_list) ;</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">return</span> 0 ;</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="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"><a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536">  656</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">const</span> cpl_frameset * frames [...]
+<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="keywordtype">int</span> iframe;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     * fname = 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="keywordflow">for</span>(iframe = 0 ; iframe < cpl_frameset_get_size(frameset); ++iframe)</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="keyword">const</span> cpl_frame  * frame;</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>         frame = cpl_frameset_get_frame_const(frameset, iframe);</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>         <span class="comment">/* Check that it belongs to the raw frames</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment">         * and then check if there are 4 extensions</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="keywordflow">if</span>(cpl_frame_get_group(frame) == CPL_FRAME_GROUP_RAW &&</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>            cpl_frame_get_nextensions(frame) == HAWKI_NB_DETECTORS)</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>             fname = cpl_frame_get_filename(frame);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>             <span class="keywordflow">return</span> fname;</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">//Now look into the products, in case that there is no actual raw</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="comment">//reference frame. This is kind of a hack for hawki_util_gendist,</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="comment">//which allows to save the distortion images using the distortion</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <span class="comment">//table as a reference</span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keywordflow">for</span>(iframe = 0 ; iframe < cpl_frameset_get_size(frameset); ++iframe)</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="keyword">const</span> cpl_frame  * frame;</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>         frame = cpl_frameset_get_frame_const(frameset, iframe);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         <span class="comment">/* Check that it belongs to the raw frames</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> <span class="comment">         * and then check if there are 4 extensions</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="keywordflow">if</span>(cpl_frame_get_group(frame) == CPL_FRAME_GROUP_PRODUCT &&</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>            cpl_frame_get_nextensions(frame) == HAWKI_NB_DETECTORS)</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>             fname = cpl_frame_get_filename(frame);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>             <span class="keywordflow">return</span> fname;</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">//And if it didn't suceed, use the first frame:</span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     fname = cpl_frame_get_filename(cpl_frameset_get_first_const(frameset));</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">return</span> fname;</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> </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/hawki__save_8h_source.html b/html/hawki__save_8h_source.html
index 8a1d093..865a8fb 100644
--- a/html/hawki__save_8h_source.html
+++ b/html/hawki__save_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_save.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,124 +40,125 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_save.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_save.h,v 1.5 2012/12/05 14:57: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/05 14:57:03 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_SAVE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_SAVE_H</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 "hawki_distortion.h"</span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                Functions prototypes</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 CPL_BEGIN_DECLS
-<a name="l00042"></a>00042 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>
-<a name="l00043"></a>00043 (cpl_frameset                *   allframes,
-<a name="l00044"></a>00044  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00045"></a>00045  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00046"></a>00046  <span class="keyword">const</span> cpl_imagelist         *   images,
-<a name="l00047"></a>00047  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00048"></a>00048  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00049"></a>00049  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00050"></a>00050  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00051"></a>00051  <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00052"></a>00052  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);
-<a name="l00053"></a>00053 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>
-<a name="l00054"></a>00054 (cpl_frameset                *   allframes,
-<a name="l00055"></a>00055  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00056"></a>00056  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00057"></a>00057  <span class="keyword">const</span> cpl_image             **  images,
-<a name="l00058"></a>00058  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00059"></a>00059  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00060"></a>00060  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00061"></a>00061  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00062"></a>00062  <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00063"></a>00063  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);
-<a name="l00064"></a>00064 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>
-<a name="l00065"></a>00065 (cpl_frameset                *   allframes,
-<a name="l00066"></a>00066  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00067"></a>00067  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00068"></a>00068  <span class="keyword">const</span> cpl_table             **  tables,
-<a name="l00069"></a>00069  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00070"></a>00070  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00071"></a>00071  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00072"></a>00072  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00073"></a>00073  <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00074"></a>00074  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);
-<a name="l00075"></a>00075 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a>
-<a name="l00076"></a>00076 (cpl_frameset                *   allframes,
-<a name="l00077"></a>00077  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00078"></a>00078  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00079"></a>00079  <span class="keyword">const</span> hawki_distortion      **  distortion,
-<a name="l00080"></a>00080  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00081"></a>00081  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00082"></a>00082  <span class="keyword">const</span> cpl_propertylist      **  applists,
-<a name="l00083"></a>00083  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_x,
-<a name="l00084"></a>00084  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_y);
-<a name="l00085"></a>00085 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>
-<a name="l00086"></a>00086 (cpl_frameset                *   allframes,
-<a name="l00087"></a>00087  <span class="keyword">const</span> cpl_parameterlist     *   parlist,
-<a name="l00088"></a>00088  <span class="keyword">const</span> cpl_frameset          *   usedframes,
-<a name="l00089"></a>00089  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,
-<a name="l00090"></a>00090  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,
-<a name="l00091"></a>00091  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,
-<a name="l00092"></a>00092  <span class="keyword">const</span> cpl_propertylist      *   applist,
-<a name="l00093"></a>00093  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);
-<a name="l00094"></a>00094 <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>
-<a name="l00095"></a>00095 (<span class="keyword">const</span> cpl_frameset      *   allframes,
-<a name="l00096"></a>00096  <span class="keyword">const</span> cpl_image         *   image,
-<a name="l00097"></a>00097  <span class="keywordtype">int</span>                         iext,
-<a name="l00098"></a>00098  <span class="keyword">const</span> cpl_propertylist  *   ext_prop_list,
-<a name="l00099"></a>00099  <span class="keyword">const</span> <span class="keywordtype">char</span>              *   filename);
-<a name="l00100"></a>00100 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">const</span> cpl_frameset *);
-<a name="l00101"></a>00101 CPL_END_DECLS
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_save.h,v 1.5 2012/12/05 14:57: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/05 14:57:03 $</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: hawki-1_8_12 $</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 HAWKI_SAVE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_SAVE_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="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 "hawki_distortion.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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                Functions prototypes</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>  <span class="keyword">const</span> cpl_imagelist         *   images,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>  <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>  <span class="keyword">const</span> cpl_image             **  images,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>  <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="keyword">const</span> cpl_table             **  tables,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#ga7dd654e4062ef0cf42274ebf274f0089" title="Save a HAWKI_NB_DETECTORS extensions HAWKI distortion images.">hawki_distortion_save</a></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keyword">const</span> hawki_distortion      **  distortion,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  <span class="keyword">const</span> cpl_propertylist      **  applists,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_x,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename_y);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> (cpl_frameset                *   allframes,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>  <span class="keyword">const</span> cpl_parameterlist     *   parlist,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  <span class="keyword">const</span> cpl_frameset          *   usedframes,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   recipe,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   procat,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   protype,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  <span class="keyword">const</span> cpl_propertylist      *   applist,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>                  *   filename);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> (<span class="keyword">const</span> cpl_frameset      *   allframes,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  <span class="keyword">const</span> cpl_image         *   image,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  <span class="keywordtype">int</span>                         iext,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  <span class="keyword">const</span> cpl_propertylist  *   ext_prop_list,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>              *   filename);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">const</span> cpl_frameset *);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> CPL_END_DECLS</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">#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/hawki__sci__jitter_8c_source.html b/html/hawki__sci__jitter_8c_source.html
index 1c23d0b..b78d75d 100644
--- a/html/hawki__sci__jitter_8c_source.html
+++ b/html/hawki__sci__jitter_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_sci_jitter.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,2160 +40,2175 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_sci_jitter.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_sci_jitter.c,v 1.31 2012/12/04 09:41:34 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/04 09:41:34 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.31 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_calib.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_saa.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_bkg.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "hawki_properties_tel.h"</span>
-<a name="l00053"></a>00053 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00054"></a>00054 <span class="preprocessor">#include "hawki_obj_det.h"</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00057"></a>00057 <span class="comment">                                Define</span>
-<a name="l00058"></a>00058 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span>
-<a name="l00063"></a>00063 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00064"></a>00064 <span class="comment">                            Functions prototypes</span>
-<a name="l00065"></a>00065 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00069"></a>00069 <span class="preprocessor">#endif</span>
-<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_create(cpl_plugin *) ;
-<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_exec(cpl_plugin *) ;
-<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_destroy(cpl_plugin *) ;
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_retrieve_input_param
-<a name="l00078"></a>00078 (cpl_parameterlist  *  parlist);
-<a name="l00079"></a>00079 <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_reduce
-<a name="l00080"></a>00080 (cpl_frameset      *   jitters,
-<a name="l00081"></a>00081  cpl_frameset      *   sky,
-<a name="l00082"></a>00082  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   flat,
-<a name="l00083"></a>00083  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   dark,
-<a name="l00084"></a>00084  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   bpm,
-<a name="l00085"></a>00085  cpl_table         **  bkg_stats);
-<a name="l00086"></a>00086 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky
-<a name="l00087"></a>00087 (cpl_imagelist   *   jitters,
-<a name="l00088"></a>00088  cpl_imagelist   *   skys,
-<a name="l00089"></a>00089  cpl_table       **  bkg_stats,
-<a name="l00090"></a>00090  <span class="keywordtype">int</span>                 idet);
-<a name="l00091"></a>00091 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky_running
-<a name="l00092"></a>00092 (cpl_imagelist *  in,
-<a name="l00093"></a>00093  cpl_table     ** bkg_stats,
-<a name="l00094"></a>00094  <span class="keywordtype">int</span>              idet); 
-<a name="l00095"></a>00095 <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_saa(cpl_imagelist **, cpl_bivector *, 
-<a name="l00096"></a>00096         <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *);
-<a name="l00097"></a>00097 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_qc
-<a name="l00098"></a>00098 (cpl_frameset *   science_frames,
-<a name="l00099"></a>00099  cpl_image   **   combined, 
-<a name="l00100"></a>00100  cpl_table   **   obj_charac);
-<a name="l00101"></a>00101 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_read_calib
-<a name="l00102"></a>00102 (<span class="keyword">const</span> <span class="keywordtype">char</span> *  flat,
-<a name="l00103"></a>00103  <span class="keyword">const</span> <span class="keywordtype">char</span> *  dark,
-<a name="l00104"></a>00104  <span class="keyword">const</span> <span class="keywordtype">char</span> *  bpm,
-<a name="l00105"></a>00105  cpl_image  ** flat_image,
-<a name="l00106"></a>00106  cpl_image  ** dark_image,
-<a name="l00107"></a>00107  cpl_image  ** bpm_image,
-<a name="l00108"></a>00108  <span class="keywordtype">int</span>           idet);
-<a name="l00109"></a>00109 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_save
-<a name="l00110"></a>00110 (cpl_image           **  combined,
-<a name="l00111"></a>00111  cpl_image           *   stitched,
-<a name="l00112"></a>00112  cpl_table           **  objs_charac,
-<a name="l00113"></a>00113  cpl_table           **  raw_jitter_stats,
-<a name="l00114"></a>00114  cpl_table           **  bkg_stats,
-<a name="l00115"></a>00115  <span class="keyword">const</span> cpl_table     *   raw_obj_tel_info,
-<a name="l00116"></a>00116  cpl_frameset        *   science_frames,
-<a name="l00117"></a>00117  cpl_frameset        *   calib_frames,
-<a name="l00118"></a>00118  cpl_parameterlist   *   parlist,
-<a name="l00119"></a>00119  cpl_frameset        *   <span class="keyword">set</span>);
-<a name="l00120"></a>00120 <span class="keywordtype">int</span> hawki_sci_jitter_whole_image_algo
-<a name="l00121"></a>00121 (cpl_frameset       *  obj,
-<a name="l00122"></a>00122  cpl_table          ** raw_jitter_stats,
-<a name="l00123"></a>00123  cpl_table          *  raw_obj_tel_info,
-<a name="l00124"></a>00124  cpl_parameterlist  *  parlist,
-<a name="l00125"></a>00125  cpl_frameset       *  recipe_set);
-<a name="l00126"></a>00126 <span class="keywordtype">int</span> hawki_sci_jitter_save_stats
-<a name="l00127"></a>00127 (cpl_table          ** raw_jitter_stats,
-<a name="l00128"></a>00128  cpl_table          *  raw_obj_tel_info,
-<a name="l00129"></a>00129  cpl_frameset       *  jitter_frames,
-<a name="l00130"></a>00130  cpl_parameterlist  *  parlist,
-<a name="l00131"></a>00131  cpl_frameset       *  recipe_set);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00134"></a>00134 <span class="comment">                            Static variables</span>
-<a name="l00135"></a>00135 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 
-<a name="l00137"></a>00137 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00138"></a>00138 {
-<a name="l00139"></a>00139     <span class="comment">/* Inputs */</span>
-<a name="l00140"></a>00140     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   offsets ;
-<a name="l00141"></a>00141     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   objects ;
-<a name="l00142"></a>00142     <span class="keywordtype">int</span>                 offset_max ;
-<a name="l00143"></a>00143     <span class="keywordtype">int</span>                 sky_minnb ;
-<a name="l00144"></a>00144     <span class="keywordtype">int</span>                 sky_halfw ;
-<a name="l00145"></a>00145     <span class="keywordtype">int</span>                 sky_rejmin ;
-<a name="l00146"></a>00146     <span class="keywordtype">int</span>                 sky_rejmax ;
-<a name="l00147"></a>00147     <span class="keywordtype">int</span>                 refine ;
-<a name="l00148"></a>00148     <span class="keywordtype">int</span>                 sx ;
-<a name="l00149"></a>00149     <span class="keywordtype">int</span>                 sy ;
-<a name="l00150"></a>00150     <span class="keywordtype">int</span>                 mx ;
-<a name="l00151"></a>00151     <span class="keywordtype">int</span>                 my ;
-<a name="l00152"></a>00152     <span class="keywordtype">int</span>                 borders ;
-<a name="l00153"></a>00153     cpl_geom_combine    comb_meth ;
-<a name="l00154"></a>00154     <span class="keywordtype">int</span>                 rej_low ;
-<a name="l00155"></a>00155     <span class="keywordtype">int</span>                 rej_high ;
-<a name="l00156"></a>00156     <span class="keywordtype">int</span>                 max_njitter;
-<a name="l00157"></a>00157 } hawki_sci_jitter_config;
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00160"></a>00160 {
-<a name="l00161"></a>00161     <span class="comment">/* Outputs */</span>
-<a name="l00162"></a>00162     <span class="keywordtype">double</span>          pixscale;
-<a name="l00163"></a>00163     <span class="keywordtype">double</span>          dit;
-<a name="l00164"></a>00164     <span class="keywordtype">double</span>          mean_airmass;
-<a name="l00165"></a>00165     <span class="keywordtype">double</span>          iq[HAWKI_NB_DETECTORS];
-<a name="l00166"></a>00166     <span class="keywordtype">int</span>             nbobjs[HAWKI_NB_DETECTORS];
-<a name="l00167"></a>00167     <span class="keywordtype">double</span>          fwhm_pix[HAWKI_NB_DETECTORS];
-<a name="l00168"></a>00168     <span class="keywordtype">double</span>          fwhm_arcsec[HAWKI_NB_DETECTORS];
-<a name="l00169"></a>00169     <span class="keywordtype">double</span>          fwhm_mode[HAWKI_NB_DETECTORS];
-<a name="l00170"></a>00170     <span class="keywordtype">double</span>          combined_pos_x[HAWKI_NB_DETECTORS];
-<a name="l00171"></a>00171     <span class="keywordtype">double</span>          combined_pos_y[HAWKI_NB_DETECTORS];
-<a name="l00172"></a>00172     <span class="keywordtype">double</span>          combined_cumoffset_x[HAWKI_NB_DETECTORS];
-<a name="l00173"></a>00173     <span class="keywordtype">double</span>          combined_cumoffset_y[HAWKI_NB_DETECTORS];
-<a name="l00174"></a>00174     <span class="keywordtype">int</span>             ncomb[HAWKI_NB_DETECTORS];
-<a name="l00175"></a>00175 } hawki_sci_jitter_output;
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_sci_jitter_description[] =
-<a name="l00178"></a>00178 <span class="stringliteral">"hawki_sci_jitter -- hawki imaging jitter recipe.\n\n"</span>
-<a name="l00179"></a>00179 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00180"></a>00180 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00181"></a>00181 <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00182"></a>00182 <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_SKY_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00183"></a>00183 <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span>
-<a name="l00184"></a>00184 <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" \n"</span>
-<a name="l00185"></a>00185 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</span>
-<a name="l00186"></a>00186 <span class="stringliteral">"distortion_x-file.fits "</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">"\n"</span>
-<a name="l00187"></a>00187 <span class="stringliteral">"distortion_y-file.fits "</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">"\n\n"</span>
-<a name="l00188"></a>00188 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00189"></a>00189 <span class="stringliteral">"hawki_sci_jitter.fits ("</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">")\n"</span>
-<a name="l00190"></a>00190 <span class="stringliteral">"hawki_sci_jitter_stitched.fits ("</span>HAWKI_CALPRO_STITCHED<span class="stringliteral">")\n"</span>
-<a name="l00191"></a>00191 <span class="stringliteral">"hawki_sci_jitter_stars.fits ("</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"): Detected objects properties\n"</span>
-<a name="l00192"></a>00192 <span class="stringliteral">"hawki_sci_jitter_stats.fits ("</span>HAWKI_CALPRO_JITTER_STATS<span class="stringliteral">"): Stats of the individual images\n"</span>
-<a name="l00193"></a>00193 <span class="stringliteral">"hawki_sci_jitter_bkg_stats.fits ("</span>HAWKI_CALPRO_JITTER_BKG_STATS<span class="stringliteral">"): Statistics on the bkg\n\n"</span>
-<a name="l00194"></a>00194 <span class="stringliteral">"The recipe performs the following steps:\n"</span>
-<a name="l00195"></a>00195 <span class="stringliteral">"1) Frame statistics\n"</span>
-<a name="l00196"></a>00196 <span class="stringliteral">"2) Basic reduction (using "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" and "</span>HAWKI_CALPRO_BPM<span class="stringliteral">")\n"</span>
-<a name="l00197"></a>00197 <span class="stringliteral">"3) Background computation (the algorithm depends on parameter --sky_par) \n"</span>
-<a name="l00198"></a>00198 <span class="stringliteral">"4) Offset refinement (uses parameters --off, --refine and --xcorr)\n"</span>
-<a name="l00199"></a>00199 <span class="stringliteral">"5) Stacking of jitter frames (uses --comb_meth, --rej,\n"</span>
-<a name="l00200"></a>00200 <span class="stringliteral">"   --offset_max, --borders, --max_njitter)\n"</span>
-<a name="l00201"></a>00201 <span class="stringliteral">"6) Stitching of the four detectors into one image\n"</span>
-<a name="l00202"></a>00202 <span class="stringliteral">"7) Object detection in the stacked image\n\n"</span>
-<a name="l00203"></a>00203 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00204"></a>00204 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00205"></a>00205 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00208"></a>00208 <span class="comment">                                Functions code</span>
-<a name="l00209"></a>00209 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00219"></a>00219 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00220"></a>00220 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00221"></a>00221 {
-<a name="l00222"></a>00222     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00223"></a>00223     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     cpl_plugin_init(plugin,
-<a name="l00226"></a>00226                     CPL_PLUGIN_API,
-<a name="l00227"></a>00227                     HAWKI_BINARY_VERSION,
-<a name="l00228"></a>00228                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00229"></a>00229                     <span class="stringliteral">"hawki_sci_jitter"</span>,
-<a name="l00230"></a>00230                     <span class="stringliteral">"Jitter recipe"</span>,
-<a name="l00231"></a>00231                     hawki_sci_jitter_description,
-<a name="l00232"></a>00232                     <span class="stringliteral">"Cesar Enrique Garcia"</span>,
-<a name="l00233"></a>00233                     PACKAGE_BUGREPORT,
-<a name="l00234"></a>00234                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00235"></a>00235                     hawki_sci_jitter_create,
-<a name="l00236"></a>00236                     hawki_sci_jitter_exec,
-<a name="l00237"></a>00237                     hawki_sci_jitter_destroy) ;
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     cpl_pluginlist_append(list, plugin) ;
-<a name="l00240"></a>00240     
-<a name="l00241"></a>00241     <span class="keywordflow">return</span> 0;
-<a name="l00242"></a>00242 }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00253"></a>00253 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00254"></a>00254 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_create(cpl_plugin * plugin)
-<a name="l00255"></a>00255 {
-<a name="l00256"></a>00256     cpl_recipe      * recipe ;
-<a name="l00257"></a>00257     cpl_parameter   * p ;
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00260"></a>00260     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00261"></a>00261         recipe = (cpl_recipe *)plugin ;
-<a name="l00262"></a>00262     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00265"></a>00265     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00266"></a>00266     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00267"></a>00267         <span class="keywordflow">return</span> 1;
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00270"></a>00270     <span class="comment">/* --offsets */</span>
-<a name="l00271"></a>00271     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.offsets"</span>, 
-<a name="l00272"></a>00272             CPL_TYPE_STRING, <span class="stringliteral">"offsets file"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>, NULL) ;
-<a name="l00273"></a>00273     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"offsets"</span>) ;
-<a name="l00274"></a>00274     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00275"></a>00275     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* --objects */</span>
-<a name="l00278"></a>00278     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.objects"</span>, 
-<a name="l00279"></a>00279             CPL_TYPE_STRING, <span class="stringliteral">"objects file"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>, NULL) ;
-<a name="l00280"></a>00280     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"objects"</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">/* --offset_max */</span>
-<a name="l00285"></a>00285     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.offset_max"</span>,
-<a name="l00286"></a>00286                                 CPL_TYPE_INT,
-<a name="l00287"></a>00287                                 <span class="stringliteral">"Maximum offset allowed"</span>,
-<a name="l00288"></a>00288                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00289"></a>00289                                 1500) ;
-<a name="l00290"></a>00290     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"offset_max"</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">/* --sky_par */</span>
-<a name="l00295"></a>00295     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.sky_par"</span>,
-<a name="l00296"></a>00296                                 CPL_TYPE_STRING,
-<a name="l00297"></a>00297                                 <span class="stringliteral">"Rejection parameters for sky filtering"</span>,
-<a name="l00298"></a>00298                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00299"></a>00299                                 <span class="stringliteral">"10,7,3,3"</span>) ;
-<a name="l00300"></a>00300     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sky_par"</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">/* --refine */</span>
-<a name="l00305"></a>00305     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.refine"</span>,
-<a name="l00306"></a>00306             CPL_TYPE_BOOL, <span class="stringliteral">"refine offsets"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00307"></a>00307             FALSE);
-<a name="l00308"></a>00308     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"refine"</span>) ;
-<a name="l00309"></a>00309     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00310"></a>00310     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     <span class="comment">/* --xcorr */</span>
-<a name="l00313"></a>00313     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.xcorr"</span>,
-<a name="l00314"></a>00314                                 CPL_TYPE_STRING,
-<a name="l00315"></a>00315                                 <span class="stringliteral">"Cross correlation search and measure sizes"</span>,
-<a name="l00316"></a>00316                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00317"></a>00317                                 <span class="stringliteral">"20,20,25,25"</span>) ;
-<a name="l00318"></a>00318     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcorr"</span>) ;
-<a name="l00319"></a>00319     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00320"></a>00320     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="comment">/* --comb_meth */</span>
-<a name="l00323"></a>00323     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.comb_meth"</span>, 
-<a name="l00324"></a>00324             CPL_TYPE_STRING, <span class="stringliteral">"union / inter / first"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00325"></a>00325             <span class="stringliteral">"union"</span>) ;
-<a name="l00326"></a>00326     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"comb_meth"</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">/* --rej */</span>
-<a name="l00331"></a>00331     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.rej"</span>,
-<a name="l00332"></a>00332                                 CPL_TYPE_STRING,
-<a name="l00333"></a>00333                                 <span class="stringliteral">"Low and high number of rejected values"</span>,
-<a name="l00334"></a>00334                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00335"></a>00335                                 <span class="stringliteral">"1,1"</span>) ;
-<a name="l00336"></a>00336     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"rej"</span>) ;
-<a name="l00337"></a>00337     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00338"></a>00338     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="comment">/* --borders */</span>
-<a name="l00341"></a>00341     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.borders"</span>,
-<a name="l00342"></a>00342                                 CPL_TYPE_INT,
-<a name="l00343"></a>00343                                 <span class="stringliteral">"Borders rejected"</span>,
-<a name="l00344"></a>00344                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00345"></a>00345                                 4) ;
-<a name="l00346"></a>00346     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"borders"</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">/* --max_njitter */</span>
-<a name="l00351"></a>00351     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.max_njitter"</span>,
-<a name="l00352"></a>00352                                 CPL_TYPE_INT,
-<a name="l00353"></a>00353                                 <span class="stringliteral">"Maximum numbers of jitter frames to combine"</span>,
-<a name="l00354"></a>00354                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,
-<a name="l00355"></a>00355                                 -1);
-<a name="l00356"></a>00356     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"max_njitter"</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">/* Return */</span>
-<a name="l00361"></a>00361     <span class="keywordflow">return</span> 0;
-<a name="l00362"></a>00362 }
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00370"></a>00370 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00371"></a>00371 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_exec(cpl_plugin * plugin)
-<a name="l00372"></a>00372 {
-<a name="l00373"></a>00373     cpl_recipe  *   recipe ;
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00377"></a>00377         recipe = (cpl_recipe *)plugin ;
-<a name="l00378"></a>00378     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="comment">/* Issue a banner */</span>
-<a name="l00381"></a>00381     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="keywordflow">return</span> hawki_sci_jitter(recipe->parameters, recipe->frames) ;
-<a name="l00384"></a>00384 }
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00392"></a>00392 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00393"></a>00393 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_destroy(cpl_plugin * plugin)
-<a name="l00394"></a>00394 {
-<a name="l00395"></a>00395     cpl_recipe  *   recipe ;
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00398"></a>00398     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00399"></a>00399         recipe = (cpl_recipe *)plugin ;
-<a name="l00400"></a>00400     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00403"></a>00403     <span class="keywordflow">return</span> 0 ;
-<a name="l00404"></a>00404 }
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00413"></a>00413 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00414"></a>00414 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter(
-<a name="l00415"></a>00415         cpl_parameterlist   *   parlist, 
-<a name="l00416"></a>00416         cpl_frameset        *   framelist)
-<a name="l00417"></a>00417 {
-<a name="l00418"></a>00418     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat;
-<a name="l00419"></a>00419     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark;
-<a name="l00420"></a>00420     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm;
-<a name="l00421"></a>00421     <span class="keyword">const</span> cpl_frame *   distx;
-<a name="l00422"></a>00422     <span class="keyword">const</span> cpl_frame *   disty;
-<a name="l00423"></a>00423     cpl_frameset    *   jitterframes ;
-<a name="l00424"></a>00424     cpl_frameset    *   skyframes ;
-<a name="l00425"></a>00425     cpl_frameset    *   science_frames;
-<a name="l00426"></a>00426     cpl_frameset    *   calib_frames;
-<a name="l00427"></a>00427     cpl_image       **  combined ;
-<a name="l00428"></a>00428     cpl_table       **  obj_charac;
-<a name="l00429"></a>00429     cpl_table       **  raw_jitter_stats; 
-<a name="l00430"></a>00430     cpl_table       **  bkg_stats; 
-<a name="l00431"></a>00431     cpl_table       *   raw_obj_tel_info;
-<a name="l00432"></a>00432     cpl_image       *   stitched ;
-<a name="l00433"></a>00433     <span class="keywordtype">int</span>                 i;
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     <span class="comment">/* Initialise */</span>
-<a name="l00436"></a>00436     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00437"></a>00437     {
-<a name="l00438"></a>00438         hawki_sci_jitter_output.iq[i] = -1.0 ;
-<a name="l00439"></a>00439         hawki_sci_jitter_output.nbobjs[i] = -1 ;
-<a name="l00440"></a>00440         hawki_sci_jitter_output.fwhm_pix[i] = -1.0 ;
-<a name="l00441"></a>00441         hawki_sci_jitter_output.fwhm_arcsec[i] = -1.0 ;
-<a name="l00442"></a>00442         hawki_sci_jitter_output.fwhm_mode[i] = -1.0 ;
-<a name="l00443"></a>00443         hawki_sci_jitter_output.combined_pos_x[i] = -1.0 ;
-<a name="l00444"></a>00444         hawki_sci_jitter_output.combined_pos_y[i] = -1.0 ;
-<a name="l00445"></a>00445         hawki_sci_jitter_output.combined_cumoffset_x[i] = -1.0 ;
-<a name="l00446"></a>00446         hawki_sci_jitter_output.combined_cumoffset_y[i] = -1.0 ;
-<a name="l00447"></a>00447     }
-<a name="l00448"></a>00448     hawki_sci_jitter_output.pixscale = -1.0 ;
-<a name="l00449"></a>00449     hawki_sci_jitter_output.dit = -1.0 ;
-<a name="l00450"></a>00450     hawki_sci_jitter_config.offsets = NULL ;
-<a name="l00451"></a>00451     hawki_sci_jitter_config.objects = NULL ;
-<a name="l00452"></a>00452     calib_frames = cpl_frameset_new();
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00455"></a>00455     <span class="keywordflow">if</span>(hawki_sci_jitter_retrieve_input_param(parlist))
-<a name="l00456"></a>00456     {
-<a name="l00457"></a>00457         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00458"></a>00458         cpl_frameset_delete(calib_frames);
-<a name="l00459"></a>00459         <span class="keywordflow">return</span> -1;
-<a name="l00460"></a>00460     }
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00463"></a>00463     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00464"></a>00464         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00465"></a>00465         cpl_frameset_delete(calib_frames);
-<a name="l00466"></a>00466         <span class="keywordflow">return</span> -1 ;
-<a name="l00467"></a>00467     }
-<a name="l00468"></a>00468 
-<a name="l00469"></a>00469     <span class="comment">/* Retrieve calibration data */</span>
-<a name="l00470"></a>00470     flat   = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_FLAT) ;
-<a name="l00471"></a>00471     dark   = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK);
-<a name="l00472"></a>00472     bpm    = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_BPM) ;
-<a name="l00473"></a>00473     distx  = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DISTORTION_X);
-<a name="l00474"></a>00474     disty  = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00475"></a>00475     <span class="keywordflow">if</span>((distx == NULL && disty !=NULL) || (distx != NULL && disty ==NULL))
-<a name="l00476"></a>00476     {
-<a name="l00477"></a>00477         cpl_msg_error(cpl_func, <span class="stringliteral">"Both distortion in X (%s) and Y (%s) must be provided"</span>,
-<a name="l00478"></a>00478                       HAWKI_CALPRO_DISTORTION_X, HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00479"></a>00479         cpl_frameset_delete(calib_frames);
-<a name="l00480"></a>00480         <span class="keywordflow">return</span> -1 ;
-<a name="l00481"></a>00481     }
-<a name="l00482"></a>00482     <span class="keywordflow">if</span>(flat)
-<a name="l00483"></a>00483         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(
-<a name="l00484"></a>00484                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT)));
-<a name="l00485"></a>00485     <span class="keywordflow">if</span>(dark)
-<a name="l00486"></a>00486         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(
-<a name="l00487"></a>00487                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_DARK)));
-<a name="l00488"></a>00488     <span class="keywordflow">if</span>(bpm)
-<a name="l00489"></a>00489         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(
-<a name="l00490"></a>00490                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM)));
-<a name="l00491"></a>00491     <span class="keywordflow">if</span>(distx)
-<a name="l00492"></a>00492     {
-<a name="l00493"></a>00493         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(distx));
-<a name="l00494"></a>00494         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(disty));
-<a name="l00495"></a>00495     }
-<a name="l00496"></a>00496         
-<a name="l00497"></a>00497 
-<a name="l00498"></a>00498     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00499"></a>00499     jitterframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;
-<a name="l00500"></a>00500     <span class="keywordflow">if</span> (jitterframes == NULL) {
-<a name="l00501"></a>00501         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find jitter frames in the input list (%s)"</span>,
-<a name="l00502"></a>00502                       HAWKI_IMG_JITTER_RAW);
-<a name="l00503"></a>00503         cpl_frameset_delete(calib_frames);
-<a name="l00504"></a>00504         <span class="keywordflow">return</span> -1 ;
-<a name="l00505"></a>00505     }
-<a name="l00506"></a>00506     science_frames = cpl_frameset_duplicate(jitterframes);
-<a name="l00507"></a>00507     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_SKY_RAW) ;
-<a name="l00508"></a>00508     <span class="keywordflow">if</span> (skyframes != NULL) 
-<a name="l00509"></a>00509     {
-<a name="l00510"></a>00510         <span class="keywordtype">int</span> isky;
-<a name="l00511"></a>00511         <span class="keywordflow">for</span>(isky = 0; isky< cpl_frameset_get_size(skyframes); ++isky)
-<a name="l00512"></a>00512             cpl_frameset_insert(science_frames, 
-<a name="l00513"></a>00513                     cpl_frame_duplicate(cpl_frameset_get_frame(skyframes, isky)));
-<a name="l00514"></a>00514     }
-<a name="l00515"></a>00515     
-<a name="l00516"></a>00516     <span class="comment">/* Create the statistics table */</span>
-<a name="l00517"></a>00517     raw_jitter_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00518"></a>00518     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00519"></a>00519     {
-<a name="l00520"></a>00520         raw_jitter_stats[i] = cpl_table_new(cpl_frameset_get_size(jitterframes));
-<a name="l00521"></a>00521     }
-<a name="l00522"></a>00522     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_jitter_stats);
-<a name="l00523"></a>00523     bkg_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00524"></a>00524     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00525"></a>00525     {
-<a name="l00526"></a>00526         bkg_stats[i] = cpl_table_new(cpl_frameset_get_size(jitterframes));
-<a name="l00527"></a>00527     }
-<a name="l00528"></a>00528     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(bkg_stats);
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     <span class="comment">/* Create the  telescope statistics parameters from the raw images */</span>
-<a name="l00531"></a>00531     raw_obj_tel_info = cpl_table_new(cpl_frameset_get_size(jitterframes));
-<a name="l00532"></a>00532     <span class="comment">/* Add the proper columns of the pcs table */</span>
-<a name="l00533"></a>00533     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a>(raw_obj_tel_info))
-<a name="l00534"></a>00534     {
-<a name="l00535"></a>00535         cpl_msg_error(cpl_func,<span class="stringliteral">"Could not initialize the pcs table"</span>);
-<a name="l00536"></a>00536         cpl_frameset_delete(jitterframes) ;
-<a name="l00537"></a>00537         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00538"></a>00538         {
-<a name="l00539"></a>00539             cpl_table_delete(raw_jitter_stats[i]) ;
-<a name="l00540"></a>00540             cpl_table_delete(bkg_stats[i]) ;
-<a name="l00541"></a>00541         }
-<a name="l00542"></a>00542         cpl_free(raw_jitter_stats) ;
-<a name="l00543"></a>00543         cpl_free(bkg_stats) ;
-<a name="l00544"></a>00544         cpl_table_delete(raw_obj_tel_info);
-<a name="l00545"></a>00545         <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes) ;
-<a name="l00546"></a>00546         cpl_frameset_delete(calib_frames);
-<a name="l00547"></a>00547         cpl_msg_indent_less() ;
-<a name="l00548"></a>00548         <span class="keywordflow">return</span> -1;
-<a name="l00549"></a>00549     }
-<a name="l00550"></a>00550     
-<a name="l00551"></a>00551     <span class="comment">/* Do the algorithms that need the whole image */</span>
-<a name="l00552"></a>00552     hawki_sci_jitter_whole_image_algo(jitterframes,
-<a name="l00553"></a>00553                                       raw_jitter_stats,
-<a name="l00554"></a>00554                                       raw_obj_tel_info,
-<a name="l00555"></a>00555                                       parlist,
-<a name="l00556"></a>00556                                       framelist);
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558     <span class="comment">/* Apply the reduction */</span>
-<a name="l00559"></a>00559     <span class="comment">/* Do the algorithms that can be applied to subsection of the images */</span>
-<a name="l00560"></a>00560     cpl_msg_info(cpl_func, <span class="stringliteral">"Apply the data combination"</span>) ;
-<a name="l00561"></a>00561     cpl_msg_indent_more() ;
-<a name="l00562"></a>00562     <span class="keywordflow">if</span> ((combined = hawki_sci_jitter_reduce(jitterframes, skyframes, flat, dark,
-<a name="l00563"></a>00563                     bpm, bkg_stats)) == NULL) 
-<a name="l00564"></a>00564     {
-<a name="l00565"></a>00565         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot recombine the data"</span>);
-<a name="l00566"></a>00566         cpl_frameset_delete(jitterframes);
-<a name="l00567"></a>00567         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00568"></a>00568         {
-<a name="l00569"></a>00569             cpl_table_delete(raw_jitter_stats[i]) ;
-<a name="l00570"></a>00570             cpl_table_delete(bkg_stats[i]) ;
-<a name="l00571"></a>00571         }
-<a name="l00572"></a>00572         cpl_free(raw_jitter_stats) ;
-<a name="l00573"></a>00573         cpl_free(bkg_stats) ;
-<a name="l00574"></a>00574         cpl_table_delete(raw_obj_tel_info);
-<a name="l00575"></a>00575         <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes) ;
-<a name="l00576"></a>00576         cpl_frameset_delete(calib_frames);
-<a name="l00577"></a>00577         cpl_msg_indent_less() ;
-<a name="l00578"></a>00578         <span class="keywordflow">return</span> -1 ;
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580     cpl_msg_indent_less() ;
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582     <span class="comment">/* Compute QC parameters from the combined image */</span>
-<a name="l00583"></a>00583     cpl_msg_info(cpl_func, <span class="stringliteral">"Compute QC parameters from the combined images"</span>) ;
-<a name="l00584"></a>00584     cpl_msg_indent_more() ;
-<a name="l00585"></a>00585     obj_charac = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*)) ;
-<a name="l00586"></a>00586     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00587"></a>00587     {
-<a name="l00588"></a>00588         obj_charac[i] = cpl_table_new(0);
-<a name="l00589"></a>00589     }
-<a name="l00590"></a>00590     <span class="keywordflow">if</span> ((hawki_sci_jitter_qc(jitterframes, combined, obj_charac)) != 0)
-<a name="l00591"></a>00591     {
-<a name="l00592"></a>00592         cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot compute all parameters"</span>) ;
-<a name="l00593"></a>00593     }
-<a name="l00594"></a>00594     cpl_msg_indent_less();
-<a name="l00595"></a>00595     cpl_frameset_delete(jitterframes);
-<a name="l00596"></a>00596     <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes);
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598  
-<a name="l00599"></a>00599     <span class="comment">/* Correct for the distortion */</span>
-<a name="l00600"></a>00600     <span class="keywordflow">if</span> (distx && disty)
-<a name="l00601"></a>00601     {
-<a name="l00602"></a>00602         cpl_msg_info(cpl_func, <span class="stringliteral">"Applying the distortion correction"</span>) ;
-<a name="l00603"></a>00603         cpl_msg_indent_more() ;
-<a name="l00604"></a>00604         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a>(combined, distx, disty) == -1) 
-<a name="l00605"></a>00605         {
-<a name="l00606"></a>00606             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot correct the distortion"</span>) ;
-<a name="l00607"></a>00607             <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00608"></a>00608                 cpl_image_delete(combined[i]) ;
-<a name="l00609"></a>00609             cpl_free(combined) ;
-<a name="l00610"></a>00610             <span class="keywordflow">if</span> (obj_charac) {
-<a name="l00611"></a>00611                 <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00612"></a>00612                     cpl_table_delete(obj_charac[i]) ;
-<a name="l00613"></a>00613                 cpl_free(obj_charac);
-<a name="l00614"></a>00614             }
-<a name="l00615"></a>00615             cpl_table_delete(raw_obj_tel_info);
-<a name="l00616"></a>00616             <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00617"></a>00617             {
-<a name="l00618"></a>00618                 cpl_table_delete(raw_jitter_stats[i]);
-<a name="l00619"></a>00619                 cpl_table_delete(bkg_stats[i]);
-<a name="l00620"></a>00620             }
-<a name="l00621"></a>00621             cpl_free(raw_jitter_stats);
-<a name="l00622"></a>00622             cpl_free(bkg_stats);
-<a name="l00623"></a>00623             cpl_frameset_delete(calib_frames);
-<a name="l00624"></a>00624             cpl_frameset_delete(science_frames);
-<a name="l00625"></a>00625             cpl_msg_indent_less() ;
-<a name="l00626"></a>00626             <span class="keywordflow">return</span> -1;
-<a name="l00627"></a>00627         }
-<a name="l00628"></a>00628         cpl_msg_indent_less() ;
-<a name="l00629"></a>00629     }
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     <span class="comment">/* Compute the stitched image */</span>
-<a name="l00632"></a>00632     cpl_msg_info(cpl_func, <span class="stringliteral">"Compute the stiched image"</span>) ;
-<a name="l00633"></a>00633     <span class="keywordflow">if</span> ((stitched = <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>(combined, 
-<a name="l00634"></a>00634                     hawki_sci_jitter_output.combined_pos_x,
-<a name="l00635"></a>00635                     hawki_sci_jitter_output.combined_pos_y)) == NULL)
-<a name="l00636"></a>00636     {
-<a name="l00637"></a>00637         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot stitch the images"</span>) ;
-<a name="l00638"></a>00638         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00639"></a>00639             cpl_image_delete(combined[i]) ;
-<a name="l00640"></a>00640         cpl_free(combined) ;
-<a name="l00641"></a>00641         <span class="keywordflow">if</span> (obj_charac) {
-<a name="l00642"></a>00642             <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00643"></a>00643                 cpl_table_delete(obj_charac[i]) ;
-<a name="l00644"></a>00644             cpl_free(obj_charac);
-<a name="l00645"></a>00645         }
-<a name="l00646"></a>00646         cpl_table_delete(raw_obj_tel_info);
-<a name="l00647"></a>00647         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00648"></a>00648         {
-<a name="l00649"></a>00649             cpl_table_delete(raw_jitter_stats[i]);
-<a name="l00650"></a>00650             cpl_table_delete(bkg_stats[i]);
-<a name="l00651"></a>00651         }
-<a name="l00652"></a>00652         cpl_free(raw_jitter_stats);
-<a name="l00653"></a>00653         cpl_free(bkg_stats);
-<a name="l00654"></a>00654         cpl_frameset_delete(calib_frames);
-<a name="l00655"></a>00655         cpl_frameset_delete(science_frames);
-<a name="l00656"></a>00656         <span class="keywordflow">return</span> -1;
-<a name="l00657"></a>00657     }
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     <span class="comment">/* Save the products */</span>
-<a name="l00660"></a>00660     cpl_msg_info(cpl_func, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00661"></a>00661     cpl_msg_indent_more() ;
-<a name="l00662"></a>00662     <span class="keywordflow">if</span> (hawki_sci_jitter_save(combined, stitched, obj_charac,
-<a name="l00663"></a>00663                               raw_jitter_stats, bkg_stats, 
-<a name="l00664"></a>00664                               raw_obj_tel_info,
-<a name="l00665"></a>00665                               science_frames,
-<a name="l00666"></a>00666                               calib_frames,
-<a name="l00667"></a>00667                               parlist, framelist) == -1)
-<a name="l00668"></a>00668         cpl_msg_warning(cpl_func,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00669"></a>00669                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00670"></a>00670     
-<a name="l00671"></a>00671     <span class="comment">/* Return */</span>
-<a name="l00672"></a>00672     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00673"></a>00673         cpl_image_delete(combined[i]) ;
-<a name="l00674"></a>00674     cpl_free(combined) ;
-<a name="l00675"></a>00675     <span class="keywordflow">if</span> (obj_charac) {
-<a name="l00676"></a>00676         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00677"></a>00677             cpl_table_delete(obj_charac[i]) ;
-<a name="l00678"></a>00678         cpl_free(obj_charac);
-<a name="l00679"></a>00679     }
-<a name="l00680"></a>00680     <span class="keywordflow">if</span> (stitched) cpl_image_delete(stitched) ;
-<a name="l00681"></a>00681     cpl_table_delete(raw_obj_tel_info);
-<a name="l00682"></a>00682     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00683"></a>00683     {
-<a name="l00684"></a>00684         cpl_table_delete(raw_jitter_stats[i]);
-<a name="l00685"></a>00685         cpl_table_delete(bkg_stats[i]);
-<a name="l00686"></a>00686     }
-<a name="l00687"></a>00687     cpl_free(raw_jitter_stats);
-<a name="l00688"></a>00688     cpl_free(bkg_stats);
-<a name="l00689"></a>00689     cpl_frameset_delete(calib_frames);
-<a name="l00690"></a>00690     cpl_frameset_delete(science_frames);
-<a name="l00691"></a>00691     cpl_msg_indent_less() ;
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693     <span class="comment">/* Return */</span>
-<a name="l00694"></a>00694     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00695"></a>00695     {
-<a name="l00696"></a>00696         cpl_msg_error(cpl_func,
-<a name="l00697"></a>00697                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00698"></a>00698         <span class="keywordflow">return</span> -1 ;
-<a name="l00699"></a>00699     }
-<a name="l00700"></a>00700     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00701"></a>00701 }
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703 <span class="keywordtype">int</span> hawki_sci_jitter_retrieve_input_param
-<a name="l00704"></a>00704 (cpl_parameterlist  *  parlist)
-<a name="l00705"></a>00705 {
-<a name="l00706"></a>00706     cpl_parameter   *   par ;
-<a name="l00707"></a>00707     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;
-<a name="l00708"></a>00708     par = NULL ;
-<a name="l00709"></a>00709     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.offsets"</span>);
-<a name="l00710"></a>00710     hawki_sci_jitter_config.offsets = cpl_parameter_get_string(par);
-<a name="l00711"></a>00711     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.objects"</span>);
-<a name="l00712"></a>00712     hawki_sci_jitter_config.objects = cpl_parameter_get_string(par);
-<a name="l00713"></a>00713     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.offset_max"</span>);
-<a name="l00714"></a>00714     hawki_sci_jitter_config.offset_max = cpl_parameter_get_int(par);
-<a name="l00715"></a>00715     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.sky_par"</span>);
-<a name="l00716"></a>00716     sval = cpl_parameter_get_string(par);
-<a name="l00717"></a>00717     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,
-<a name="l00718"></a>00718                &hawki_sci_jitter_config.sky_minnb,
-<a name="l00719"></a>00719                &hawki_sci_jitter_config.sky_halfw,
-<a name="l00720"></a>00720                &hawki_sci_jitter_config.sky_rejmin,
-<a name="l00721"></a>00721                &hawki_sci_jitter_config.sky_rejmax)!=4)
-<a name="l00722"></a>00722     {
-<a name="l00723"></a>00723         <span class="keywordflow">return</span> -1;
-<a name="l00724"></a>00724     }
-<a name="l00725"></a>00725     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.xcorr"</span>);
-<a name="l00726"></a>00726     sval = cpl_parameter_get_string(par);
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,
-<a name="l00728"></a>00728                &hawki_sci_jitter_config.sx,
-<a name="l00729"></a>00729                &hawki_sci_jitter_config.sy,
-<a name="l00730"></a>00730                &hawki_sci_jitter_config.mx,
-<a name="l00731"></a>00731                &hawki_sci_jitter_config.my)!=4)
-<a name="l00732"></a>00732     {
-<a name="l00733"></a>00733         <span class="keywordflow">return</span> -1;
-<a name="l00734"></a>00734     }
-<a name="l00735"></a>00735     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.refine"</span>);
-<a name="l00736"></a>00736     hawki_sci_jitter_config.refine = cpl_parameter_get_bool(par);
-<a name="l00737"></a>00737     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.comb_meth"</span>);
-<a name="l00738"></a>00738     sval = cpl_parameter_get_string(par);
-<a name="l00739"></a>00739     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"union"</span>))
-<a name="l00740"></a>00740     hawki_sci_jitter_config.comb_meth = CPL_GEOM_UNION;
-<a name="l00741"></a>00741     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"inter"</span>))
-<a name="l00742"></a>00742     hawki_sci_jitter_config.comb_meth = CPL_GEOM_INTERSECT;
-<a name="l00743"></a>00743     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"first"</span>))
-<a name="l00744"></a>00744     hawki_sci_jitter_config.comb_meth = CPL_GEOM_FIRST;
-<a name="l00745"></a>00745     <span class="keywordflow">else</span>
-<a name="l00746"></a>00746     {
-<a name="l00747"></a>00747         cpl_msg_error(cpl_func, <span class="stringliteral">"Invalid combine method specified"</span>);
-<a name="l00748"></a>00748         <span class="keywordflow">return</span> -1;
-<a name="l00749"></a>00749     }
-<a name="l00750"></a>00750     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.borders"</span>);
-<a name="l00751"></a>00751     hawki_sci_jitter_config.borders = cpl_parameter_get_int(par);
-<a name="l00752"></a>00752     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.rej"</span>);
-<a name="l00753"></a>00753     sval = cpl_parameter_get_string(par);
-<a name="l00754"></a>00754     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d"</span>,
-<a name="l00755"></a>00755                &hawki_sci_jitter_config.rej_low,
-<a name="l00756"></a>00756                &hawki_sci_jitter_config.rej_high)!=2)
-<a name="l00757"></a>00757     {
-<a name="l00758"></a>00758         <span class="keywordflow">return</span> -1;
-<a name="l00759"></a>00759     }
-<a name="l00760"></a>00760     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.max_njitter"</span>);
-<a name="l00761"></a>00761     hawki_sci_jitter_config.max_njitter = cpl_parameter_get_int(par);
-<a name="l00762"></a>00762     <span class="keywordflow">return</span> 0;
-<a name="l00763"></a>00763 }
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766 
-<a name="l00767"></a>00767 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00778"></a>00778 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00779"></a>00779 <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_reduce
-<a name="l00780"></a>00780 (cpl_frameset      *   jitters,
-<a name="l00781"></a>00781  cpl_frameset      *   sky,
-<a name="l00782"></a>00782  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   flat,
-<a name="l00783"></a>00783  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   dark,
-<a name="l00784"></a>00784  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   bpm,
-<a name="l00785"></a>00785  cpl_table         **  bkg_stats)
-<a name="l00786"></a>00786 {
-<a name="l00787"></a>00787     cpl_frame           *   frame ;
-<a name="l00788"></a>00788     cpl_propertylist    *   plist ;
-<a name="l00789"></a>00789     cpl_image           **  comb_chip ;
-<a name="l00790"></a>00790     cpl_image           **  combined ;
-<a name="l00791"></a>00791     cpl_bivector        *   offsets ;
-<a name="l00792"></a>00792     cpl_vector          *   offset_x_sort; 
-<a name="l00793"></a>00793     cpl_vector          *   offset_y_sort; 
-<a name="l00794"></a>00794     <span class="keywordtype">double</span>              *   offs_est_x ;
-<a name="l00795"></a>00795     <span class="keywordtype">double</span>              *   offs_est_y ;
-<a name="l00796"></a>00796     <span class="keywordtype">double</span>                  off_0_x;
-<a name="l00797"></a>00797     <span class="keywordtype">double</span>                  off_0_y;
-<a name="l00798"></a>00798     <span class="keywordtype">double</span>                  max_x, max_y ;
-<a name="l00799"></a>00799     <span class="keywordtype">int</span>                     idet;
-<a name="l00800"></a>00800     <span class="keywordtype">int</span>                     ioff;
-<a name="l00801"></a>00801     
-<a name="l00802"></a>00802     <span class="comment">/* Get the header infos */</span>
-<a name="l00803"></a>00803     frame = cpl_frameset_get_frame(jitters, 0) ;
-<a name="l00804"></a>00804     plist=cpl_propertylist_load(cpl_frame_get_filename(frame), 0) ;
-<a name="l00805"></a>00805     hawki_sci_jitter_output.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist) ;
-<a name="l00806"></a>00806     hawki_sci_jitter_output.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;
-<a name="l00807"></a>00807     cpl_propertylist_delete(plist) ;
-<a name="l00808"></a>00808     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00809"></a>00809         cpl_msg_error(cpl_func, <span class="stringliteral">"Missing keyword in FITS header"</span>) ;
-<a name="l00810"></a>00810         <span class="keywordflow">return</span> NULL ;
-<a name="l00811"></a>00811     }
-<a name="l00812"></a>00812 
-<a name="l00813"></a>00813     <span class="comment">/* Check that DIT/NDIT and NDSAMPLES are the same for all the frames */</span>
-<a name="l00814"></a>00814     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>) ||
-<a name="l00815"></a>00815        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>)||
-<a name="l00816"></a>00816        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>))
-<a name="l00817"></a>00817     {
-<a name="l00818"></a>00818         cpl_msg_error(__func__, <span class="stringliteral">"Not all input science have the same "</span>
-<a name="l00819"></a>00819                 <span class="stringliteral">"DIT/NDIT/NDSAMPLES values"</span>);
-<a name="l00820"></a>00820         cpl_msg_indent_less() ;
-<a name="l00821"></a>00821         <span class="keywordflow">return</span> NULL;        
-<a name="l00822"></a>00822     }
-<a name="l00823"></a>00823     
-<a name="l00824"></a>00824     <span class="comment">/* Get the offsets */</span>
-<a name="l00825"></a>00825     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(jitters)) == NULL) {
-<a name="l00826"></a>00826         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load the offsets"</span>) ;
-<a name="l00827"></a>00827         <span class="keywordflow">return</span> NULL ;
-<a name="l00828"></a>00828     }
-<a name="l00829"></a>00829     offs_est_x = cpl_bivector_get_x_data(offsets) ;
-<a name="l00830"></a>00830     offs_est_y = cpl_bivector_get_y_data(offsets) ;
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832     <span class="comment">/* Print the header offsets */</span>
-<a name="l00833"></a>00833     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets) ; ioff++) {
-<a name="l00834"></a>00834         cpl_msg_info(cpl_func, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,
-<a name="l00835"></a>00835                 offs_est_x[ioff], offs_est_y[ioff]) ;
-<a name="l00836"></a>00836     }
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     <span class="comment">/* Subtract the first offset to all offsets */</span>
-<a name="l00839"></a>00839     off_0_x = -offs_est_x[0]; <span class="comment">// This is to get the cpl convention</span>
-<a name="l00840"></a>00840     off_0_y = -offs_est_y[0];
-<a name="l00841"></a>00841     <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(offsets) ; ioff++) 
-<a name="l00842"></a>00842     {
-<a name="l00843"></a>00843         offs_est_x[ioff] -= offs_est_x[0] ;
-<a name="l00844"></a>00844         offs_est_y[ioff] -= offs_est_y[0] ;
-<a name="l00845"></a>00845     }
-<a name="l00846"></a>00846     offs_est_x[0] = offs_est_y[0] = 0.00 ;
-<a name="l00847"></a>00847 
-<a name="l00848"></a>00848     <span class="comment">/* Check if the max offset is not too big */</span>
-<a name="l00849"></a>00849     <span class="comment">/* The criteria is that for a given frame, the closest frame cannot be </span>
-<a name="l00850"></a>00850 <span class="comment">     * further than hawki_sci_jitter_config.offset_max (in both dimensions) */</span>
-<a name="l00851"></a>00851     offset_x_sort = cpl_vector_duplicate(cpl_bivector_get_x(offsets));
-<a name="l00852"></a>00852     offset_y_sort = cpl_vector_duplicate(cpl_bivector_get_y(offsets));
-<a name="l00853"></a>00853     cpl_vector_sort(offset_x_sort, +1);
-<a name="l00854"></a>00854     cpl_vector_sort(offset_y_sort, +1);
-<a name="l00855"></a>00855     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets) - 1 ; ioff++)
-<a name="l00856"></a>00856     {
-<a name="l00857"></a>00857         <span class="keywordtype">double</span> diff_x, diff_y;
-<a name="l00858"></a>00858         diff_x = cpl_vector_get(offset_x_sort,ioff+1)-cpl_vector_get(offset_x_sort,ioff);
-<a name="l00859"></a>00859         cpl_vector_set(offset_x_sort, ioff, diff_x);
-<a name="l00860"></a>00860         diff_y = cpl_vector_get(offset_y_sort,ioff+1)-cpl_vector_get(offset_y_sort,ioff);
-<a name="l00861"></a>00861         cpl_vector_set(offset_y_sort, ioff, diff_y);
-<a name="l00862"></a>00862     }
-<a name="l00863"></a>00863     cpl_vector_set(offset_x_sort, cpl_bivector_get_size(offsets)-1, 0.);
-<a name="l00864"></a>00864     cpl_vector_set(offset_y_sort, cpl_bivector_get_size(offsets)-1, 0.);
-<a name="l00865"></a>00865     max_x = cpl_vector_get_max(offset_x_sort);
-<a name="l00866"></a>00866     max_y = cpl_vector_get_max(offset_y_sort);
-<a name="l00867"></a>00867     cpl_vector_delete(offset_x_sort);
-<a name="l00868"></a>00868     cpl_vector_delete(offset_y_sort);
-<a name="l00869"></a>00869     
-<a name="l00870"></a>00870     <span class="keywordflow">if</span> (max_x > hawki_sci_jitter_config.offset_max || 
-<a name="l00871"></a>00871         max_y > hawki_sci_jitter_config.offset_max) 
-<a name="l00872"></a>00872     {
-<a name="l00873"></a>00873         cpl_msg_error(cpl_func, <span class="stringliteral">"Sorry, no support for frames further than %d from its closest neighbour"</span>,
-<a name="l00874"></a>00874                 hawki_sci_jitter_config.offset_max) ;
-<a name="l00875"></a>00875         cpl_bivector_delete(offsets);
-<a name="l00876"></a>00876         <span class="keywordflow">return</span> NULL ;
-<a name="l00877"></a>00877     }
-<a name="l00878"></a>00878     
-<a name="l00879"></a>00879     <span class="comment">/* Create output object */</span>
-<a name="l00880"></a>00880     combined = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_image*)) ;
-<a name="l00881"></a>00881   
-<a name="l00882"></a>00882     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00883"></a>00883     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00884"></a>00884     {
-<a name="l00885"></a>00885         cpl_frameset  *  selected_jitter;
-<a name="l00886"></a>00886         cpl_bivector  *  selected_offsets;
-<a name="l00887"></a>00887         cpl_image     *  flat_ima = NULL;
-<a name="l00888"></a>00888         cpl_image     *  dark_ima = NULL;
-<a name="l00889"></a>00889         cpl_image     *  bpm_ima = NULL;
-<a name="l00890"></a>00890         cpl_imagelist *  in = NULL;
-<a name="l00891"></a>00891         cpl_imagelist *  in_sky = NULL;
-<a name="l00892"></a>00892         <span class="keywordtype">int</span>              nrejected;
-<a name="l00893"></a>00893         
-<a name="l00894"></a>00894         cpl_msg_info(cpl_func, <span class="stringliteral">"Combine chip number %d"</span>, idet+1) ;
-<a name="l00895"></a>00895         cpl_msg_indent_more() ;
-<a name="l00896"></a>00896         
-<a name="l00897"></a>00897         <span class="comment">/* Apply frame selection based on offset values */</span>
-<a name="l00898"></a>00898         selected_jitter     = cpl_frameset_duplicate(jitters);
-<a name="l00899"></a>00899         selected_offsets = cpl_bivector_duplicate(offsets);
-<a name="l00900"></a>00900         <span class="keywordflow">if</span>(hawki_sci_jitter_config.max_njitter != -1)
-<a name="l00901"></a>00901         {
-<a name="l00902"></a>00902             <span class="keywordflow">if</span>(hawki_sci_jitter_config.max_njitter <
-<a name="l00903"></a>00903                     cpl_frameset_get_size(selected_jitter))
-<a name="l00904"></a>00904             {
-<a name="l00905"></a>00905                 <span class="keywordflow">while</span>(cpl_frameset_get_size(selected_jitter) >
-<a name="l00906"></a>00906                       hawki_sci_jitter_config.max_njitter)
-<a name="l00907"></a>00907                 {
-<a name="l00908"></a>00908                     <span class="keywordtype">int</span> irm = cpl_frameset_get_size(selected_jitter) - 1;
-<a name="l00909"></a>00909                     cpl_frameset_erase_frame
-<a name="l00910"></a>00910                         (selected_jitter,
-<a name="l00911"></a>00911                          cpl_frameset_get_frame(selected_jitter,irm));
-<a name="l00912"></a>00912                 }
-<a name="l00913"></a>00913                 cpl_vector_set_size(cpl_bivector_get_x(selected_offsets),
-<a name="l00914"></a>00914                                     hawki_sci_jitter_config.max_njitter);
-<a name="l00915"></a>00915                 cpl_vector_set_size(cpl_bivector_get_y(selected_offsets),
-<a name="l00916"></a>00916                                     hawki_sci_jitter_config.max_njitter);
-<a name="l00917"></a>00917             }
-<a name="l00918"></a>00918         }
-<a name="l00919"></a>00919         hawki_sci_jitter_output.ncomb[idet] = 
-<a name="l00920"></a>00920             cpl_frameset_get_size(selected_jitter);
-<a name="l00921"></a>00921         nrejected = cpl_frameset_get_size(selected_jitter) - 
-<a name="l00922"></a>00922             cpl_frameset_get_size(jitters);
-<a name="l00923"></a>00923         <span class="keywordflow">if</span>(nrejected != 0)
-<a name="l00924"></a>00924             cpl_msg_info(cpl_func,<span class="stringliteral">"%d frames reject due to large offsets"</span>, 
-<a name="l00925"></a>00925                          nrejected); 
-<a name="l00926"></a>00926                 
-<a name="l00927"></a>00927         
-<a name="l00928"></a>00928         <span class="comment">/* Load the input data */</span>
-<a name="l00929"></a>00929         cpl_msg_info(cpl_func, <span class="stringliteral">"Load the input data"</span>) ;
-<a name="l00930"></a>00930         cpl_msg_indent_more() ;
-<a name="l00931"></a>00931         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(selected_jitter,
-<a name="l00932"></a>00932                                   idet+1, CPL_TYPE_FLOAT)) == NULL) {
-<a name="l00933"></a>00933             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;
-<a name="l00934"></a>00934             cpl_free(combined) ;
-<a name="l00935"></a>00935             cpl_bivector_delete(offsets) ;
-<a name="l00936"></a>00936             cpl_msg_indent_less() ;
-<a name="l00937"></a>00937             cpl_msg_indent_less() ;
-<a name="l00938"></a>00938             <span class="keywordflow">return</span> NULL ;
-<a name="l00939"></a>00939         }
-<a name="l00940"></a>00940         <span class="keywordflow">if</span> (sky) {
-<a name="l00941"></a>00941             <span class="keywordflow">if</span> ((in_sky = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(sky, idet+1, CPL_TYPE_FLOAT)) == NULL) 
-<a name="l00942"></a>00942             {
-<a name="l00943"></a>00943                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot load sky for chip %d"</span>,idet+1);
-<a name="l00944"></a>00944             }
-<a name="l00945"></a>00945         } <span class="keywordflow">else</span> in_sky = NULL ;
-<a name="l00946"></a>00946         cpl_msg_indent_less() ;
-<a name="l00947"></a>00947 
-<a name="l00948"></a>00948         <span class="comment">/* Read the calibrations */</span>
-<a name="l00949"></a>00949         cpl_msg_info(cpl_func, <span class="stringliteral">"Load the calibration data"</span>) ;
-<a name="l00950"></a>00950         <span class="keywordflow">if</span>(hawki_sci_jitter_read_calib(flat, dark, bpm,
-<a name="l00951"></a>00951                                        &flat_ima, &dark_ima, &bpm_ima,
-<a name="l00952"></a>00952                                        idet) != 0)
-<a name="l00953"></a>00953         {
-<a name="l00954"></a>00954             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot read some of the calibrations"</span>);
-<a name="l00955"></a>00955             cpl_imagelist_delete(in);
-<a name="l00956"></a>00956             cpl_free(combined);
-<a name="l00957"></a>00957             <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky);
-<a name="l00958"></a>00958             cpl_bivector_delete(offsets);
-<a name="l00959"></a>00959             cpl_msg_indent_less();
-<a name="l00960"></a>00960             cpl_msg_indent_less();
-<a name="l00961"></a>00961             <span class="keywordflow">return</span> NULL ;
-<a name="l00962"></a>00962         }
-<a name="l00963"></a>00963         
-<a name="l00964"></a>00964         <span class="comment">/* Apply the calibrations */</span>
-<a name="l00965"></a>00965         <span class="keywordflow">if</span> (flat || dark || bpm ) 
-<a name="l00966"></a>00966         {
-<a name="l00967"></a>00967             cpl_msg_info(cpl_func, <span class="stringliteral">"Apply the calibrations"</span>) ;
-<a name="l00968"></a>00968             cpl_msg_indent_more() ;
-<a name="l00969"></a>00969             <span class="comment">/* Basic calibration of the OBJECTS */</span>
-<a name="l00970"></a>00970             <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>
-<a name="l00971"></a>00971                     (in, flat_ima, dark_ima, bpm_ima) == -1) 
-<a name="l00972"></a>00972             {
-<a name="l00973"></a>00973                 cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot calibrate the objects"</span>) ;
-<a name="l00974"></a>00974                 cpl_imagelist_delete(in) ;
-<a name="l00975"></a>00975                 cpl_free(combined) ;
-<a name="l00976"></a>00976                 <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky) ;
-<a name="l00977"></a>00977                 cpl_bivector_delete(offsets) ;
-<a name="l00978"></a>00978                 cpl_image_delete(flat_ima);
-<a name="l00979"></a>00979                 cpl_image_delete(dark_ima);
-<a name="l00980"></a>00980                 cpl_image_delete(bpm_ima);
-<a name="l00981"></a>00981                 cpl_msg_indent_less() ;
-<a name="l00982"></a>00982                 cpl_msg_indent_less() ;
-<a name="l00983"></a>00983                 <span class="keywordflow">return</span> NULL ;
-<a name="l00984"></a>00984             }
-<a name="l00985"></a>00985             <span class="comment">/* Basic calibration of the SKY */</span>
-<a name="l00986"></a>00986             <span class="keywordflow">if</span> (in_sky) {
-<a name="l00987"></a>00987                 <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a>
-<a name="l00988"></a>00988                         (in_sky, flat_ima, dark_ima, bpm_ima) == -1) 
-<a name="l00989"></a>00989                 {
-<a name="l00990"></a>00990                     cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot calibrate the sky"</span>) ;
-<a name="l00991"></a>00991                     cpl_imagelist_delete(in_sky) ;
-<a name="l00992"></a>00992                     in_sky = NULL ;
-<a name="l00993"></a>00993                 }
-<a name="l00994"></a>00994             }
-<a name="l00995"></a>00995             cpl_msg_indent_less() ;
-<a name="l00996"></a>00996         }
-<a name="l00997"></a>00997         cpl_image_delete(flat_ima);
-<a name="l00998"></a>00998         cpl_image_delete(dark_ima);
-<a name="l00999"></a>00999         cpl_image_delete(bpm_ima);
-<a name="l01000"></a>01000 
-<a name="l01001"></a>01001         <span class="comment">/* Apply the sky correction */</span>
-<a name="l01002"></a>01002         cpl_msg_info(cpl_func, <span class="stringliteral">"Sky estimation and correction"</span>) ;
-<a name="l01003"></a>01003         cpl_msg_indent_more() ;
-<a name="l01004"></a>01004         <span class="keywordflow">if</span> (hawki_sci_jitter_sky(in, in_sky, bkg_stats, idet) == -1)
-<a name="l01005"></a>01005         {
-<a name="l01006"></a>01006             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot estimate the sky"</span>) ;
-<a name="l01007"></a>01007             cpl_imagelist_delete(in) ;
-<a name="l01008"></a>01008             <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky) ;
-<a name="l01009"></a>01009             cpl_free(combined) ;
-<a name="l01010"></a>01010             cpl_bivector_delete(offsets) ;
-<a name="l01011"></a>01011             cpl_msg_indent_less() ;
-<a name="l01012"></a>01012             cpl_msg_indent_less() ;
-<a name="l01013"></a>01013             <span class="keywordflow">return</span> NULL ;
-<a name="l01014"></a>01014         }
-<a name="l01015"></a>01015         <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky) ;
-<a name="l01016"></a>01016         cpl_msg_indent_less() ;
-<a name="l01017"></a>01017     
-<a name="l01018"></a>01018         <span class="comment">/* Apply the shift and add */</span>
-<a name="l01019"></a>01019         cpl_msg_info(cpl_func, <span class="stringliteral">"Shift and stacking"</span>) ;
-<a name="l01020"></a>01020         cpl_msg_indent_more() ;
-<a name="l01021"></a>01021         comb_chip = hawki_sci_jitter_saa(&in, selected_offsets, 
-<a name="l01022"></a>01022                 &(hawki_sci_jitter_output.combined_pos_x[idet]),
-<a name="l01023"></a>01023                 &(hawki_sci_jitter_output.combined_pos_y[idet])) ;
-<a name="l01024"></a>01024         hawki_sci_jitter_output.combined_cumoffset_x[idet] = 
-<a name="l01025"></a>01025             hawki_sci_jitter_output.combined_pos_x[idet] - off_0_x;
-<a name="l01026"></a>01026         hawki_sci_jitter_output.combined_cumoffset_y[idet] = 
-<a name="l01027"></a>01027             hawki_sci_jitter_output.combined_pos_y[idet] - off_0_y;
-<a name="l01028"></a>01028         <span class="keywordflow">if</span> (comb_chip == NULL) {
-<a name="l01029"></a>01029             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;
-<a name="l01030"></a>01030             cpl_imagelist_delete(in) ;
-<a name="l01031"></a>01031             cpl_free(combined) ;
-<a name="l01032"></a>01032             cpl_bivector_delete(offsets) ;
-<a name="l01033"></a>01033             cpl_msg_indent_less() ;
-<a name="l01034"></a>01034             cpl_msg_indent_less() ;
-<a name="l01035"></a>01035             <span class="keywordflow">return</span> NULL ;
-<a name="l01036"></a>01036         }
-<a name="l01037"></a>01037         cpl_imagelist_delete(in) ;
-<a name="l01038"></a>01038         cpl_msg_indent_less() ;
-<a name="l01039"></a>01039 
-<a name="l01040"></a>01040         <span class="comment">/* Put the results in the image list */</span>
-<a name="l01041"></a>01041         combined[idet] = comb_chip[0] ;
-<a name="l01042"></a>01042         cpl_image_delete(comb_chip[1]) ;
-<a name="l01043"></a>01043         cpl_free(comb_chip) ;
-<a name="l01044"></a>01044         cpl_msg_indent_less() ;
-<a name="l01045"></a>01045         
-<a name="l01046"></a>01046         <span class="comment">/* Free */</span>
-<a name="l01047"></a>01047         cpl_frameset_delete(selected_jitter);
-<a name="l01048"></a>01048         cpl_bivector_delete(selected_offsets);
-<a name="l01049"></a>01049     }
-<a name="l01050"></a>01050     cpl_bivector_delete(offsets) ;
-<a name="l01051"></a>01051 
-<a name="l01052"></a>01052     <span class="keywordflow">return</span> combined ;
-<a name="l01053"></a>01053 }
-<a name="l01054"></a>01054 
-<a name="l01055"></a>01055 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01062"></a>01062 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01063"></a>01063 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky
-<a name="l01064"></a>01064 (cpl_imagelist   *   objs,
-<a name="l01065"></a>01065  cpl_imagelist   *   skys,
-<a name="l01066"></a>01066  cpl_table       **  bkg_stats,
-<a name="l01067"></a>01067  <span class="keywordtype">int</span>                 idet)
-<a name="l01068"></a>01068 {
-<a name="l01069"></a>01069     cpl_image       *   sky ;
-<a name="l01070"></a>01070     <span class="keywordtype">int</span>                 nframes;
-<a name="l01071"></a>01071     <span class="keywordtype">double</span>              median ;
-<a name="l01072"></a>01072     cpl_image       *   cur_ima ;
-<a name="l01073"></a>01073     <span class="keywordtype">int</span>                 i ;
-<a name="l01074"></a>01074 
-<a name="l01075"></a>01075     <span class="comment">/* Initialise */</span>
-<a name="l01076"></a>01076     nframes = cpl_imagelist_get_size(objs) ;
-<a name="l01077"></a>01077 
-<a name="l01078"></a>01078     <span class="comment">/* Compute the sky frame */</span>
-<a name="l01079"></a>01079     <span class="keywordflow">if</span> (skys != NULL) {
-<a name="l01080"></a>01080        cpl_msg_info(cpl_func, <span class="stringliteral">"Median of sky images"</span>) ;
-<a name="l01081"></a>01081         <span class="comment">/* Use sky images */</span>
-<a name="l01082"></a>01082         <span class="keywordflow">if</span> ((sky = cpl_imagelist_collapse_median_create(skys)) == NULL) {
-<a name="l01083"></a>01083             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot compute the median of sky images"</span>) ;
-<a name="l01084"></a>01084             <span class="keywordflow">return</span> -1;
-<a name="l01085"></a>01085         }
-<a name="l01086"></a>01086         
-<a name="l01087"></a>01087         <span class="comment">/* Statistics on the background */</span>
-<a name="l01088"></a>01088         <span class="keywordflow">if</span>(bkg_stats != NULL)
-<a name="l01089"></a>01089         {
-<a name="l01090"></a>01090             cpl_table_set_size(bkg_stats[idet], 1);
-<a name="l01091"></a>01091             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l01092"></a>01092                 (bkg_stats, sky,
-<a name="l01093"></a>01093                  1,
-<a name="l01094"></a>01094                  1,
-<a name="l01095"></a>01095                  cpl_image_get_size_x(sky),
-<a name="l01096"></a>01096                  cpl_image_get_size_y(sky),
-<a name="l01097"></a>01097                  idet, 0);
-<a name="l01098"></a>01098         }
-<a name="l01099"></a>01099         
-<a name="l01100"></a>01100         <span class="comment">/* Correct the objects images  */</span>
-<a name="l01101"></a>01101         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(objs, sky) != CPL_ERROR_NONE) {
-<a name="l01102"></a>01102             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot corr. the obj images from the sky"</span>);
-<a name="l01103"></a>01103             cpl_image_delete(sky) ;
-<a name="l01104"></a>01104             <span class="keywordflow">return</span> -1;
-<a name="l01105"></a>01105         }
-<a name="l01106"></a>01106         cpl_image_delete(sky) ;
-<a name="l01107"></a>01107         <span class="comment">/* Normalise the object planes */</span>
-<a name="l01108"></a>01108         <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {
-<a name="l01109"></a>01109             cur_ima = cpl_imagelist_get(objs, i) ;
-<a name="l01110"></a>01110             median = cpl_image_get_median(cur_ima) ;
-<a name="l01111"></a>01111             cpl_image_subtract_scalar(cur_ima, median) ;
-<a name="l01112"></a>01112         }
-<a name="l01113"></a>01113     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (hawki_sci_jitter_config.sky_minnb > nframes) {
-<a name="l01114"></a>01114         cpl_msg_info(cpl_func, <span class="stringliteral">"Median of object images"</span>) ;
-<a name="l01115"></a>01115          <span class="comment">/* Use objs images */</span>
-<a name="l01116"></a>01116         <span class="keywordflow">if</span> ((sky = cpl_imagelist_collapse_median_create(objs)) == NULL) {
-<a name="l01117"></a>01117             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot compute the median of obj images"</span>) ;
-<a name="l01118"></a>01118             <span class="keywordflow">return</span> -1;
-<a name="l01119"></a>01119         }
-<a name="l01120"></a>01120 
-<a name="l01121"></a>01121         <span class="comment">/* Statistics on the background */</span>
-<a name="l01122"></a>01122         <span class="keywordflow">if</span>(bkg_stats != NULL)
-<a name="l01123"></a>01123         {
-<a name="l01124"></a>01124             cpl_table_set_size(bkg_stats[idet], 1);
-<a name="l01125"></a>01125             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l01126"></a>01126                 (bkg_stats, sky,
-<a name="l01127"></a>01127                  1,
-<a name="l01128"></a>01128                  1,
-<a name="l01129"></a>01129                  cpl_image_get_size_x(sky),
-<a name="l01130"></a>01130                  cpl_image_get_size_y(sky),
-<a name="l01131"></a>01131                  idet, 0);
-<a name="l01132"></a>01132         }
-<a name="l01133"></a>01133         
-<a name="l01134"></a>01134         <span class="comment">/* Correct the objects images  */</span>
-<a name="l01135"></a>01135         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(objs, sky) != CPL_ERROR_NONE) {
-<a name="l01136"></a>01136             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot corr. the obj images from the sky"</span>);
-<a name="l01137"></a>01137             cpl_image_delete(sky) ;
-<a name="l01138"></a>01138             <span class="keywordflow">return</span> -1;
-<a name="l01139"></a>01139         }
-<a name="l01140"></a>01140         <span class="comment">/* Normalise the object planes */</span>
-<a name="l01141"></a>01141         <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {
-<a name="l01142"></a>01142             cur_ima = cpl_imagelist_get(objs, i) ;
-<a name="l01143"></a>01143             median = cpl_image_get_median(cur_ima) ;
-<a name="l01144"></a>01144             cpl_image_subtract_scalar(cur_ima, median) ;
-<a name="l01145"></a>01145         }
-<a name="l01146"></a>01146         <span class="comment">/* Delete sky image */</span>
-<a name="l01147"></a>01147         cpl_image_delete(sky) ;
-<a name="l01148"></a>01148     } <span class="keywordflow">else</span> {
-<a name="l01149"></a>01149         cpl_msg_info(cpl_func, <span class="stringliteral">"Computing running median on jitter images"</span>) ;
-<a name="l01150"></a>01150         <span class="comment">/* Use objects images */</span>
-<a name="l01151"></a>01151         <span class="keywordflow">if</span> (hawki_sci_jitter_sky_running(objs, bkg_stats, idet) == -1)
-<a name="l01152"></a>01152         {
-<a name="l01153"></a>01153             cpl_msg_error(cpl_func, 
-<a name="l01154"></a>01154                     <span class="stringliteral">"Cannot apply the running median"</span>);
-<a name="l01155"></a>01155             <span class="keywordflow">return</span> -1;
-<a name="l01156"></a>01156         }
-<a name="l01157"></a>01157     }
-<a name="l01158"></a>01158     <span class="keywordflow">return</span> 0;
-<a name="l01159"></a>01159 }
-<a name="l01160"></a>01160 
-<a name="l01161"></a>01161 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01180"></a>01180 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01181"></a>01181 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky_running
-<a name="l01182"></a>01182 (cpl_imagelist *  in,
-<a name="l01183"></a>01183  cpl_table     ** bkg_stats,
-<a name="l01184"></a>01184  <span class="keywordtype">int</span>              idet) 
-<a name="l01185"></a>01185 {
-<a name="l01186"></a>01186     <span class="keywordtype">int</span>                 rejmin, rejmax, halfw;
-<a name="l01187"></a>01187     cpl_imagelist   *   result_buffer;
-<a name="l01188"></a>01188     <span class="keywordtype">int</span>                 ni, nx, ny;
-<a name="l01189"></a>01189     cpl_vector      *   medians;
-<a name="l01190"></a>01190     cpl_image       *   cur_ima;
-<a name="l01191"></a>01191     cpl_image       *   tmp_ima;
-<a name="l01192"></a>01192     <span class="keywordtype">double</span>              one_med;
-<a name="l01193"></a>01193     <span class="keywordtype">int</span>                 i, k;
-<a name="l01194"></a>01194     <span class="keywordtype">int</span>                 first_buffered = 0;
-<a name="l01195"></a>01195     <span class="keywordtype">int</span>                 next_not_to_be_used;
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     <span class="comment">/* Test entries */</span>
-<a name="l01198"></a>01198     <span class="keywordflow">if</span> (in==NULL) <span class="keywordflow">return</span> -1;
-<a name="l01199"></a>01199 
-<a name="l01200"></a>01200     <span class="comment">/* Initialise */</span>
-<a name="l01201"></a>01201     rejmin = hawki_sci_jitter_config.sky_rejmin ;
-<a name="l01202"></a>01202     rejmax = hawki_sci_jitter_config.sky_rejmax ;
-<a name="l01203"></a>01203     halfw  = hawki_sci_jitter_config.sky_halfw ;
-<a name="l01204"></a>01204     ni = cpl_imagelist_get_size(in) ;
-<a name="l01205"></a>01205     cur_ima = cpl_imagelist_get(in, 0) ;
-<a name="l01206"></a>01206     nx = cpl_image_get_size_x(cur_ima) ;
-<a name="l01207"></a>01207     ny = cpl_image_get_size_y(cur_ima) ;
-<a name="l01208"></a>01208     
-<a name="l01209"></a>01209     <span class="comment">/* Tests on validity of rejection parameters */</span>
-<a name="l01210"></a>01210     <span class="keywordflow">if</span> (((rejmin+rejmax)>=halfw) || (halfw<1) || (rejmin<0) || (rejmax<0)) {
-<a name="l01211"></a>01211         cpl_msg_error(cpl_func, <span class="stringliteral">"cannot compute running median with "</span>
-<a name="l01212"></a>01212                 <span class="stringliteral">"rejection  parameters %d (%d-%d)"</span>,
-<a name="l01213"></a>01213                 halfw, rejmin, rejmax);
-<a name="l01214"></a>01214         <span class="keywordflow">return</span> -1;
-<a name="l01215"></a>01215     }   
-<a name="l01216"></a>01216     <span class="comment">/* Pre-compute median value in each plane */</span>
-<a name="l01217"></a>01217     medians = cpl_vector_new(ni) ;
-<a name="l01218"></a>01218     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {
-<a name="l01219"></a>01219         cur_ima = cpl_imagelist_get(in, i) ;
-<a name="l01220"></a>01220         cpl_vector_set(medians, i, cpl_image_get_median(cur_ima)) ;
-<a name="l01221"></a>01221     }
-<a name="l01222"></a>01222     <span class="comment">/* Allocate output cube */</span>
-<a name="l01223"></a>01223     result_buffer = cpl_imagelist_new() ;
-<a name="l01224"></a>01224 
-<a name="l01225"></a>01225     <span class="comment">/* Allocate output bg stats */</span>
-<a name="l01226"></a>01226     cpl_table_set_size(bkg_stats[idet], ni);
-<a name="l01227"></a>01227     
-<a name="l01228"></a>01228     <span class="comment">/* Main loop over input planes */</span>
-<a name="l01229"></a>01229     <span class="keywordflow">for</span> (k=0 ; k<ni ; k++)
-<a name="l01230"></a>01230     {
-<a name="l01231"></a>01231         cpl_image * bkg;
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233         <span class="comment">/* Create the background image, to later compute stats */</span>
-<a name="l01234"></a>01234         bkg = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236         hawki_bkg_from_running_mean
-<a name="l01237"></a>01237             (in, medians, k, halfw, rejmin, rejmax, bkg);
-<a name="l01238"></a>01238 
-<a name="l01239"></a>01239         <span class="comment">/* Subtract the background from the current image */</span>
-<a name="l01240"></a>01240         tmp_ima = cpl_image_subtract_create(cpl_imagelist_get(in, k), bkg);
-<a name="l01241"></a>01241         
-<a name="l01242"></a>01242         <span class="comment">/* Statistics on the background */</span>
-<a name="l01243"></a>01243         <span class="keywordflow">if</span>(bkg_stats != NULL)
-<a name="l01244"></a>01244         {
-<a name="l01245"></a>01245             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a>
-<a name="l01246"></a>01246                 (bkg_stats, bkg,
-<a name="l01247"></a>01247                  1, 1, nx, ny,
-<a name="l01248"></a>01248                  idet, k);
-<a name="l01249"></a>01249         }
-<a name="l01250"></a>01250         cpl_image_delete(bkg);
-<a name="l01251"></a>01251        
-<a name="l01252"></a>01252         <span class="comment">/* Place the new image in a result buffer */</span>
-<a name="l01253"></a>01253         cpl_imagelist_set(result_buffer, tmp_ima,
-<a name="l01254"></a>01254                           cpl_imagelist_get_size(result_buffer));
-<a name="l01255"></a>01255         
-<a name="l01256"></a>01256         <span class="comment">/* Empty the buffer as much as possible */</span>
-<a name="l01257"></a>01257         next_not_to_be_used = k - halfw;
-<a name="l01258"></a>01258         <span class="keywordflow">while</span>(next_not_to_be_used >= first_buffered)
-<a name="l01259"></a>01259         {
-<a name="l01260"></a>01260             cpl_imagelist_set(in, cpl_imagelist_unset(result_buffer, 0),
-<a name="l01261"></a>01261                               first_buffered);
-<a name="l01262"></a>01262             first_buffered++;
-<a name="l01263"></a>01263         }
-<a name="l01264"></a>01264     }
-<a name="l01265"></a>01265     <span class="comment">/* Empty the buffer finally */</span>
-<a name="l01266"></a>01266     next_not_to_be_used = ni - 1;
-<a name="l01267"></a>01267     <span class="keywordflow">while</span>(next_not_to_be_used >= first_buffered)
-<a name="l01268"></a>01268     {
-<a name="l01269"></a>01269         cpl_imagelist_set(in, cpl_imagelist_unset(result_buffer, 0),
-<a name="l01270"></a>01270                           first_buffered);
-<a name="l01271"></a>01271         first_buffered++;
-<a name="l01272"></a>01272     }
-<a name="l01273"></a>01273     cpl_imagelist_delete(result_buffer);
-<a name="l01274"></a>01274     cpl_vector_delete(medians);
-<a name="l01275"></a>01275 
-<a name="l01276"></a>01276     <span class="comment">/* Subtract median from each frame */</span>
-<a name="l01277"></a>01277     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {
-<a name="l01278"></a>01278         cur_ima = cpl_imagelist_get(in, i);
-<a name="l01279"></a>01279         one_med = cpl_image_get_median(cur_ima) ;
-<a name="l01280"></a>01280         cpl_image_subtract_scalar(cur_ima, one_med) ;
-<a name="l01281"></a>01281     }
-<a name="l01282"></a>01282     <span class="keywordflow">return</span> 0;
-<a name="l01283"></a>01283 }
-<a name="l01284"></a>01284 
-<a name="l01285"></a>01285 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01294"></a>01294 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01295"></a>01295 <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_saa(
-<a name="l01296"></a>01296         cpl_imagelist   **  in,
-<a name="l01297"></a>01297         cpl_bivector    *   offsets,
-<a name="l01298"></a>01298         <span class="keywordtype">double</span>          *   pos_x,
-<a name="l01299"></a>01299         <span class="keywordtype">double</span>          *   pos_y)
-<a name="l01300"></a>01300 {
-<a name="l01301"></a>01301     cpl_bivector        *   offs_est;
-<a name="l01302"></a>01302     cpl_bivector        *   offs_used;
-<a name="l01303"></a>01303     cpl_bivector        *   objs ;
-<a name="l01304"></a>01304     cpl_image           **  combined ;
-<a name="l01305"></a>01305     <span class="keywordtype">int</span>                     nfiles, ngood, nima, nx, ny ;
-<a name="l01306"></a>01306     <span class="keywordtype">int</span>                     i;
-<a name="l01307"></a>01307 
-<a name="l01308"></a>01308     <span class="comment">/* Check entries */</span>
-<a name="l01309"></a>01309     <span class="keywordflow">if</span> (pos_x == NULL || pos_y == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l01310"></a>01310     <span class="keywordflow">if</span> (offsets == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l01311"></a>01311 
-<a name="l01312"></a>01312     <span class="comment">/* Get the number of images */</span>
-<a name="l01313"></a>01313     nfiles = cpl_imagelist_get_size(*in) ;
-<a name="l01314"></a>01314     <span class="keywordflow">if</span> (cpl_bivector_get_size(offsets) != nfiles) {
-<a name="l01315"></a>01315         cpl_msg_error(cpl_func, <span class="stringliteral">"Invalid input objects sizes"</span>) ; 
-<a name="l01316"></a>01316         <span class="keywordflow">return</span> NULL ;
-<a name="l01317"></a>01317     }
-<a name="l01318"></a>01318     
-<a name="l01319"></a>01319     <span class="comment">/* Get the offsets estimation of each input file pair */</span>
-<a name="l01320"></a>01320     cpl_msg_info(cpl_func, <span class="stringliteral">"Get the offsets estimation"</span>) ;
-<a name="l01321"></a>01321     offs_est = NULL ;
-<a name="l01322"></a>01322     <span class="keywordflow">if</span> (hawki_sci_jitter_config.offsets &&
-<a name="l01323"></a>01323             hawki_sci_jitter_config.offsets[0] != (<span class="keywordtype">char</span>)0) {
-<a name="l01324"></a>01324         <span class="comment">/* A file has been provided on the command line */</span>
-<a name="l01325"></a>01325         offs_est = cpl_bivector_read((<span class="keywordtype">char</span>*)hawki_sci_jitter_config.offsets);
-<a name="l01326"></a>01326         <span class="keywordflow">if</span> ((offs_est==NULL)||(cpl_bivector_get_size(offs_est)!=nfiles)) {
-<a name="l01327"></a>01327             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get offsets from %s"</span>, 
-<a name="l01328"></a>01328                     hawki_sci_jitter_config.offsets) ;
-<a name="l01329"></a>01329             <span class="keywordflow">return</span> NULL ;
-<a name="l01330"></a>01330         }
-<a name="l01331"></a>01331     } <span class="keywordflow">else</span> {
-<a name="l01332"></a>01332         <span class="comment">/* Use the offsets from the header */</span>
-<a name="l01333"></a>01333         offs_est = cpl_bivector_duplicate(offsets) ;
-<a name="l01334"></a>01334         cpl_vector_multiply_scalar(cpl_bivector_get_x(offs_est), -1.0) ;
-<a name="l01335"></a>01335         cpl_vector_multiply_scalar(cpl_bivector_get_y(offs_est), -1.0) ;
-<a name="l01336"></a>01336     }
-<a name="l01337"></a>01337 
-<a name="l01338"></a>01338     <span class="comment">/* Read the provided objects file if provided */</span>
-<a name="l01339"></a>01339     objs = NULL ;
-<a name="l01340"></a>01340     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine &&
-<a name="l01341"></a>01341             hawki_sci_jitter_config.objects &&
-<a name="l01342"></a>01342             hawki_sci_jitter_config.objects[0] != (<span class="keywordtype">char</span>)0) {
-<a name="l01343"></a>01343         cpl_msg_info(cpl_func, <span class="stringliteral">"Get the user provided correlation objects"</span>) ;
-<a name="l01344"></a>01344         <span class="comment">/* A file has been provided on the command line */</span>
-<a name="l01345"></a>01345         objs = cpl_bivector_read((<span class="keywordtype">char</span>*)hawki_sci_jitter_config.objects) ;
-<a name="l01346"></a>01346         <span class="keywordflow">if</span> (objs==NULL) {
-<a name="l01347"></a>01347             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get objects from %s"</span>,
-<a name="l01348"></a>01348                     hawki_sci_jitter_config.objects) ;
-<a name="l01349"></a>01349             cpl_bivector_delete(offs_est) ;
-<a name="l01350"></a>01350             <span class="keywordflow">return</span> NULL ;
-<a name="l01351"></a>01351         }
-<a name="l01352"></a>01352     }
-<a name="l01353"></a>01353 
-<a name="l01354"></a>01354     <span class="comment">/* Get a correlation point from the difference of the first images */</span>
-<a name="l01355"></a>01355     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine && objs == NULL) {
-<a name="l01356"></a>01356         cpl_apertures  *   aperts;
-<a name="l01357"></a>01357         cpl_image      *   detect_image;
-<a name="l01358"></a>01358         cpl_vector     *   thresh_vect;
-<a name="l01359"></a>01359         <span class="keywordtype">double</span>         *   objs_x ;
-<a name="l01360"></a>01360         <span class="keywordtype">double</span>         *   objs_y ;
-<a name="l01361"></a>01361         cpl_msg_info(cpl_func, <span class="stringliteral">"Get a cross-correlation point"</span>) ;
-<a name="l01362"></a>01362         thresh_vect = cpl_vector_new(4) ;
-<a name="l01363"></a>01363         cpl_vector_set(thresh_vect, 0, 5.0) ;
-<a name="l01364"></a>01364         cpl_vector_set(thresh_vect, 1, 2.0) ;
-<a name="l01365"></a>01365         cpl_vector_set(thresh_vect, 2, 1.0) ;
-<a name="l01366"></a>01366         cpl_vector_set(thresh_vect, 3, 0.5) ;
-<a name="l01367"></a>01367         detect_image  = cpl_imagelist_get(*in, 0);
-<a name="l01368"></a>01368         <span class="keywordflow">if</span> ((aperts = cpl_apertures_extract_window(detect_image, thresh_vect, 
-<a name="l01369"></a>01369                         400, 400, 1600, 1600, NULL)) == NULL) {
-<a name="l01370"></a>01370             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find any cross-correlation point"</span>) ;
-<a name="l01371"></a>01371             cpl_bivector_delete(offs_est) ;
-<a name="l01372"></a>01372             cpl_vector_delete(thresh_vect) ;
-<a name="l01373"></a>01373             <span class="keywordflow">return</span> NULL ;
-<a name="l01374"></a>01374         }
-<a name="l01375"></a>01375         cpl_vector_delete(thresh_vect) ;
-<a name="l01376"></a>01376         cpl_apertures_sort_by_npix(aperts) ;
-<a name="l01377"></a>01377         objs = cpl_bivector_new(1) ;
-<a name="l01378"></a>01378         objs_x = cpl_bivector_get_x_data(objs) ;
-<a name="l01379"></a>01379         objs_y = cpl_bivector_get_y_data(objs) ;
-<a name="l01380"></a>01380         objs_x[0] = cpl_apertures_get_pos_x(aperts, 1) ;
-<a name="l01381"></a>01381         objs_y[0] = cpl_apertures_get_pos_y(aperts, 1) ;
-<a name="l01382"></a>01382         cpl_apertures_delete(aperts) ;
-<a name="l01383"></a>01383         <span class="keywordflow">if</span> (objs == NULL) {
-<a name="l01384"></a>01384             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find any cross-correlation point"</span>) ;
-<a name="l01385"></a>01385             cpl_bivector_delete(offs_est) ;
-<a name="l01386"></a>01386             <span class="keywordflow">return</span> NULL ;
-<a name="l01387"></a>01387         }
-<a name="l01388"></a>01388         cpl_msg_info(cpl_func, 
-<a name="l01389"></a>01389                 <span class="stringliteral">"Correlation point: %g %g\n"</span>, objs_x[0], objs_y[0]);
-<a name="l01390"></a>01390     }
-<a name="l01391"></a>01391 
-<a name="l01392"></a>01392     <span class="comment">/* Refine the offsets */</span>
-<a name="l01393"></a>01393     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine) {
-<a name="l01394"></a>01394         cpl_bivector *   offs_refined;
-<a name="l01395"></a>01395         <span class="keywordtype">double</span>       *   offs_refined_x;
-<a name="l01396"></a>01396         <span class="keywordtype">double</span>       *   offs_refined_y;
-<a name="l01397"></a>01397         <span class="keywordtype">double</span>       *   offs_est_x;
-<a name="l01398"></a>01398         <span class="keywordtype">double</span>       *   offs_est_y;
-<a name="l01399"></a>01399         cpl_vector   *   correl ;
-<a name="l01400"></a>01400         <span class="keywordtype">double</span>       *   correl_data ;
-<a name="l01401"></a>01401         cpl_msg_info(cpl_func, <span class="stringliteral">"Refine the offsets"</span>);
-<a name="l01402"></a>01402         cpl_msg_indent_more() ;
-<a name="l01403"></a>01403         nima = cpl_imagelist_get_size(*in) ;
-<a name="l01404"></a>01404         correl = cpl_vector_new(nima) ;
-<a name="l01405"></a>01405         <span class="keywordflow">if</span> ((offs_refined = cpl_geom_img_offset_fine(*in, offs_est, objs,
-<a name="l01406"></a>01406                         hawki_sci_jitter_config.sx, 
-<a name="l01407"></a>01407                         hawki_sci_jitter_config.sy,
-<a name="l01408"></a>01408                         hawki_sci_jitter_config.mx, 
-<a name="l01409"></a>01409                         hawki_sci_jitter_config.my,
-<a name="l01410"></a>01410                         correl)) == NULL) {
-<a name="l01411"></a>01411             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot refine the offsets"</span>);
-<a name="l01412"></a>01412             cpl_bivector_delete(offs_est) ;
-<a name="l01413"></a>01413             <span class="keywordflow">if</span> (objs != NULL) cpl_bivector_delete(objs) ;
-<a name="l01414"></a>01414             cpl_vector_delete(correl) ;
-<a name="l01415"></a>01415             <span class="keywordflow">return</span> NULL ;
-<a name="l01416"></a>01416         }
-<a name="l01417"></a>01417         <span class="keywordflow">if</span> (objs != NULL) cpl_bivector_delete(objs) ;
-<a name="l01418"></a>01418 
-<a name="l01419"></a>01419         <span class="comment">/* Display the results */</span>
-<a name="l01420"></a>01420         offs_est_x = cpl_bivector_get_x_data(offs_est);
-<a name="l01421"></a>01421         offs_est_y = cpl_bivector_get_y_data(offs_est);
-<a name="l01422"></a>01422         offs_refined_x = cpl_bivector_get_x_data(offs_refined);
-<a name="l01423"></a>01423         offs_refined_y = cpl_bivector_get_y_data(offs_refined) ;
-<a name="l01424"></a>01424         correl_data = cpl_vector_get_data(correl) ;
-<a name="l01425"></a>01425         cpl_msg_info(cpl_func, <span class="stringliteral">"Refined offsets [correlation factor]"</span>) ;
-<a name="l01426"></a>01426         ngood = 0 ;
-<a name="l01427"></a>01427         <span class="keywordflow">for</span> (i=0 ; i<nima ; i++) {
-<a name="l01428"></a>01428             cpl_msg_info(cpl_func, <span class="stringliteral">"#%02d: %8.2f %8.2f [%12.2f]"</span>,
-<a name="l01429"></a>01429                     i+1, offs_refined_x[i], offs_refined_y[i], correl_data[i]);
-<a name="l01430"></a>01430             <span class="keywordflow">if</span> (correl_data[i] > -0.5) ngood++ ;
-<a name="l01431"></a>01431         }
-<a name="l01432"></a>01432         <span class="keywordflow">if</span> (ngood == 0) {
-<a name="l01433"></a>01433             cpl_msg_error(cpl_func, <span class="stringliteral">"No frame correctly correlated"</span>) ;
-<a name="l01434"></a>01434             cpl_bivector_delete(offs_est);
-<a name="l01435"></a>01435             cpl_bivector_delete(offs_refined);
-<a name="l01436"></a>01436             cpl_vector_delete(correl);
-<a name="l01437"></a>01437             <span class="keywordflow">return</span> NULL ;
-<a name="l01438"></a>01438         }
-<a name="l01439"></a>01439         cpl_msg_indent_less();
-<a name="l01440"></a>01440 
-<a name="l01441"></a>01441         <span class="comment">/* Replace bad correlated images with the nominal offsets */</span>
-<a name="l01442"></a>01442         cpl_msg_info(cpl_func, <span class="stringliteral">"Using nominal offsets for badly "</span>
-<a name="l01443"></a>01443                      <span class="stringliteral">"correlated images (%d out of %d)"</span>, nima-ngood, nima);
-<a name="l01444"></a>01444         <span class="keywordflow">for</span> (i=0 ; i<nima ; i++) {
-<a name="l01445"></a>01445             <span class="keywordflow">if</span> (correl_data[i] < -0.5) {
-<a name="l01446"></a>01446                 offs_refined_x[i] = offs_est_x[i];
-<a name="l01447"></a>01447                 offs_refined_y[i] = offs_est_y[i];
-<a name="l01448"></a>01448             }
-<a name="l01449"></a>01449         }
-<a name="l01450"></a>01450         offs_used = cpl_bivector_duplicate(offs_refined);
-<a name="l01451"></a>01451         cpl_bivector_delete(offs_est);
-<a name="l01452"></a>01452         cpl_bivector_delete(offs_refined);
-<a name="l01453"></a>01453         cpl_vector_delete(correl);
-<a name="l01454"></a>01454     }
-<a name="l01455"></a>01455     <span class="keywordflow">else</span>
-<a name="l01456"></a>01456     {
-<a name="l01457"></a>01457         offs_used = cpl_bivector_duplicate(offs_est);
-<a name="l01458"></a>01458         cpl_bivector_delete(offs_est);
-<a name="l01459"></a>01459     }
-<a name="l01460"></a>01460 
-<a name="l01461"></a>01461     <span class="comment">/* Discard the pixels on the sides */</span>
-<a name="l01462"></a>01462     <span class="keywordflow">if</span> (hawki_sci_jitter_config.borders > 0) {
-<a name="l01463"></a>01463         cpl_imagelist  *   in_ext ;
-<a name="l01464"></a>01464         cpl_image      *   tmp1 ;
-<a name="l01465"></a>01465         cpl_image      *   tmp2 ;
-<a name="l01466"></a>01466         nx = cpl_image_get_size_x(cpl_imagelist_get(*in, 0)) ;
-<a name="l01467"></a>01467         ny = cpl_image_get_size_y(cpl_imagelist_get(*in, 0)) ;
-<a name="l01468"></a>01468         in_ext = cpl_imagelist_new() ;
-<a name="l01469"></a>01469         <span class="keywordflow">while</span>(cpl_imagelist_get_size(*in) > 0)
-<a name="l01470"></a>01470         {
-<a name="l01471"></a>01471             tmp1 = cpl_imagelist_unset(*in, 0);
-<a name="l01472"></a>01472             tmp2 = cpl_image_extract(tmp1, 
-<a name="l01473"></a>01473                     hawki_sci_jitter_config.borders+1, 
-<a name="l01474"></a>01474                     hawki_sci_jitter_config.borders+1, 
-<a name="l01475"></a>01475                     nx-hawki_sci_jitter_config.borders, 
-<a name="l01476"></a>01476                     ny-hawki_sci_jitter_config.borders) ;
-<a name="l01477"></a>01477             cpl_image_delete(tmp1);
-<a name="l01478"></a>01478             cpl_imagelist_set(in_ext, tmp2, cpl_imagelist_get_size(in_ext)) ;
-<a name="l01479"></a>01479         }
-<a name="l01480"></a>01480         cpl_imagelist_delete(*in) ;
-<a name="l01481"></a>01481         *in = in_ext ;
-<a name="l01482"></a>01482     }
-<a name="l01483"></a>01483 
-<a name="l01484"></a>01484     <span class="comment">/* Apply the shift & add */</span>
-<a name="l01485"></a>01485     cpl_msg_info(cpl_func, <span class="stringliteral">"Recombine the images set"</span>) ;
-<a name="l01486"></a>01486     cpl_msg_indent_more() ;
-<a name="l01487"></a>01487     <span class="keywordflow">if</span> ((combined=cpl_geom_img_offset_saa(*in, offs_used,
-<a name="l01488"></a>01488                     CPL_KERNEL_DEFAULT, 
-<a name="l01489"></a>01489                     hawki_sci_jitter_config.rej_low,
-<a name="l01490"></a>01490                     hawki_sci_jitter_config.rej_high,
-<a name="l01491"></a>01491                     hawki_sci_jitter_config.comb_meth,
-<a name="l01492"></a>01492                     pos_x, pos_y)) == NULL) {
-<a name="l01493"></a>01493         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;
-<a name="l01494"></a>01494         cpl_bivector_delete(offs_used) ;
-<a name="l01495"></a>01495         cpl_msg_indent_less() ;
-<a name="l01496"></a>01496         <span class="keywordflow">return</span> NULL ;
-<a name="l01497"></a>01497     }
-<a name="l01498"></a>01498     cpl_msg_indent_less() ;
-<a name="l01499"></a>01499     *pos_x -= hawki_sci_jitter_config.borders ;
-<a name="l01500"></a>01500     *pos_y -= hawki_sci_jitter_config.borders ;
-<a name="l01501"></a>01501 
-<a name="l01502"></a>01502     <span class="comment">/* Free and return */</span>
-<a name="l01503"></a>01503     cpl_bivector_delete(offs_used) ;
-<a name="l01504"></a>01504     <span class="keywordflow">return</span> combined ;
-<a name="l01505"></a>01505 }
-<a name="l01506"></a>01506 
-<a name="l01507"></a>01507 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01514"></a>01514 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01515"></a>01515 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_qc
-<a name="l01516"></a>01516 (cpl_frameset *   science_frames,
-<a name="l01517"></a>01517  cpl_image   **   combined_images, 
-<a name="l01518"></a>01518  cpl_table   **   obj_charac)
-<a name="l01519"></a>01519 {
-<a name="l01520"></a>01520     cpl_vector      *   thresh_vec ;
-<a name="l01521"></a>01521     cpl_apertures   *   aperts ;
-<a name="l01522"></a>01522     <span class="keywordtype">int</span>                 nb_objs ;
-<a name="l01523"></a>01523     <span class="keywordtype">double</span>              angle ;
-<a name="l01524"></a>01524     <span class="keywordtype">double</span>          *   fwhms_x ;
-<a name="l01525"></a>01525     <span class="keywordtype">double</span>          *   fwhms_y ;
-<a name="l01526"></a>01526     cpl_bivector    *   iqe ;
-<a name="l01527"></a>01527     <span class="keywordtype">int</span>                 nb_good ;
-<a name="l01528"></a>01528     cpl_vector      *   fwhms_good ;
-<a name="l01529"></a>01529     <span class="keywordtype">double</span>          *   fwhms_good_data ;
-<a name="l01530"></a>01530     <span class="keywordtype">double</span>              f_min, f_max, fr, fx, fy ;
-<a name="l01531"></a>01531     <span class="keywordtype">int</span>                 chip;
-<a name="l01532"></a>01532     <span class="keywordtype">int</span>                 iobj;
-<a name="l01533"></a>01533     <span class="keywordtype">int</span>                 j;
-<a name="l01534"></a>01534     
-<a name="l01535"></a>01535     <span class="comment">/* Initialise */</span>
-<a name="l01536"></a>01536     <span class="keywordtype">double</span>              seeing_min_arcsec = 0.1 ;
-<a name="l01537"></a>01537     <span class="keywordtype">double</span>              seeing_max_arcsec = 5.0 ;
-<a name="l01538"></a>01538     <span class="keywordtype">double</span>              seeing_fwhm_var   = 0.2 ;
-<a name="l01539"></a>01539 
-<a name="l01540"></a>01540     <span class="comment">/* Check entries */</span>
-<a name="l01541"></a>01541     <span class="keywordflow">if</span> (combined_images  == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01542"></a>01542     <span class="keywordflow">if</span> (obj_charac       == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01543"></a>01543 
-<a name="l01544"></a>01544     <span class="comment">/* Create the vector for the detection thresholds */</span>
-<a name="l01545"></a>01545     thresh_vec = cpl_vector_new(11) ;
-<a name="l01546"></a>01546     cpl_vector_set(thresh_vec, 0, 100.0) ;
-<a name="l01547"></a>01547     cpl_vector_set(thresh_vec, 0, 90.0) ;
-<a name="l01548"></a>01548     cpl_vector_set(thresh_vec, 0, 80.0) ;
-<a name="l01549"></a>01549     cpl_vector_set(thresh_vec, 0, 70.0) ;
-<a name="l01550"></a>01550     cpl_vector_set(thresh_vec, 0, 60.0) ;
-<a name="l01551"></a>01551     cpl_vector_set(thresh_vec, 0, 50.0) ;
-<a name="l01552"></a>01552     cpl_vector_set(thresh_vec, 1, 40.0) ;
-<a name="l01553"></a>01553     cpl_vector_set(thresh_vec, 1, 30.0) ;
-<a name="l01554"></a>01554     cpl_vector_set(thresh_vec, 1, 20.0) ;
-<a name="l01555"></a>01555     cpl_vector_set(thresh_vec, 1, 10.0) ;
-<a name="l01556"></a>01556     cpl_vector_set(thresh_vec, 2, 5.0) ;
-<a name="l01557"></a>01557 
-<a name="l01558"></a>01558     <span class="comment">/* Get the mean airmass */</span>
-<a name="l01559"></a>01559     hawki_sci_jitter_output.mean_airmass = 
-<a name="l01560"></a>01560         <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(science_frames);;
-<a name="l01561"></a>01561     
-<a name="l01562"></a>01562     <span class="comment">/* Loop on the HAWK-I detectors */</span>
-<a name="l01563"></a>01563     <span class="keywordflow">for</span> (chip=0 ; chip<HAWKI_NB_DETECTORS ; chip++) 
-<a name="l01564"></a>01564     {
-<a name="l01565"></a>01565         <span class="comment">/* Check entries */</span>
-<a name="l01566"></a>01566         <span class="keywordflow">if</span> (combined_images[chip]  == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01567"></a>01567         <span class="keywordflow">if</span> (obj_charac[chip] == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l01568"></a>01568     
-<a name="l01569"></a>01569         <span class="comment">/* Detect apertures */</span>
-<a name="l01570"></a>01570         <span class="keywordflow">if</span> ((aperts = cpl_apertures_extract
-<a name="l01571"></a>01571                 (combined_images[chip], thresh_vec, NULL)) == NULL) {
-<a name="l01572"></a>01572             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot detect any aperture on chip %d"</span>,
-<a name="l01573"></a>01573                             chip+1) ;
-<a name="l01574"></a>01574             <span class="keywordflow">continue</span>;
-<a name="l01575"></a>01575         }
-<a name="l01576"></a>01576 
-<a name="l01577"></a>01577         <span class="comment">/* Number of detected objects */</span>
-<a name="l01578"></a>01578         nb_objs = cpl_apertures_get_size(aperts);
-<a name="l01579"></a>01579         cpl_msg_info(cpl_func, <span class="stringliteral">"%d objects detected on chip %d"</span>,nb_objs,chip+1);
-<a name="l01580"></a>01580         hawki_sci_jitter_output.nbobjs[chip] = nb_objs ;
-<a name="l01581"></a>01581         fwhms_x = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;
-<a name="l01582"></a>01582         fwhms_y = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;
-<a name="l01583"></a>01583         
-<a name="l01584"></a>01584         <span class="comment">/* Initialize the output table */</span>
-<a name="l01585"></a>01585         cpl_table_set_size(obj_charac[chip], nb_objs);
-<a name="l01586"></a>01586         cpl_table_new_column
-<a name="l01587"></a>01587             (obj_charac[chip], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);
-<a name="l01588"></a>01588         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSX,<span class="stringliteral">"pix"</span>);
-<a name="l01589"></a>01589         cpl_table_new_column
-<a name="l01590"></a>01590             (obj_charac[chip], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);
-<a name="l01591"></a>01591         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSY,<span class="stringliteral">"pix"</span>);
-<a name="l01592"></a>01592         cpl_table_new_column
-<a name="l01593"></a>01593             (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, CPL_TYPE_DOUBLE);
-<a name="l01594"></a>01594         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_ANGLE,<span class="stringliteral">"grad"</span>);
-<a name="l01595"></a>01595         cpl_table_new_column
-<a name="l01596"></a>01596             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, CPL_TYPE_DOUBLE);
-<a name="l01597"></a>01597         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MAJAX,<span class="stringliteral">"pix"</span>);
-<a name="l01598"></a>01598         cpl_table_new_column
-<a name="l01599"></a>01599             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, CPL_TYPE_DOUBLE);
-<a name="l01600"></a>01600         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MINAX,<span class="stringliteral">"pix"</span>);
-<a name="l01601"></a>01601         cpl_table_new_column
-<a name="l01602"></a>01602             (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, CPL_TYPE_DOUBLE);
-<a name="l01603"></a>01603         cpl_table_new_column
-<a name="l01604"></a>01604             (obj_charac[chip], HAWKI_COL_OBJ_FLUX, CPL_TYPE_DOUBLE);
-<a name="l01605"></a>01605         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FLUX,<span class="stringliteral">"ADU"</span>);
-<a name="l01606"></a>01606         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l01607"></a>01607         {
-<a name="l01608"></a>01608             <span class="comment">/* Fill with the already known information */</span>
-<a name="l01609"></a>01609             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSX, iobj, 
-<a name="l01610"></a>01610                                  cpl_apertures_get_centroid_x(aperts, iobj+1));
-<a name="l01611"></a>01611             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSY, iobj, 
-<a name="l01612"></a>01612                                  cpl_apertures_get_centroid_y(aperts, iobj+1));
-<a name="l01613"></a>01613             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_FLUX, iobj, 
-<a name="l01614"></a>01614                                  cpl_apertures_get_flux(aperts, iobj+1)) ;
-<a name="l01615"></a>01615             <span class="comment">/* Compute the FWHM informations */</span>
-<a name="l01616"></a>01616             <span class="keywordflow">if</span> ((iqe = cpl_image_iqe(combined_images[chip], 
-<a name="l01617"></a>01617                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(aperts, iobj+1) - 10,
-<a name="l01618"></a>01618                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(aperts, iobj+1) - 10,
-<a name="l01619"></a>01619                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(aperts, iobj+1) + 10,
-<a name="l01620"></a>01620                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(aperts, iobj+1) + 10))==NULL)
-<a name="l01621"></a>01621             {
-<a name="l01622"></a>01622                 cpl_error_reset() ;
-<a name="l01623"></a>01623                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Cannot get FWHM for obj at pos %g %g"</span>,
-<a name="l01624"></a>01624                               cpl_apertures_get_centroid_x(aperts, iobj+1),
-<a name="l01625"></a>01625                               cpl_apertures_get_centroid_y(aperts, iobj+1)) ;
-<a name="l01626"></a>01626                 fwhms_x[iobj] = -1.0 ;
-<a name="l01627"></a>01627                 fwhms_y[iobj] = -1.0 ;
-<a name="l01628"></a>01628                 angle = 0.0 ;
-<a name="l01629"></a>01629             }
-<a name="l01630"></a>01630             <span class="keywordflow">else</span> 
-<a name="l01631"></a>01631             {
-<a name="l01632"></a>01632                 fwhms_x[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 2) ;
-<a name="l01633"></a>01633                 fwhms_y[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 3) ;
-<a name="l01634"></a>01634                 angle = cpl_vector_get(cpl_bivector_get_x(iqe), 4) ;
-<a name="l01635"></a>01635                 cpl_bivector_delete(iqe) ;
-<a name="l01636"></a>01636                 cpl_msg_debug(cpl_func,
-<a name="l01637"></a>01637                               <span class="stringliteral">"FWHM for obj at pos %g %g: %g x %g (%g)"</span>,
-<a name="l01638"></a>01638                               cpl_apertures_get_centroid_x(aperts, iobj+1),
-<a name="l01639"></a>01639                               cpl_apertures_get_centroid_y(aperts, iobj+1),
-<a name="l01640"></a>01640                               fwhms_x[iobj], fwhms_y[iobj], angle) ;
-<a name="l01641"></a>01641             }
-<a name="l01642"></a>01642             cpl_table_set_double
-<a name="l01643"></a>01643                 (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, iobj, angle) ;
-<a name="l01644"></a>01644             cpl_table_set_double
-<a name="l01645"></a>01645                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, iobj,
-<a name="l01646"></a>01646                  fwhms_x[iobj]);
-<a name="l01647"></a>01647             cpl_table_set_double
-<a name="l01648"></a>01648                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, iobj,
-<a name="l01649"></a>01649                  fwhms_y[iobj]);
-<a name="l01650"></a>01650             cpl_table_set_double
-<a name="l01651"></a>01651                 (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, iobj,
-<a name="l01652"></a>01652                  1 - fwhms_y[iobj] / fwhms_x[iobj]);
-<a name="l01653"></a>01653         }
-<a name="l01654"></a>01654         cpl_apertures_delete(aperts) ;
-<a name="l01655"></a>01655 
-<a name="l01656"></a>01656         <span class="comment">/* Get the number of good values */</span>
-<a name="l01657"></a>01657         nb_good = 0 ;
-<a name="l01658"></a>01658         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l01659"></a>01659         {
-<a name="l01660"></a>01660             <span class="keywordflow">if</span> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) nb_good++ ;
-<a name="l01661"></a>01661         }
-<a name="l01662"></a>01662         <span class="keywordflow">if</span> (nb_good == 0)
-<a name="l01663"></a>01663         {
-<a name="l01664"></a>01664             cpl_msg_warning(cpl_func, <span class="stringliteral">"No objects to compute FWHM on chip %d"</span>,
-<a name="l01665"></a>01665                             chip+1);
-<a name="l01666"></a>01666             cpl_free(fwhms_x) ;
-<a name="l01667"></a>01667             cpl_free(fwhms_y) ;
-<a name="l01668"></a>01668             <span class="keywordflow">continue</span>;
-<a name="l01669"></a>01669         }
-<a name="l01670"></a>01670     
-<a name="l01671"></a>01671         <span class="comment">/* Get the good values */</span>
-<a name="l01672"></a>01672         fwhms_good = cpl_vector_new(nb_good) ;
-<a name="l01673"></a>01673         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;
-<a name="l01674"></a>01674         j=0 ;
-<a name="l01675"></a>01675         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l01676"></a>01676         {
-<a name="l01677"></a>01677             <span class="keywordflow">if</span> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) 
-<a name="l01678"></a>01678             {
-<a name="l01679"></a>01679                 fwhms_good_data[j] = (fwhms_x[iobj]+fwhms_y[iobj])/2.0 ;
-<a name="l01680"></a>01680                 j++ ;
-<a name="l01681"></a>01681             }
-<a name="l01682"></a>01682         }
-<a name="l01683"></a>01683    
-<a name="l01684"></a>01684         <span class="comment">/* Compute the fwhm */</span>
-<a name="l01685"></a>01685         <span class="keywordflow">if</span> (nb_good < 3) 
-<a name="l01686"></a>01686         {
-<a name="l01687"></a>01687             <span class="comment">/* Too few values to compute the median */</span>
-<a name="l01688"></a>01688             hawki_sci_jitter_output.fwhm_pix[chip] = fwhms_good_data[0] ;
-<a name="l01689"></a>01689         } 
-<a name="l01690"></a>01690         <span class="keywordflow">else</span> 
-<a name="l01691"></a>01691         {
-<a name="l01692"></a>01692             <span class="comment">/* Compute the median */</span>
-<a name="l01693"></a>01693             hawki_sci_jitter_output.fwhm_pix[chip] =
-<a name="l01694"></a>01694                 cpl_vector_get_median_const(fwhms_good) ;
-<a name="l01695"></a>01695         }
-<a name="l01696"></a>01696         hawki_sci_jitter_output.fwhm_arcsec[chip] = 
-<a name="l01697"></a>01697             hawki_sci_jitter_output.fwhm_pix[chip] *
-<a name="l01698"></a>01698             hawki_sci_jitter_output.pixscale ;
-<a name="l01699"></a>01699 
-<a name="l01700"></a>01700         <span class="comment">/* Compute the mode of the FWHMs */</span>
-<a name="l01701"></a>01701         <span class="keywordflow">if</span> (nb_good > 5) 
-<a name="l01702"></a>01702         {
-<a name="l01703"></a>01703             hawki_sci_jitter_output.fwhm_mode[chip] =
-<a name="l01704"></a>01704                 <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(fwhms_good);
-<a name="l01705"></a>01705             hawki_sci_jitter_output.fwhm_mode[chip] *= 
-<a name="l01706"></a>01706                 hawki_sci_jitter_output.pixscale ;
-<a name="l01707"></a>01707         }
-<a name="l01708"></a>01708         cpl_vector_delete(fwhms_good) ;
-<a name="l01709"></a>01709     
-<a name="l01710"></a>01710         <span class="comment">/* IQ is the median of the (fwhm_x+fwhm_y/2) of the good stars */</span>
-<a name="l01711"></a>01711         <span class="comment">/* Compute f_min and f_max */</span>
-<a name="l01712"></a>01712         f_min = seeing_min_arcsec / hawki_sci_jitter_output.pixscale ;
-<a name="l01713"></a>01713         f_max = seeing_max_arcsec / hawki_sci_jitter_output.pixscale ;
-<a name="l01714"></a>01714 
-<a name="l01715"></a>01715         <span class="comment">/* Get the number of good values */</span>
-<a name="l01716"></a>01716         nb_good = 0 ;
-<a name="l01717"></a>01717         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l01718"></a>01718         {
-<a name="l01719"></a>01719             fx = fwhms_x[iobj] ;
-<a name="l01720"></a>01720             fy = fwhms_y[iobj] ;
-<a name="l01721"></a>01721             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;
-<a name="l01722"></a>01722             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&
-<a name="l01723"></a>01723                     (fr < seeing_fwhm_var)) nb_good++ ;
-<a name="l01724"></a>01724         }
-<a name="l01725"></a>01725         <span class="keywordflow">if</span> (nb_good == 0) 
-<a name="l01726"></a>01726         {
-<a name="l01727"></a>01727             cpl_msg_warning(cpl_func, <span class="stringliteral">"No objects to compute IQ on chip %d"</span>,
-<a name="l01728"></a>01728                             chip+1);
-<a name="l01729"></a>01729             cpl_free(fwhms_x) ;
-<a name="l01730"></a>01730             cpl_free(fwhms_y) ;
-<a name="l01731"></a>01731             <span class="keywordflow">continue</span>;
-<a name="l01732"></a>01732         }
-<a name="l01733"></a>01733 
-<a name="l01734"></a>01734         <span class="comment">/* Get the good values */</span>
-<a name="l01735"></a>01735         fwhms_good = cpl_vector_new(nb_good) ;
-<a name="l01736"></a>01736         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;
-<a name="l01737"></a>01737         j=0 ;
-<a name="l01738"></a>01738         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l01739"></a>01739         {
-<a name="l01740"></a>01740             fx = fwhms_x[iobj] ;
-<a name="l01741"></a>01741             fy = fwhms_y[iobj] ;
-<a name="l01742"></a>01742             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;
-<a name="l01743"></a>01743             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&
-<a name="l01744"></a>01744                     (fr < seeing_fwhm_var)) 
-<a name="l01745"></a>01745             {
-<a name="l01746"></a>01746                 fwhms_good_data[j] = (fx + fy)/2.0 ;
-<a name="l01747"></a>01747                 j++ ;
-<a name="l01748"></a>01748             }
-<a name="l01749"></a>01749         }
-<a name="l01750"></a>01750         cpl_free(fwhms_x) ;
-<a name="l01751"></a>01751         cpl_free(fwhms_y) ;
-<a name="l01752"></a>01752     
-<a name="l01753"></a>01753         <span class="comment">/* Compute the fwhm */</span>
-<a name="l01754"></a>01754         <span class="keywordflow">if</span> (nb_good < 3) 
-<a name="l01755"></a>01755         {
-<a name="l01756"></a>01756             <span class="comment">/* Too few values to compute the median */</span>
-<a name="l01757"></a>01757             hawki_sci_jitter_output.iq[chip] = fwhms_good_data[0] ;
-<a name="l01758"></a>01758         }
-<a name="l01759"></a>01759         <span class="keywordflow">else</span> 
-<a name="l01760"></a>01760         {
-<a name="l01761"></a>01761             <span class="comment">/* Compute the median */</span>
-<a name="l01762"></a>01762             hawki_sci_jitter_output.iq[chip] = 
-<a name="l01763"></a>01763                 cpl_vector_get_median_const(fwhms_good) ;
-<a name="l01764"></a>01764         }
-<a name="l01765"></a>01765         cpl_vector_delete(fwhms_good) ;
-<a name="l01766"></a>01766         hawki_sci_jitter_output.iq[chip] *= hawki_sci_jitter_output.pixscale ;
-<a name="l01767"></a>01767     }
-<a name="l01768"></a>01768     
-<a name="l01769"></a>01769     <span class="comment">/* Cleanup */</span>
-<a name="l01770"></a>01770     cpl_vector_delete(thresh_vec) ;
-<a name="l01771"></a>01771     
-<a name="l01772"></a>01772     <span class="keywordflow">return</span> 0;
-<a name="l01773"></a>01773 }
-<a name="l01774"></a>01774 
-<a name="l01775"></a>01775 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01787"></a>01787 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01788"></a>01788 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_read_calib
-<a name="l01789"></a>01789 (<span class="keyword">const</span> <span class="keywordtype">char</span> *  flat,
-<a name="l01790"></a>01790  <span class="keyword">const</span> <span class="keywordtype">char</span> *  dark,
-<a name="l01791"></a>01791  <span class="keyword">const</span> <span class="keywordtype">char</span> *  bpm,
-<a name="l01792"></a>01792  cpl_image  ** flat_image,
-<a name="l01793"></a>01793  cpl_image  ** dark_image,
-<a name="l01794"></a>01794  cpl_image  ** bpm_image,
-<a name="l01795"></a>01795  <span class="keywordtype">int</span>           idet)
-<a name="l01796"></a>01796 {
-<a name="l01797"></a>01797     <span class="keyword">const</span> <span class="keywordtype">char</span> * reffile;
-<a name="l01798"></a>01798     <span class="keywordtype">int</span>          ext_nb;
-<a name="l01799"></a>01799     
-<a name="l01800"></a>01800     <span class="keywordflow">if</span>(flat == NULL && dark == NULL && bpm == NULL)
-<a name="l01801"></a>01801         <span class="keywordflow">return</span> 0;
-<a name="l01802"></a>01802     <span class="keywordflow">if</span>(*flat_image != NULL || *dark_image != NULL || *bpm_image != NULL)
-<a name="l01803"></a>01803         <span class="keywordflow">return</span> 0;
-<a name="l01804"></a>01804     
-<a name="l01805"></a>01805     <span class="comment">/* Get the extension number for this detector */</span>
-<a name="l01806"></a>01806     <span class="keywordflow">if</span>(flat != NULL)
-<a name="l01807"></a>01807         reffile = flat;
-<a name="l01808"></a>01808     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(dark != NULL)
-<a name="l01809"></a>01809         reffile = dark;
-<a name="l01810"></a>01810     <span class="keywordflow">else</span>
-<a name="l01811"></a>01811         reffile = bpm;
-<a name="l01812"></a>01812 
-<a name="l01813"></a>01813     <span class="comment">/* Guess which is the extension to read */</span>
-<a name="l01814"></a>01814     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(reffile, idet + 1)) == -1) {
-<a name="l01815"></a>01815         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get the extension with detector %d"</span>,
-<a name="l01816"></a>01816                       idet + 1);
-<a name="l01817"></a>01817         <span class="keywordflow">return</span> -1;
-<a name="l01818"></a>01818     }
-<a name="l01819"></a>01819 
-<a name="l01820"></a>01820     <span class="comment">/* Load the dark image */</span>
-<a name="l01821"></a>01821     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l01822"></a>01822         *dark_image = cpl_image_load(dark, CPL_TYPE_FLOAT, 0, ext_nb);
-<a name="l01823"></a>01823     <span class="comment">/* Load the flat image */</span>
-<a name="l01824"></a>01824     <span class="keywordflow">if</span>(flat != NULL)
-<a name="l01825"></a>01825         *flat_image = cpl_image_load(flat, CPL_TYPE_FLOAT, 0, ext_nb);
-<a name="l01826"></a>01826     <span class="comment">/* Load the bpm image */</span>
-<a name="l01827"></a>01827     <span class="keywordflow">if</span>(bpm != NULL)
-<a name="l01828"></a>01828         *bpm_image = cpl_image_load(bpm, CPL_TYPE_FLOAT, 0, ext_nb);
-<a name="l01829"></a>01829     
-<a name="l01830"></a>01830     <span class="comment">/* Multiply the dark image by the science exposure time */</span>
-<a name="l01831"></a>01831     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l01832"></a>01832         cpl_image_multiply_scalar(*dark_image, hawki_sci_jitter_output.dit);
-<a name="l01833"></a>01833 
-<a name="l01834"></a>01834     <span class="comment">/* Return */</span>
-<a name="l01835"></a>01835     <span class="keywordflow">return</span> 0;
-<a name="l01836"></a>01836 }
-<a name="l01837"></a>01837 
-<a name="l01838"></a>01838 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01847"></a>01847 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01848"></a>01848 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_save
-<a name="l01849"></a>01849 (cpl_image           **  combined,
-<a name="l01850"></a>01850  cpl_image           *   stitched,
-<a name="l01851"></a>01851  cpl_table           **  obj_charac,
-<a name="l01852"></a>01852  cpl_table           **  raw_jitter_stats,
-<a name="l01853"></a>01853  cpl_table           **  bkg_stats,
-<a name="l01854"></a>01854  <span class="keyword">const</span> cpl_table     *   raw_obj_tel_info,
-<a name="l01855"></a>01855  cpl_frameset        *   science_frames,
-<a name="l01856"></a>01856  cpl_frameset        *   calib_frames,
-<a name="l01857"></a>01857  cpl_parameterlist   *   parlist,
-<a name="l01858"></a>01858  cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l01859"></a>01859 {
-<a name="l01860"></a>01860     cpl_propertylist    *   plist ;
-<a name="l01861"></a>01861     <span class="keywordtype">double</span>                  pscale, dit, bg_mean, bg_stdev, bg_instmag ;
-<a name="l01862"></a>01862     cpl_propertylist    **  qclists ;
-<a name="l01863"></a>01863     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l01864"></a>01864     cpl_frameset        *   used_frames;
-<a name="l01865"></a>01865     cpl_propertylist    *   wcslist ;
-<a name="l01866"></a>01866     cpl_propertylist    *   telstats;
-<a name="l01867"></a>01867     cpl_propertylist    *   inputlist ;
-<a name="l01868"></a>01868     <span class="keywordtype">double</span>                  crpix1, crpix2 ;
-<a name="l01869"></a>01869     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l01870"></a>01870     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_sci_jitter"</span> ;
-<a name="l01871"></a>01871     <span class="keywordtype">int</span>                     i;
-<a name="l01872"></a>01872     <span class="keywordtype">int</span>                     ext_chip_1;
-<a name="l01873"></a>01873     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l01874"></a>01874 
-<a name="l01875"></a>01875     <span class="comment">/* Initialise */</span>
-<a name="l01876"></a>01876     pscale = hawki_sci_jitter_output.pixscale;
-<a name="l01877"></a>01877     dit = hawki_sci_jitter_output.dit;
-<a name="l01878"></a>01878 
-<a name="l01879"></a>01879     <span class="comment">/* Get reference frame */</span>
-<a name="l01880"></a>01880     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW);
-<a name="l01881"></a>01881 
-<a name="l01882"></a>01882     <span class="comment">/* Get the used frames */</span> 
-<a name="l01883"></a>01883     used_frames = cpl_frameset_duplicate(science_frames);
-<a name="l01884"></a>01884     <span class="keywordflow">for</span>(i = 0; i< cpl_frameset_get_size(calib_frames); ++i)
-<a name="l01885"></a>01885         cpl_frameset_insert(used_frames, 
-<a name="l01886"></a>01886                 cpl_frame_duplicate(cpl_frameset_get_frame(calib_frames, i)));
-<a name="l01887"></a>01887 
-<a name="l01888"></a>01888     <span class="comment">/* Create the telescope data statistics */</span>
-<a name="l01889"></a>01889     telstats = cpl_propertylist_new();
-<a name="l01890"></a>01890     hawki_compute_prop_tel_qc_stats(raw_obj_tel_info, telstats);
-<a name="l01891"></a>01891 
-<a name="l01892"></a>01892     <span class="comment">/* Create the QC lists */</span>
-<a name="l01893"></a>01893     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l01894"></a>01894     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l01895"></a>01895 
-<a name="l01896"></a>01896         <span class="comment">/* Get the extension number */</span>
-<a name="l01897"></a>01897         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);
-<a name="l01898"></a>01898 
-<a name="l01899"></a>01899         <span class="comment">/* Handle WCS keys */</span>
-<a name="l01900"></a>01900         wcslist = cpl_propertylist_load_regexp(
-<a name="l01901"></a>01901                 cpl_frame_get_filename(ref_frame), ext_nb, HAWKI_HEADER_WCS, 0);
-<a name="l01902"></a>01902         qclists[i] = cpl_propertylist_new() ;
-<a name="l01903"></a>01903 
-<a name="l01904"></a>01904         <span class="comment">/* Compute bg_instmag */</span>
-<a name="l01905"></a>01905         bg_mean = cpl_table_get_column_mean(bkg_stats[i], HAWKI_COL_STAT_MEAN);
-<a name="l01906"></a>01906         <span class="keywordflow">if</span> (cpl_table_get_nrow(bkg_stats[i]) < 2) bg_stdev = 0 ;
-<a name="l01907"></a>01907         <span class="keywordflow">else</span> bg_stdev = cpl_table_get_column_stdev
-<a name="l01908"></a>01908             (bkg_stats[i], HAWKI_COL_STAT_MEAN);
-<a name="l01909"></a>01909         <span class="keywordflow">if</span>(bg_mean >= 0)
-<a name="l01910"></a>01910             bg_instmag = -2.5 * log10(bg_mean/(pscale*pscale*dit));
-<a name="l01911"></a>01911         <span class="keywordflow">else</span>
-<a name="l01912"></a>01912             bg_instmag = 0;
-<a name="l01913"></a>01913 
-<a name="l01914"></a>01914         <span class="comment">/* Fill the QC */</span>
-<a name="l01915"></a>01915         cpl_propertylist_append_double
-<a name="l01916"></a>01916             (qclists[i], <span class="stringliteral">"ESO QC BACKGD MEAN"</span>, bg_mean);
-<a name="l01917"></a>01917         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD MEAN"</span>,
-<a name="l01918"></a>01918                                      <span class="stringliteral">"Mean of all the image mean backgrounds"</span>);
-<a name="l01919"></a>01919         cpl_propertylist_append_double
-<a name="l01920"></a>01920             (qclists[i], <span class="stringliteral">"ESO QC BACKGD STDEV"</span>, bg_stdev);
-<a name="l01921"></a>01921         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD STDEV"</span>,
-<a name="l01922"></a>01922                    <span class="stringliteral">"The standard deviation of all the image mean backgrounds"</span>);
-<a name="l01923"></a>01923         cpl_propertylist_append_double
-<a name="l01924"></a>01924             (qclists[i], <span class="stringliteral">"ESO QC BACKGD INSTMAG"</span>, bg_instmag) ;
-<a name="l01925"></a>01925         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD INSTMAG"</span>,
-<a name="l01926"></a>01926           <span class="stringliteral">"Mean of all the image mean backgrounds in instrumental magnitudes"</span>);
-<a name="l01927"></a>01927         cpl_propertylist_append_int
-<a name="l01928"></a>01928             (qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>, hawki_sci_jitter_output.nbobjs[i]);
-<a name="l01929"></a>01929         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>,
-<a name="l01930"></a>01930                            <span class="stringliteral">"Number of detected objects in the combined image"</span>);
-<a name="l01931"></a>01931         cpl_propertylist_append_double
-<a name="l01932"></a>01932             (qclists[i], <span class="stringliteral">"ESO QC IQ"</span>, hawki_sci_jitter_output.iq[i]);
-<a name="l01933"></a>01933         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC IQ"</span>,
-<a name="l01934"></a>01934                            <span class="stringliteral">"Estimated image quality [arcsec]"</span>);
-<a name="l01935"></a>01935         cpl_propertylist_append_double
-<a name="l01936"></a>01936             (qclists[i], <span class="stringliteral">"ESO QC IQ DIFF AMBI"</span>,
-<a name="l01937"></a>01937              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double
-<a name="l01938"></a>01938                  (telstats, <span class="stringliteral">"ESO QC TEL AMBI FWHM MEAN"</span>));
-<a name="l01939"></a>01939         cpl_propertylist_append_double
-<a name="l01940"></a>01940             (qclists[i], <span class="stringliteral">"ESO QC IQ DIFF TEL"</span>,
-<a name="l01941"></a>01941              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double
-<a name="l01942"></a>01942                  (telstats, <span class="stringliteral">"ESO QC TEL IA FWHM MEAN"</span>));
-<a name="l01943"></a>01943         cpl_propertylist_append_double
-<a name="l01944"></a>01944             (qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,
-<a name="l01945"></a>01945              hawki_sci_jitter_output.fwhm_pix[i]);
-<a name="l01946"></a>01946         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,
-<a name="l01947"></a>01947                                      <span class="stringliteral">"The median FWHM in the image [pixels]"</span>);
-<a name="l01948"></a>01948         cpl_propertylist_append_double
-<a name="l01949"></a>01949             (qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,
-<a name="l01950"></a>01950              hawki_sci_jitter_output.fwhm_arcsec[i]);
-<a name="l01951"></a>01951         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,
-<a name="l01952"></a>01952                                      <span class="stringliteral">"The median FWHM in the image [arcsec]"</span>);
-<a name="l01953"></a>01953         cpl_propertylist_append_double
-<a name="l01954"></a>01954             (qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,
-<a name="l01955"></a>01955              hawki_sci_jitter_output.fwhm_mode[i]);
-<a name="l01956"></a>01956         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,
-<a name="l01957"></a>01957                                      <span class="stringliteral">"The mode FWHM in the image [pixels]"</span>);
-<a name="l01958"></a>01958         cpl_propertylist_append_double
-<a name="l01959"></a>01959             (qclists[i], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,
-<a name="l01960"></a>01960              hawki_sci_jitter_output.combined_pos_x[i]);
-<a name="l01961"></a>01961         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,
-<a name="l01962"></a>01962                                      <span class="stringliteral">"Position in X of the first image"</span>);
-<a name="l01963"></a>01963         cpl_propertylist_append_double
-<a name="l01964"></a>01964             (qclists[i], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,
-<a name="l01965"></a>01965              hawki_sci_jitter_output.combined_pos_y[i]);
-<a name="l01966"></a>01966         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,
-<a name="l01967"></a>01967                                      <span class="stringliteral">"Position in Y of the first image"</span>);
-<a name="l01968"></a>01968         cpl_propertylist_append_double
-<a name="l01969"></a>01969             (qclists[i], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</span>,
-<a name="l01970"></a>01970              hawki_sci_jitter_output.combined_cumoffset_x[i]);
-<a name="l01971"></a>01971         cpl_propertylist_append_double
-<a name="l01972"></a>01972             (qclists[i], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</span>,
-<a name="l01973"></a>01973              hawki_sci_jitter_output.combined_cumoffset_y[i]);
-<a name="l01974"></a>01974         cpl_propertylist_append_int
-<a name="l01975"></a>01975             (qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,hawki_sci_jitter_output.ncomb[i]);
-<a name="l01976"></a>01976         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,
-<a name="l01977"></a>01977                                      <span class="stringliteral">"Number of files used for the reduction"</span>);
-<a name="l01978"></a>01978         cpl_propertylist_append_double
-<a name="l01979"></a>01979             (qclists[i], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,
-<a name="l01980"></a>01980              hawki_sci_jitter_output.mean_airmass);
-<a name="l01981"></a>01981         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,
-<a name="l01982"></a>01982                                      <span class="stringliteral">"Average airmass"</span>);
-<a name="l01983"></a>01983 
-<a name="l01984"></a>01984         <span class="comment">/* Update WCS and write them */</span>
-<a name="l01985"></a>01985         crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); 
-<a name="l01986"></a>01986         crpix1 += hawki_sci_jitter_output.combined_pos_x[i];
-<a name="l01987"></a>01987         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;
-<a name="l01988"></a>01988         crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); 
-<a name="l01989"></a>01989         crpix2 += hawki_sci_jitter_output.combined_pos_y[i] ;
-<a name="l01990"></a>01990         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;
-<a name="l01991"></a>01991         cpl_propertylist_copy_property_regexp
-<a name="l01992"></a>01992             (qclists[i], wcslist, HAWKI_HEADER_WCS, 0) ;
-<a name="l01993"></a>01993         cpl_propertylist_delete(wcslist);
-<a name="l01994"></a>01994 
-<a name="l01995"></a>01995         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l01996"></a>01996         inputlist = cpl_propertylist_load_regexp(
-<a name="l01997"></a>01997                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l01998"></a>01998                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l01999"></a>01999         cpl_propertylist_append(qclists[i], inputlist);
-<a name="l02000"></a>02000         cpl_propertylist_delete(inputlist) ;
-<a name="l02001"></a>02001     }
-<a name="l02002"></a>02002     
-<a name="l02003"></a>02003     <span class="comment">/* Statistics of the raw images in the QC */</span>
-<a name="l02004"></a>02004     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_jitter_stats, qclists);
-<a name="l02005"></a>02005     
-<a name="l02006"></a>02006     <span class="comment">/* Statistics of the detected objects in the QC */</span>
-<a name="l02007"></a>02007     <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>(obj_charac, qclists);
-<a name="l02008"></a>02008 
-<a name="l02009"></a>02009     <span class="comment">/* Write the combined image */</span>
-<a name="l02010"></a>02010     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(<span class="keyword">set</span>,
-<a name="l02011"></a>02011                       parlist,
-<a name="l02012"></a>02012                       used_frames,
-<a name="l02013"></a>02013                       (<span class="keyword">const</span> cpl_image **)combined,
-<a name="l02014"></a>02014                       recipe_name,
-<a name="l02015"></a>02015                       HAWKI_CALPRO_COMBINED,
-<a name="l02016"></a>02016                       HAWKI_PROTYPE_COMBINED, 
-<a name="l02017"></a>02017                       NULL,
-<a name="l02018"></a>02018                       (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l02019"></a>02019                       <span class="stringliteral">"hawki_sci_jitter.fits"</span>);
-<a name="l02020"></a>02020 
-<a name="l02021"></a>02021     <span class="comment">/* Erase the WCS */</span>
-<a name="l02022"></a>02022     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l02023"></a>02023         cpl_propertylist_erase_regexp(qclists[i], HAWKI_HEADER_WCS, 0) ;
-<a name="l02024"></a>02024     }
-<a name="l02025"></a>02025 
-<a name="l02026"></a>02026     <span class="comment">/* Create a propertylist for PRO.x */</span>
-<a name="l02027"></a>02027     plist = cpl_propertylist_new();
-<a name="l02028"></a>02028     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,
-<a name="l02029"></a>02029                                    HAWKI_PROTYPE_STITCHED) ;
-<a name="l02030"></a>02030     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,
-<a name="l02031"></a>02031                                    HAWKI_CALPRO_STITCHED) ;
-<a name="l02032"></a>02032     <span class="comment">/* Handle WCS keys */</span>
-<a name="l02033"></a>02033     ext_chip_1 = 1;
-<a name="l02034"></a>02034     wcslist = cpl_propertylist_load_regexp(
-<a name="l02035"></a>02035             cpl_frame_get_filename(ref_frame), ext_chip_1, HAWKI_HEADER_WCS, 0);
-<a name="l02036"></a>02036     <span class="comment">/* Update WCS and write them */</span>
-<a name="l02037"></a>02037     crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); 
-<a name="l02038"></a>02038     crpix1 += hawki_sci_jitter_output.combined_pos_x[0];
-<a name="l02039"></a>02039     cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;
-<a name="l02040"></a>02040     crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); 
-<a name="l02041"></a>02041     crpix2 += hawki_sci_jitter_output.combined_pos_y[0] ;
-<a name="l02042"></a>02042     cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;
-<a name="l02043"></a>02043     cpl_propertylist_append(plist, wcslist);
-<a name="l02044"></a>02044     cpl_propertylist_delete(wcslist) ;
-<a name="l02045"></a>02045     <span class="comment">/* Write the stitched image */</span>
-<a name="l02046"></a>02046     cpl_dfs_save_image(<span class="keyword">set</span>,
-<a name="l02047"></a>02047                        NULL,
-<a name="l02048"></a>02048                        parlist,
-<a name="l02049"></a>02049                        used_frames,
-<a name="l02050"></a>02050                        NULL,
-<a name="l02051"></a>02051                        stitched,
-<a name="l02052"></a>02052                        CPL_BPP_IEEE_FLOAT,
-<a name="l02053"></a>02053                        recipe_name,
-<a name="l02054"></a>02054                        plist,
-<a name="l02055"></a>02055                        NULL,
-<a name="l02056"></a>02056                        PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l02057"></a>02057                        <span class="stringliteral">"hawki_sci_jitter_stitched.fits"</span>);
-<a name="l02058"></a>02058     cpl_propertylist_delete(plist);
-<a name="l02059"></a>02059 
-<a name="l02060"></a>02060     <span class="comment">/* Write the FITS table with the objects statistics */</span>
-<a name="l02061"></a>02061     <span class="keywordflow">if</span> (obj_charac) 
-<a name="l02062"></a>02062     {
-<a name="l02063"></a>02063         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l02064"></a>02064                           parlist,
-<a name="l02065"></a>02065                           used_frames,
-<a name="l02066"></a>02066                           (<span class="keyword">const</span> cpl_table **)obj_charac,
-<a name="l02067"></a>02067                           recipe_name,
-<a name="l02068"></a>02068                           HAWKI_CALPRO_OBJ_PARAM,
-<a name="l02069"></a>02069                           HAWKI_PROTYPE_OBJ_PARAM,
-<a name="l02070"></a>02070                           NULL,
-<a name="l02071"></a>02071                           (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l02072"></a>02072                           <span class="stringliteral">"hawki_sci_jitter_stars.fits"</span>);
-<a name="l02073"></a>02073     }
-<a name="l02074"></a>02074 
-<a name="l02075"></a>02075     <span class="comment">/* Write the table with the background statistics */</span>
-<a name="l02076"></a>02076     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l02077"></a>02077                       parlist,
-<a name="l02078"></a>02078                       used_frames,   
-<a name="l02079"></a>02079                       (<span class="keyword">const</span> cpl_table **)bkg_stats,
-<a name="l02080"></a>02080                       recipe_name,
-<a name="l02081"></a>02081                       HAWKI_CALPRO_JITTER_BKG_STATS,
-<a name="l02082"></a>02082                       HAWKI_PROTYPE_JITTER_BKG_STATS,
-<a name="l02083"></a>02083                       NULL,
-<a name="l02084"></a>02084                       (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l02085"></a>02085                       <span class="stringliteral">"hawki_sci_jitter_bkg_stats.fits"</span>);
-<a name="l02086"></a>02086 
-<a name="l02087"></a>02087     <span class="comment">/* Free and return */</span>
-<a name="l02088"></a>02088     cpl_frameset_delete(used_frames);
-<a name="l02089"></a>02089     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l02090"></a>02090         cpl_propertylist_delete(qclists[i]) ;
-<a name="l02091"></a>02091     }
-<a name="l02092"></a>02092     cpl_propertylist_delete(telstats) ;
-<a name="l02093"></a>02093     cpl_free(qclists) ;
-<a name="l02094"></a>02094     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l02095"></a>02095     {
-<a name="l02096"></a>02096         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l02097"></a>02097         <span class="keywordflow">return</span> -1;
-<a name="l02098"></a>02098     }
-<a name="l02099"></a>02099     <span class="keywordflow">return</span>  0;
-<a name="l02100"></a>02100 }
-<a name="l02101"></a>02101 
-<a name="l02102"></a>02102 <span class="keywordtype">int</span> hawki_sci_jitter_whole_image_algo
-<a name="l02103"></a>02103 (cpl_frameset       *  obj,
-<a name="l02104"></a>02104  cpl_table          ** raw_jitter_stats,
-<a name="l02105"></a>02105  cpl_table          *  raw_obj_tel_info,
-<a name="l02106"></a>02106  cpl_parameterlist  *  parlist,
-<a name="l02107"></a>02107  cpl_frameset       *  recipe_set)
-<a name="l02108"></a>02108 {
-<a name="l02109"></a>02109     <span class="keywordtype">int</span>                 nframes;
-<a name="l02110"></a>02110     <span class="keywordtype">int</span>                 iframe;
-<a name="l02111"></a>02111 
-<a name="l02112"></a>02112     
-<a name="l02113"></a>02113     nframes = cpl_frameset_get_size(obj);
-<a name="l02114"></a>02114     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l02115"></a>02115     {
-<a name="l02116"></a>02116         <span class="comment">/* Local storage variables */</span>
-<a name="l02117"></a>02117         cpl_frame        * this_target_frame;
-<a name="l02118"></a>02118         cpl_propertylist * this_properties;
-<a name="l02119"></a>02119 
-<a name="l02120"></a>02120         <span class="comment">/* Computing statistics for this frame */</span>
-<a name="l02121"></a>02121         cpl_msg_info(cpl_func, <span class="stringliteral">"Getting statistics for image %d"</span>, iframe + 1);
-<a name="l02122"></a>02122         this_target_frame = cpl_frameset_get_frame(obj, iframe);
-<a name="l02123"></a>02123         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a>
-<a name="l02124"></a>02124             (raw_jitter_stats, this_target_frame, iframe);
-<a name="l02125"></a>02125 
-<a name="l02126"></a>02126         <span class="comment">/* Compute the telescope pcs statistics */</span>
-<a name="l02127"></a>02127         this_properties = cpl_propertylist_load
-<a name="l02128"></a>02128             (cpl_frame_get_filename(this_target_frame), 0);
-<a name="l02129"></a>02129         <span class="keywordflow">if</span>(this_properties == NULL)
-<a name="l02130"></a>02130         {
-<a name="l02131"></a>02131             cpl_msg_error(cpl_func,<span class="stringliteral">"Could not read the header of object frame"</span>);
-<a name="l02132"></a>02132             <span class="keywordflow">return</span>  -1;
-<a name="l02133"></a>02133         }
-<a name="l02134"></a>02134         <span class="keywordflow">if</span>(<a class="code" href="group__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a>(this_properties, raw_obj_tel_info, iframe))
-<a name="l02135"></a>02135         {
-<a name="l02136"></a>02136             cpl_msg_warning(cpl_func,<span class="stringliteral">"Some telescope properties could not be "</span>
-<a name="l02137"></a>02137                             <span class="stringliteral">"read for image %d"</span>, iframe+1);
-<a name="l02138"></a>02138             cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l02139"></a>02139         }
-<a name="l02140"></a>02140         cpl_propertylist_delete(this_properties);
-<a name="l02141"></a>02141     }
-<a name="l02142"></a>02142 
-<a name="l02143"></a>02143     <span class="comment">/* Saving the already computed products */</span>
-<a name="l02144"></a>02144     cpl_msg_info(cpl_func, <span class="stringliteral">"Saving image statistics"</span>);
-<a name="l02145"></a>02145     <span class="keywordflow">if</span>(hawki_sci_jitter_save_stats(raw_jitter_stats, raw_obj_tel_info, 
-<a name="l02146"></a>02146                                    obj,
-<a name="l02147"></a>02147                                    parlist, recipe_set) != 0)
-<a name="l02148"></a>02148         cpl_msg_warning(cpl_func,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l02149"></a>02149                         <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l02150"></a>02150         
-<a name="l02151"></a>02151     
-<a name="l02152"></a>02152     <span class="comment">/* Free and return */</span>
-<a name="l02153"></a>02153     <span class="keywordflow">return</span> 0;
-<a name="l02154"></a>02154 }
-<a name="l02155"></a>02155 
-<a name="l02156"></a>02156 <span class="keywordtype">int</span> hawki_sci_jitter_save_stats
-<a name="l02157"></a>02157 (cpl_table          ** raw_jitter_stats,
-<a name="l02158"></a>02158  cpl_table          *  raw_obj_tel_info,
-<a name="l02159"></a>02159  cpl_frameset       *  jitter_frames,
-<a name="l02160"></a>02160  cpl_parameterlist  *  parlist,
-<a name="l02161"></a>02161  cpl_frameset       *  recipe_set)
-<a name="l02162"></a>02162 {
-<a name="l02163"></a>02163     <span class="keywordtype">int</span>                 idet;
-<a name="l02164"></a>02164     <span class="keyword">const</span> cpl_frame  *  ref_frame;
-<a name="l02165"></a>02165     cpl_propertylist ** qcstats;
-<a name="l02166"></a>02166     cpl_propertylist *  telstats;
-<a name="l02167"></a>02167     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_sci_jitter"</span> ;
-<a name="l02168"></a>02168     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l02169"></a>02169     
-<a name="l02170"></a>02170     <span class="comment">/* Statistics of the raw images in the QC */</span>
-<a name="l02171"></a>02171     qcstats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l02172"></a>02172     <span class="comment">/* Create the QC lists */</span>
-<a name="l02173"></a>02173     ref_frame = irplib_frameset_get_first_from_group
-<a name="l02174"></a>02174         (recipe_set, CPL_FRAME_GROUP_RAW);
-<a name="l02175"></a>02175     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l02176"></a>02176     {
-<a name="l02177"></a>02177         <span class="keywordtype">int</span>                ext_nb;
-<a name="l02178"></a>02178         cpl_propertylist * reflist;
-<a name="l02179"></a>02179         
-<a name="l02180"></a>02180         qcstats[idet] = cpl_propertylist_new();
-<a name="l02181"></a>02181         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l02182"></a>02182         ext_nb = 
-<a name="l02183"></a>02183             <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+1);
-<a name="l02184"></a>02184         reflist = cpl_propertylist_load_regexp
-<a name="l02185"></a>02185             (cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l02186"></a>02186              HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l02187"></a>02187         cpl_propertylist_append(qcstats[idet], reflist);
-<a name="l02188"></a>02188         cpl_propertylist_delete(reflist);
-<a name="l02189"></a>02189     }
-<a name="l02190"></a>02190     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_jitter_stats, qcstats);
-<a name="l02191"></a>02191     <span class="comment">/* Write the table with the raw jitter objects statistics */</span>
-<a name="l02192"></a>02192     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_set,
-<a name="l02193"></a>02193                       parlist,
-<a name="l02194"></a>02194                       jitter_frames,
-<a name="l02195"></a>02195                       (<span class="keyword">const</span> cpl_table **)raw_jitter_stats,
-<a name="l02196"></a>02196                       recipe_name,
-<a name="l02197"></a>02197                       HAWKI_CALPRO_JITTER_STATS,
-<a name="l02198"></a>02198                       HAWKI_PROTYPE_JITTER_STATS,
-<a name="l02199"></a>02199                       NULL,
-<a name="l02200"></a>02200                       (<span class="keyword">const</span> cpl_propertylist**)qcstats,
-<a name="l02201"></a>02201                       <span class="stringliteral">"hawki_sci_jitter_stats.fits"</span>);
-<a name="l02202"></a>02202     <span class="comment">/* Free qcstats */</span>
-<a name="l02203"></a>02203     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l02204"></a>02204         cpl_propertylist_delete(qcstats[idet]);
-<a name="l02205"></a>02205     
-<a name="l02206"></a>02206     <span class="comment">/* Write the FITS table with the raw telescope data */</span>
-<a name="l02207"></a>02207     telstats = cpl_propertylist_new();
-<a name="l02208"></a>02208     cpl_propertylist_append_string(telstats, CPL_DFS_PRO_TYPE,
-<a name="l02209"></a>02209                                    HAWKI_PROTYPE_SCIENCE_PCS);
-<a name="l02210"></a>02210     cpl_propertylist_append_string(telstats, CPL_DFS_PRO_CATG,
-<a name="l02211"></a>02211                                    HAWKI_CALPRO_SCIENCE_PCS);
-<a name="l02212"></a>02212     hawki_compute_prop_tel_qc_stats(raw_obj_tel_info, telstats);
-<a name="l02213"></a>02213     <span class="keywordflow">if</span>(cpl_dfs_save_table(recipe_set,
-<a name="l02214"></a>02214                           NULL,
-<a name="l02215"></a>02215                           parlist,
-<a name="l02216"></a>02216                           jitter_frames,
-<a name="l02217"></a>02217                           NULL,
-<a name="l02218"></a>02218                           raw_obj_tel_info,
-<a name="l02219"></a>02219                           NULL,
-<a name="l02220"></a>02220                           recipe_name,
-<a name="l02221"></a>02221                           telstats,
-<a name="l02222"></a>02222                           NULL,
-<a name="l02223"></a>02223                           PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l02224"></a>02224                           <span class="stringliteral">"hawki_sci_jitter_pcs.fits"</span>) != CPL_ERROR_NONE)
-<a name="l02225"></a>02225         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot save PCS table"</span>);
-<a name="l02226"></a>02226     
-<a name="l02227"></a>02227     <span class="comment">/* Free and return */</span>
-<a name="l02228"></a>02228     cpl_propertylist_delete(telstats);
-<a name="l02229"></a>02229     cpl_free(qcstats);
-<a name="l02230"></a>02230     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l02231"></a>02231     {
-<a name="l02232"></a>02232         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l02233"></a>02233         <span class="keywordflow">return</span> -1;
-<a name="l02234"></a>02234     }
-<a name="l02235"></a>02235         
-<a name="l02236"></a>02236     <span class="keywordflow">return</span> 0;
-<a name="l02237"></a>02237 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_sci_jitter.c,v 1.34 2013/01/15 09: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/01/15 09:58:25 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_calib.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_saa.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_bkg.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "hawki_properties_tel.h"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#include "hawki_obj_det.h"</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="l00057"></a><span class="lineno">   57</span> <span class="comment">                                Define</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> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="comment">                            Functions prototypes</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="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">int</span> hawki_sci_jitter_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter(cpl_parameterlist *, cpl_frameset *) ;</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="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_retrieve_input_param</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_reduce</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> (cpl_frameset      *   jitters,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  cpl_frameset      *   sky,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   flat,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   dark,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   bpm,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_table         **  bkg_stats);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> (cpl_imagelist   *   jitters,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  cpl_imagelist   *   skys,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>  cpl_table       **  bkg_stats,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keywordtype">int</span>                 idet);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky_running</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> (cpl_imagelist *  in,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  cpl_table     ** bkg_stats,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>  <span class="keywordtype">int</span>              idet); </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_saa(cpl_imagelist **, cpl_bivector *, </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_qc</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> (cpl_frameset *   science_frames,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>  cpl_image   **   combined, </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>  cpl_table   **   obj_charac);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_read_calib</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *  flat,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *  dark,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *  bpm,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>  cpl_image  ** flat_image,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>  cpl_image  ** dark_image,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>  cpl_image  ** bpm_image,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>  <span class="keywordtype">int</span>           idet);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_save</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> (cpl_image           **  combined,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>  cpl_image           *   stitched,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>  cpl_table           **  objs_charac,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>  cpl_table           **  raw_jitter_stats,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>  cpl_table           **  bkg_stats,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>  <span class="keyword">const</span> cpl_table     *   raw_obj_tel_info,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>  cpl_frameset        *   science_frames,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>  cpl_frameset        *   calib_frames,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>  cpl_frameset        *   <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="keywordtype">int</span> hawki_sci_jitter_whole_image_algo</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> (cpl_frameset       *  obj,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>  cpl_table          ** raw_jitter_stats,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>  cpl_table          *  raw_obj_tel_info,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>  cpl_parameterlist  *  parlist,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>  cpl_frameset       *  recipe_set);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="keywordtype">int</span> hawki_sci_jitter_save_stats</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> (cpl_table          ** raw_jitter_stats,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>  cpl_table          *  raw_obj_tel_info,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>  cpl_frameset       *  jitter_frames,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>  cpl_parameterlist  *  parlist,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>  cpl_frameset       *  recipe_set);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="keyword">static</span> <span class="keyword">struct </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">/* Inputs */</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   offsets ;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   objects ;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordtype">int</span>                 offset_max ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordtype">int</span>                 sky_minnb ;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="keywordtype">int</span>                 sky_halfw ;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="keywordtype">int</span>                 sky_rejmin ;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordtype">int</span>                 sky_rejmax ;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordtype">int</span>                 refine ;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordtype">int</span>                 sx ;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="keywordtype">int</span>                 sy ;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordtype">int</span>                 mx ;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keywordtype">int</span>                 my ;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordtype">int</span>                 borders ;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_geom_combine    comb_meth ;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordtype">int</span>                 rej_low ;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keywordtype">int</span>                 rej_high ;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keywordtype">int</span>                 max_njitter;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> } hawki_sci_jitter_config;</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="keyword">static</span> <span class="keyword">struct </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="comment">/* Outputs */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keywordtype">double</span>          pixscale;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordtype">double</span>          dit;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordtype">double</span>          mean_airmass;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordtype">double</span>          iq[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keywordtype">int</span>             nbobjs[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordtype">double</span>          fwhm_pix[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keywordtype">double</span>          fwhm_arcsec[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keywordtype">double</span>          fwhm_mode[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keywordtype">double</span>          combined_pos_x[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordtype">double</span>          combined_pos_y[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="keywordtype">double</span>          combined_cumoffset_x[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     <span class="keywordtype">double</span>          combined_cumoffset_y[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordtype">int</span>             ncomb[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> } hawki_sci_jitter_output;</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">static</span> <span class="keywordtype">char</span> hawki_sci_jitter_description[] =</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="stringliteral">"hawki_sci_jitter -- hawki imaging jitter recipe.\n\n"</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_SKY_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" \n"</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="stringliteral">"distortion_x-file.fits "</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="stringliteral">"distortion_y-file.fits "</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">"\n\n"</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="stringliteral">"hawki_sci_jitter.fits ("</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="stringliteral">"hawki_sci_jitter_stitched.fits ("</span>HAWKI_CALPRO_STITCHED<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="stringliteral">"hawki_sci_jitter_stars.fits ("</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"): Detected objects properties\n"</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="stringliteral">"hawki_sci_jitter_stats.fits ("</span>HAWKI_CALPRO_JITTER_STATS<span class="stringliteral">"): Stats of the individual images\n"</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="stringliteral">"hawki_sci_jitter_bkg_stats.fits ("</span>HAWKI_CALPRO_JITTER_BKG_STATS<span class="stringliteral">"): Statistics on the bkg\n\n"</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="stringliteral">"The recipe performs the following steps:\n"</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="stringliteral">"1) Frame statistics\n"</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="stringliteral">"2) Basic reduction (using "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" and "</span>HAWKI_CALPRO_BPM<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="stringliteral">"3) Background computation (the algorithm depends on parameter --sky_par) \n"</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="stringliteral">"4) Offset refinement (uses parameters --off, --refine and --xcorr)\n"</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="stringliteral">"5) Stacking of jitter frames (uses --comb_meth, --rej,\n"</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="stringliteral">"   --offset_max, --borders, --max_njitter)\n"</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="stringliteral">"6) Stitching of the four detectors into one image\n"</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="stringliteral">"7) Object detection in the stacked image\n\n"</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="stringliteral">"or 1 otherwise"</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> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">                                Functions code</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                     <span class="stringliteral">"hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                     <span class="stringliteral">"Jitter recipe"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                     hawki_sci_jitter_description,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                     <span class="stringliteral">"Cesar Enrique Garcia"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                     hawki_sci_jitter_create,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                     hawki_sci_jitter_exec,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                     hawki_sci_jitter_destroy) ;</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>     cpl_pluginlist_append(list, plugin) ;</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> 0;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_create(cpl_plugin * plugin)</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_recipe      * recipe ;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_parameter   * p ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keywordflow">else</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="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="comment">/* --offsets */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.offsets"</span>, </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             CPL_TYPE_STRING, <span class="stringliteral">"offsets file"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>, NULL) ;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"offsets"</span>) ;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --objects */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.objects"</span>, </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>             CPL_TYPE_STRING, <span class="stringliteral">"objects file"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>, NULL) ;</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">"objects"</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">/* --offset_max */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.offset_max"</span>,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 <span class="stringliteral">"Maximum offset allowed"</span>,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 1500) ;</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">"offset_max"</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">/* --sky_par */</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.sky_par"</span>,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                 <span class="stringliteral">"Rejection parameters for sky filtering"</span>,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                 <span class="stringliteral">"10,7,3,3"</span>) ;</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">"sky_par"</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">/* --refine */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.refine"</span>,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>             CPL_TYPE_BOOL, <span class="stringliteral">"refine offsets"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>             FALSE);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"refine"</span>) ;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --xcorr */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.xcorr"</span>,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                                 <span class="stringliteral">"Cross correlation search and measure sizes"</span>,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                                 <span class="stringliteral">"20,20,25,25"</span>) ;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcorr"</span>) ;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --comb_meth */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.comb_meth"</span>, </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>             CPL_TYPE_STRING, <span class="stringliteral">"union / inter / first"</span>, <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>             <span class="stringliteral">"union"</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">"comb_meth"</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">/* --rej */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.rej"</span>,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                                 <span class="stringliteral">"Low and high number of rejected values"</span>,</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                                 <span class="stringliteral">"1,1"</span>) ;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"rej"</span>) ;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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="comment">/* --borders */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.borders"</span>,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                                 <span class="stringliteral">"Borders rejected"</span>,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                                 4) ;</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">"borders"</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">/* --max_njitter */</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_sci_jitter.max_njitter"</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">"Maximum numbers of jitter frames to combine"</span>,</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                                 <span class="stringliteral">"hawki.hawki_sci_jitter"</span>,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                                 -1);</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">"max_njitter"</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">/* Return */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_sci_jitter(recipe->parameters, recipe->frames) ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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 the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter(</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         cpl_frameset        *   framelist)</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="keyword">const</span> <span class="keywordtype">char</span>      *   flat;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   dark;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keyword">const</span> cpl_frame *   distx;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keyword">const</span> cpl_frame *   disty;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     cpl_frameset    *   jitterframes ;</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_frameset    *   skyframes ;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_frameset    *   science_frames;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_frameset    *   calib_frames;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_image       **  combined ;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     cpl_table       **  obj_charac;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     cpl_table       **  raw_jitter_stats; </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     cpl_table       **  bkg_stats; </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     cpl_table       *   raw_obj_tel_info;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     cpl_image       *   stitched ;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordtype">int</span>                 i;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </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>         hawki_sci_jitter_output.iq[i] = -1.0 ;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         hawki_sci_jitter_output.nbobjs[i] = -1 ;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>         hawki_sci_jitter_output.fwhm_pix[i] = -1.0 ;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         hawki_sci_jitter_output.fwhm_arcsec[i] = -1.0 ;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         hawki_sci_jitter_output.fwhm_mode[i] = -1.0 ;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         hawki_sci_jitter_output.combined_pos_x[i] = -1.0 ;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         hawki_sci_jitter_output.combined_pos_y[i] = -1.0 ;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         hawki_sci_jitter_output.combined_cumoffset_x[i] = -1.0 ;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         hawki_sci_jitter_output.combined_cumoffset_y[i] = -1.0 ;</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>     hawki_sci_jitter_output.pixscale = -1.0 ;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     hawki_sci_jitter_output.dit = -1.0 ;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     hawki_sci_jitter_config.offsets = NULL ;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     hawki_sci_jitter_config.objects = NULL ;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     calib_frames = cpl_frameset_new();</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="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span>(hawki_sci_jitter_retrieve_input_param(parlist))</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_msg_error(cpl_func, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         <span class="keywordflow">return</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> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     <span class="comment">/* Retrieve calibration data */</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     flat   = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_FLAT) ;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     dark   = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_DARK);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     bpm    = <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(framelist, HAWKI_CALPRO_BPM) ;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     distx  = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DISTORTION_X);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     disty  = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DISTORTION_Y);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">if</span>((distx == NULL && disty !=NULL) || (distx != NULL && disty ==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_msg_error(cpl_func, <span class="stringliteral">"Both distortion in X (%s) and Y (%s) must be provided"</span>,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                       HAWKI_CALPRO_DISTORTION_X, HAWKI_CALPRO_DISTORTION_Y);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         <span class="keywordflow">return</span> -1 ;</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>(flat)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT)));</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span>(dark)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_DARK)));</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">if</span>(bpm)</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                 cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM)));</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">if</span>(distx)</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_frameset_insert(calib_frames, cpl_frame_duplicate(distx));</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         cpl_frameset_insert(calib_frames, cpl_frame_duplicate(disty));</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> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     jitterframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">if</span> (jitterframes == NULL) {</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find jitter frames in the input list (%s)"</span>,</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>                       HAWKI_IMG_JITTER_RAW);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         <span class="keywordflow">return</span> -1 ;</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>     science_frames = cpl_frameset_duplicate(jitterframes);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_SKY_RAW) ;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">if</span> (skyframes != NULL) </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="keywordtype">int</span> isky;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         <span class="keywordflow">for</span>(isky = 0; isky< cpl_frameset_get_size(skyframes); ++isky)</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             cpl_frameset_insert(science_frames, </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                     cpl_frame_duplicate(cpl_frameset_get_frame(skyframes, isky)));</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">/* Create the statistics table */</span></div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     raw_jitter_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; 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>         raw_jitter_stats[i] = cpl_table_new(cpl_frameset_get_size(jitterframes));</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__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(raw_jitter_stats);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     bkg_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; 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>         bkg_stats[i] = cpl_table_new(cpl_frameset_get_size(jitterframes));</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>     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(bkg_stats);</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">/* Create the  telescope statistics parameters from the raw images */</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     raw_obj_tel_info = cpl_table_new(cpl_frameset_get_size(jitterframes));</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="comment">/* Add the proper columns of the pcs table */</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__properties__tel.html#ga2895d7c995564a2bbbdcab5c195cfac9" title="Initialize the table with all the telescope data columns.">hawki_prop_tel_initialize</a>(raw_obj_tel_info))</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>         cpl_msg_error(cpl_func,<span class="stringliteral">"Could not initialize the pcs table"</span>);</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         cpl_frameset_delete(jitterframes) ;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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_table_delete(raw_jitter_stats[i]) ;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>             cpl_table_delete(bkg_stats[i]) ;</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_free(raw_jitter_stats) ;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         cpl_free(bkg_stats) ;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         cpl_table_delete(raw_obj_tel_info);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes) ;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Do the algorithms that need the whole image */</span></div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     hawki_sci_jitter_whole_image_algo(jitterframes,</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                                       raw_jitter_stats,</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                                       raw_obj_tel_info,</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                                       parlist,</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                                       framelist);</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">/* Apply the reduction */</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <span class="comment">/* Do the algorithms that can be applied to subsection of the images */</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Apply the data combination"</span>) ;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordflow">if</span> ((combined = hawki_sci_jitter_reduce(jitterframes, skyframes, flat, dark,</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                     bpm, bkg_stats)) == NULL) </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_msg_error(cpl_func, <span class="stringliteral">"Cannot recombine the data"</span>);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         cpl_frameset_delete(jitterframes);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; 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>             cpl_table_delete(raw_jitter_stats[i]) ;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>             cpl_table_delete(bkg_stats[i]) ;</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>         cpl_free(raw_jitter_stats) ;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         cpl_free(bkg_stats) ;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         cpl_table_delete(raw_obj_tel_info);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes) ;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         <span class="keywordflow">return</span> -1 ;</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_msg_indent_less() ;</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">/* Compute QC parameters from the combined image */</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Compute QC parameters from the combined images"</span>) ;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     obj_charac = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*)) ;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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>         obj_charac[i] = cpl_table_new(0);</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>     <span class="keywordflow">if</span> ((hawki_sci_jitter_qc(jitterframes, combined, obj_charac)) != 0)</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_msg_warning(cpl_func, <span class="stringliteral">"Cannot compute all parameters"</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>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     cpl_frameset_delete(jitterframes);</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">if</span> (skyframes) cpl_frameset_delete(skyframes);</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>  </div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <span class="comment">/* Correct for the distortion */</span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (distx && disty)</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(cpl_func, <span class="stringliteral">"Applying the distortion correction"</span>) ;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__distortion.html#ga52da9acfab98a1592e65df9c6bfba484" title="Apply the distortion correction.">hawki_distortion_correct_alldetectors</a>(combined, distx, disty) == -1) </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_error(cpl_func, <span class="stringliteral">"Cannot correct the distortion"</span>) ;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>             <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                 cpl_image_delete(combined[i]) ;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>             cpl_free(combined) ;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>             <span class="keywordflow">if</span> (obj_charac) {</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>                 <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>                     cpl_table_delete(obj_charac[i]) ;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>                 cpl_free(obj_charac);</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>             cpl_table_delete(raw_obj_tel_info);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>             <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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_table_delete(raw_jitter_stats[i]);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>                 cpl_table_delete(bkg_stats[i]);</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_free(raw_jitter_stats);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>             cpl_free(bkg_stats);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>             cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             cpl_frameset_delete(science_frames);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>             <span class="keywordflow">return</span> -1;</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>     }</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">/* Compute the stitched image */</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Compute the stiched image"</span>) ;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keywordflow">if</span> ((stitched = <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>(combined, </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                     hawki_sci_jitter_output.combined_pos_x,</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                     hawki_sci_jitter_output.combined_pos_y)) == 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_msg_error(cpl_func, <span class="stringliteral">"Cannot stitch the images"</span>) ;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>             cpl_image_delete(combined[i]) ;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         cpl_free(combined) ;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         <span class="keywordflow">if</span> (obj_charac) {</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>             <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                 cpl_table_delete(obj_charac[i]) ;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>             cpl_free(obj_charac);</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>         cpl_table_delete(raw_obj_tel_info);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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>             cpl_table_delete(raw_jitter_stats[i]);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>             cpl_table_delete(bkg_stats[i]);</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>         cpl_free(raw_jitter_stats);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         cpl_free(bkg_stats);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         cpl_frameset_delete(science_frames);</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         <span class="keywordflow">return</span> -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> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="comment">/* Save the products */</span></div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_save(combined, stitched, obj_charac,</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                               raw_jitter_stats, bkg_stats, </div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                               raw_obj_tel_info,</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>                               science_frames,</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>                               calib_frames,</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>                               parlist, framelist) == -1)</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>         cpl_msg_warning(cpl_func,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                                  <span class="stringliteral">"Check permisions or disk space"</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>         cpl_image_delete(combined[i]) ;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     cpl_free(combined) ;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordflow">if</span> (obj_charac) {</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>             cpl_table_delete(obj_charac[i]) ;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>         cpl_free(obj_charac);</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">if</span> (stitched) cpl_image_delete(stitched) ;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     cpl_table_delete(raw_obj_tel_info);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordflow">for</span>( i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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>         cpl_table_delete(raw_jitter_stats[i]);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         cpl_table_delete(bkg_stats[i]);</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_free(raw_jitter_stats);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     cpl_free(bkg_stats);</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     cpl_frameset_delete(calib_frames);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_frameset_delete(science_frames);</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     cpl_msg_indent_less() ;</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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>         cpl_msg_error(cpl_func,</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>         <span class="keywordflow">return</span> -1 ;</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">else</span> <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="keywordtype">int</span> hawki_sci_jitter_retrieve_input_param</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> (cpl_parameterlist  *  parlist)</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>     cpl_parameter   *   par ;</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     par = NULL ;</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.offsets"</span>);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     hawki_sci_jitter_config.offsets = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.objects"</span>);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     hawki_sci_jitter_config.objects = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.offset_max"</span>);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     hawki_sci_jitter_config.offset_max = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.sky_par"</span>);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                &hawki_sci_jitter_config.sky_minnb,</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>                &hawki_sci_jitter_config.sky_halfw,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                &hawki_sci_jitter_config.sky_rejmin,</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>                &hawki_sci_jitter_config.sky_rejmax)!=4)</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">return</span> -1;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.xcorr"</span>);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                &hawki_sci_jitter_config.sx,</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                &hawki_sci_jitter_config.sy,</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>                &hawki_sci_jitter_config.mx,</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                &hawki_sci_jitter_config.my)!=4)</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">return</span> -1;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.refine"</span>);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     hawki_sci_jitter_config.refine = cpl_parameter_get_bool(par);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.comb_meth"</span>);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"union"</span>))</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     hawki_sci_jitter_config.comb_meth = CPL_GEOM_UNION;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"inter"</span>))</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     hawki_sci_jitter_config.comb_meth = CPL_GEOM_INTERSECT;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"first"</span>))</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     hawki_sci_jitter_config.comb_meth = CPL_GEOM_FIRST;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordflow">else</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>         cpl_msg_error(cpl_func, <span class="stringliteral">"Invalid combine method specified"</span>);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         <span class="keywordflow">return</span> -1;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.borders"</span>);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     hawki_sci_jitter_config.borders = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.rej"</span>);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d"</span>,</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>                &hawki_sci_jitter_config.rej_low,</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>                &hawki_sci_jitter_config.rej_high)!=2)</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> -1;</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>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_sci_jitter.max_njitter"</span>);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     hawki_sci_jitter_config.max_njitter = cpl_parameter_get_int(par);</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> </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> </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_image ** hawki_sci_jitter_reduce</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> (cpl_frameset      *   jitters,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>  cpl_frameset      *   sky,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   flat,</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   dark,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *   bpm,</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>  cpl_table         **  bkg_stats)</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_frame           *   frame ;</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     cpl_image           **  comb_chip ;</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     cpl_image           **  combined ;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_bivector        *   offsets ;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     cpl_vector          *   offset_x_sort; </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     cpl_vector          *   offset_y_sort; </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     <span class="keywordtype">double</span>              *   offs_est_x ;</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     <span class="keywordtype">double</span>              *   offs_est_y ;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     <span class="keywordtype">double</span>                  off_0_x;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     <span class="keywordtype">double</span>                  off_0_y;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     <span class="keywordtype">double</span>                  max_x, max_y ;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     <span class="keywordtype">int</span>                     ioff;</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">/* Get the header infos */</span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     frame = cpl_frameset_get_frame(jitters, 0) ;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     plist=cpl_propertylist_load(cpl_frame_get_filename(frame), 0) ;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     hawki_sci_jitter_output.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist) ;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     hawki_sci_jitter_output.dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist) ;</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Missing keyword in FITS header"</span>) ;</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     <span class="comment">/* Check that DIT/NDIT and NDSAMPLES are the same for all the frames */</span></div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>) ||</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga7c2b338fdf41bdeb1149b60af82c0788" title="find out the NDIT value">hawki_pfits_get_ndit</a>)||</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>        !<a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga0d1ccf97334b28566b2bc8fe17786190" title="find out the NDSAMPLES value">hawki_pfits_get_ndsamples</a>))</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>         cpl_msg_error(__func__, <span class="stringliteral">"Not all input science have the same "</span></div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                 <span class="stringliteral">"DIT/NDIT/NDSAMPLES values"</span>);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>         <span class="keywordflow">return</span> 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">/* Check that pointing is the same for all the frames */</span></div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#ga0645065208992d9bf67d189796db4e67" title="find out the target RA in HHMMSS format">hawki_pfits_get_targ_alpha_hhm [...]
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>        !<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(jitters, &<a class="code" href="group__hawki__pfits.html#gae4655f62c9a6997a95fd2794e82640b3" title="find out the target DEC in DDMMSS format">hawki_pfits_get_targ_delta_ddmmss</a>))</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_msg_error(__func__, <span class="stringliteral">"Not all input science frames belong to the "</span></div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                 <span class="stringliteral">"same pointing/target. Check keywords TEL TARG ALPHA/DELTA"</span>);</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         <span class="keywordflow">return</span> 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">/* Get the offsets */</span></div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(jitters)) == NULL) {</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load the offsets"</span>) ;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         <span class="keywordflow">return</span> 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>     offs_est_x = cpl_bivector_get_x_data(offsets) ;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     offs_est_y = cpl_bivector_get_y_data(offsets) ;</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="comment">/* Print the header offsets */</span></div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets) ; ioff++) {</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>                 offs_est_x[ioff], offs_est_y[ioff]) ;</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">/* Subtract the first offset to all offsets */</span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>     off_0_x = -offs_est_x[0]; <span class="comment">// This is to get the cpl convention</span></div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>     off_0_y = -offs_est_y[0];</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>     <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(offsets) ; ioff++) </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>         offs_est_x[ioff] -= offs_est_x[0] ;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>         offs_est_y[ioff] -= offs_est_y[0] ;</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>     offs_est_x[0] = offs_est_y[0] = 0.00 ;</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">/* Check if the max offset is not too big */</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>     <span class="comment">/* The criteria is that for a given frame, the closest frame cannot be </span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> <span class="comment">     * further than hawki_sci_jitter_config.offset_max (in both dimensions) */</span></div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     offset_x_sort = cpl_vector_duplicate(cpl_bivector_get_x(offsets));</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     offset_y_sort = cpl_vector_duplicate(cpl_bivector_get_y(offsets));</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>     cpl_vector_sort(offset_x_sort, +1);</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     cpl_vector_sort(offset_y_sort, +1);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets) - 1 ; ioff++)</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> diff_x, diff_y;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         diff_x = cpl_vector_get(offset_x_sort,ioff+1)-cpl_vector_get(offset_x_sort,ioff);</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         cpl_vector_set(offset_x_sort, ioff, diff_x);</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>         diff_y = cpl_vector_get(offset_y_sort,ioff+1)-cpl_vector_get(offset_y_sort,ioff);</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         cpl_vector_set(offset_y_sort, ioff, diff_y);</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_vector_set(offset_x_sort, cpl_bivector_get_size(offsets)-1, 0.);</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     cpl_vector_set(offset_y_sort, cpl_bivector_get_size(offsets)-1, 0.);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     max_x = cpl_vector_get_max(offset_x_sort);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>     max_y = cpl_vector_get_max(offset_y_sort);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>     cpl_vector_delete(offset_x_sort);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>     cpl_vector_delete(offset_y_sort);</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="keywordflow">if</span> (max_x > hawki_sci_jitter_config.offset_max || </div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>         max_y > hawki_sci_jitter_config.offset_max) </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_msg_error(cpl_func, <span class="stringliteral">"Sorry, no support for frames further than %d from its closest neighbour"</span>,</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                 hawki_sci_jitter_config.offset_max) ;</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>         cpl_bivector_delete(offsets);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         <span class="keywordflow">return</span> NULL ;</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="comment">/* Create output object */</span></div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     combined = cpl_malloc(HAWKI_NB_DETECTORS*<span class="keyword">sizeof</span>(cpl_image*)) ;</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">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_frameset  *  selected_jitter;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>         cpl_bivector  *  selected_offsets;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>         cpl_image     *  flat_ima = NULL;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>         cpl_image     *  dark_ima = NULL;</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         cpl_image     *  bpm_ima = NULL;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>         cpl_imagelist *  in = NULL;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>         cpl_imagelist *  in_sky = NULL;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>         <span class="keywordtype">int</span>              nrejected;</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>         cpl_msg_info(cpl_func, <span class="stringliteral">"Combine chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>         cpl_msg_indent_more() ;</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>         <span class="comment">/* Apply frame selection based on offset values */</span></div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>         selected_jitter     = cpl_frameset_duplicate(jitters);</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>         selected_offsets = cpl_bivector_duplicate(offsets);</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         <span class="keywordflow">if</span>(hawki_sci_jitter_config.max_njitter != -1)</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="keywordflow">if</span>(hawki_sci_jitter_config.max_njitter <</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>                     cpl_frameset_get_size(selected_jitter))</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="keywordflow">while</span>(cpl_frameset_get_size(selected_jitter) ></div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>                       hawki_sci_jitter_config.max_njitter)</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="keywordtype">int</span> irm = cpl_frameset_get_size(selected_jitter) - 1;</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>                     cpl_frameset_erase_frame</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>                         (selected_jitter,</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>                          cpl_frameset_get_frame(selected_jitter,irm));</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_vector_set_size(cpl_bivector_get_x(selected_offsets),</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>                                     hawki_sci_jitter_config.max_njitter);</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>                 cpl_vector_set_size(cpl_bivector_get_y(selected_offsets),</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>                                     hawki_sci_jitter_config.max_njitter);</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>         hawki_sci_jitter_output.ncomb[idet] = </div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>             cpl_frameset_get_size(selected_jitter);</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>         nrejected = cpl_frameset_get_size(selected_jitter) - </div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>             cpl_frameset_get_size(jitters);</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>         <span class="keywordflow">if</span>(nrejected != 0)</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>             cpl_msg_info(cpl_func,<span class="stringliteral">"%d frames reject due to large offsets"</span>, </div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>                          nrejected); </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="comment">/* Load the input data */</span></div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Load the input data"</span>) ;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(selected_jitter,</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>                                   idet+1, CPL_TYPE_FLOAT)) == NULL) {</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>             cpl_free(combined) ;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>             cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>             cpl_msg_indent_less() ;</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>             <span class="keywordflow">return</span> NULL ;</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> (sky) {</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>             <span class="keywordflow">if</span> ((in_sky = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(sky, idet+1, CPL_TYPE_FLOAT)) == NULL) </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>                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot load sky for chip %d"</span>,idet+1);</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">else</span> in_sky = NULL ;</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         cpl_msg_indent_less() ;</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="comment">/* Read the calibrations */</span></div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Load the calibration data"</span>) ;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>         <span class="keywordflow">if</span>(hawki_sci_jitter_read_calib(flat, dark, bpm,</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>                                        &flat_ima, &dark_ima, &bpm_ima,</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>                                        idet) != 0)</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>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot read some of the calibrations"</span>);</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>             cpl_imagelist_delete(in);</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>             cpl_free(combined);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>             <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             cpl_bivector_delete(offsets);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>             <span class="keywordflow">return</span> NULL ;</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>         <span class="comment">/* Apply the calibrations */</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         <span class="keywordflow">if</span> (flat || dark || bpm ) </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>             cpl_msg_info(cpl_func, <span class="stringliteral">"Apply the calibrations"</span>) ;</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>             cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>             <span class="comment">/* Basic calibration of the OBJECTS */</span></div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>                     (in, flat_ima, dark_ima, bpm_ima) == -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_error(cpl_func, <span class="stringliteral">"Cannot calibrate the objects"</span>) ;</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>                 cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                 cpl_free(combined) ;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>                 <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky) ;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                 cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>                 cpl_image_delete(flat_ima);</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>                 cpl_image_delete(dark_ima);</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>                 cpl_image_delete(bpm_ima);</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>                 <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             }</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             <span class="comment">/* Basic calibration of the SKY */</span></div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             <span class="keywordflow">if</span> (in_sky) {</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#ga5602d5f6a5703dff30afa41235c9686d" title="Apply the calibration to the images.">hawki_flat_dark_bpm_detector_calib</a></div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>                         (in_sky, flat_ima, dark_ima, bpm_ima) == -1) </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_warning(cpl_func, <span class="stringliteral">"Cannot calibrate the sky"</span>) ;</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>                     cpl_imagelist_delete(in_sky) ;</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                     in_sky = 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>             }</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>             cpl_msg_indent_less() ;</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_delete(flat_ima);</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         cpl_image_delete(dark_ima);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>         cpl_image_delete(bpm_ima);</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>         <span class="comment">/* Apply the sky correction */</span></div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Sky estimation and correction"</span>) ;</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>         <span class="keywordflow">if</span> (hawki_sci_jitter_sky(in, in_sky, bkg_stats, idet) == -1)</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>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot estimate the sky"</span>) ;</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>             cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>             <span class="keywordflow">if</span> (in_sky) cpl_imagelist_delete(in_sky) ;</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>             cpl_free(combined) ;</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>             cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>             <span class="keywordflow">return</span> NULL ;</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> (in_sky) cpl_imagelist_delete(in_sky) ;</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>         cpl_msg_indent_less() ;</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>         <span class="comment">/* Apply the shift and add */</span></div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Shift and stacking"</span>) ;</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         comb_chip = hawki_sci_jitter_saa(&in, selected_offsets, </div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>                 &(hawki_sci_jitter_output.combined_pos_x[idet]),</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>                 &(hawki_sci_jitter_output.combined_pos_y[idet])) ;</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>         hawki_sci_jitter_output.combined_cumoffset_x[idet] = </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>             hawki_sci_jitter_output.combined_pos_x[idet] - off_0_x;</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         hawki_sci_jitter_output.combined_cumoffset_y[idet] = </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>             hawki_sci_jitter_output.combined_pos_y[idet] - off_0_y;</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>         <span class="keywordflow">if</span> (comb_chip == NULL) {</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>             cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>             cpl_free(combined) ;</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>             <span class="keywordflow">return</span> NULL ;</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_imagelist_delete(in) ;</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>         cpl_msg_indent_less() ;</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="comment">/* Put the results in the image list */</span></div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>         combined[idet] = comb_chip[0] ;</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>         cpl_image_delete(comb_chip[1]) ;</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>         cpl_free(comb_chip) ;</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>         </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>         cpl_frameset_delete(selected_jitter);</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>         cpl_bivector_delete(selected_offsets);</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_bivector_delete(offsets) ;</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">return</span> combined ;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span> (cpl_imagelist   *   objs,</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>  cpl_imagelist   *   skys,</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>  cpl_table       **  bkg_stats,</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>  <span class="keywordtype">int</span>                 idet)</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>     cpl_image       *   sky ;</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     <span class="keywordtype">int</span>                 nframes;</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>     <span class="keywordtype">double</span>              median ;</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>     cpl_image       *   cur_ima ;</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>     <span class="keywordtype">int</span>                 i ;</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">/* Initialise */</span></div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>     nframes = cpl_imagelist_get_size(objs) ;</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="comment">/* Compute the sky frame */</span></div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>     <span class="keywordflow">if</span> (skys != NULL) {</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>        cpl_msg_info(cpl_func, <span class="stringliteral">"Median of sky images"</span>) ;</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         <span class="comment">/* Use sky images */</span></div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         <span class="keywordflow">if</span> ((sky = cpl_imagelist_collapse_median_create(skys)) == NULL) {</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot compute the median of sky images"</span>) ;</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Statistics on the background */</span></div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>         <span class="keywordflow">if</span>(bkg_stats != 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>             cpl_table_set_size(bkg_stats[idet], 1);</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                 (bkg_stats, sky,</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>                  1,</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>                  1,</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>                  cpl_image_get_size_x(sky),</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                  cpl_image_get_size_y(sky),</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>                  idet, 0);</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="comment">/* Correct the objects images  */</span></div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(objs, sky) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot corr. the obj images from the sky"</span>);</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             cpl_image_delete(sky) ;</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>             <span class="keywordflow">return</span> -1;</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_image_delete(sky) ;</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>         <span class="comment">/* Normalise the object planes */</span></div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>         <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>             cur_ima = cpl_imagelist_get(objs, i) ;</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>             median = cpl_image_get_median(cur_ima) ;</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>             cpl_image_subtract_scalar(cur_ima, median) ;</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">else</span> <span class="keywordflow">if</span> (hawki_sci_jitter_config.sky_minnb > nframes) {</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median of object images"</span>) ;</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>          <span class="comment">/* Use objs images */</span></div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         <span class="keywordflow">if</span> ((sky = cpl_imagelist_collapse_median_create(objs)) == NULL) {</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot compute the median of obj images"</span>) ;</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Statistics on the background */</span></div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>         <span class="keywordflow">if</span>(bkg_stats != NULL)</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>             cpl_table_set_size(bkg_stats[idet], 1);</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>                 (bkg_stats, sky,</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>                  1,</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                  1,</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                  cpl_image_get_size_x(sky),</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>                  cpl_image_get_size_y(sky),</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>                  idet, 0);</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="comment">/* Correct the objects images  */</span></div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>         <span class="keywordflow">if</span> (cpl_imagelist_subtract_image(objs, sky) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot corr. the obj images from the sky"</span>);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>             cpl_image_delete(sky) ;</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Normalise the object planes */</span></div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>         <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>             cur_ima = cpl_imagelist_get(objs, i) ;</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>             median = cpl_image_get_median(cur_ima) ;</div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>             cpl_image_subtract_scalar(cur_ima, median) ;</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">/* Delete sky image */</span></div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>         cpl_image_delete(sky) ;</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Computing running median on jitter images"</span>) ;</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>         <span class="comment">/* Use objects images */</span></div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>         <span class="keywordflow">if</span> (hawki_sci_jitter_sky_running(objs, bkg_stats, idet) == -1)</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>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>                     <span class="stringliteral">"Cannot apply the running median"</span>);</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>             <span class="keywordflow">return</span> -1;</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>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_sky_running</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span> (cpl_imagelist *  in,</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>  cpl_table     ** bkg_stats,</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>  <span class="keywordtype">int</span>              idet) </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>     <span class="keywordtype">int</span>                 rejmin, rejmax, halfw;</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     cpl_imagelist   *   result_buffer;</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>     <span class="keywordtype">int</span>                 ni, nx, ny;</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     cpl_vector      *   medians;</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>     cpl_image       *   cur_ima;</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     cpl_image       *   tmp_ima;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordtype">double</span>              one_med;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordtype">int</span>                 i, k;</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>     <span class="keywordtype">int</span>                 first_buffered = 0;</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <span class="keywordtype">int</span>                 next_not_to_be_used;</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">/* Test entries */</span></div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>     <span class="keywordflow">if</span> (in==NULL) <span class="keywordflow">return</span> -1;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>     rejmin = hawki_sci_jitter_config.sky_rejmin ;</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>     rejmax = hawki_sci_jitter_config.sky_rejmax ;</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>     halfw  = hawki_sci_jitter_config.sky_halfw ;</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>     ni = cpl_imagelist_get_size(in) ;</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>     cur_ima = cpl_imagelist_get(in, 0) ;</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>     nx = cpl_image_get_size_x(cur_ima) ;</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     ny = cpl_image_get_size_y(cur_ima) ;</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">/* Tests on validity of rejection parameters */</span></div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>     <span class="keywordflow">if</span> (((rejmin+rejmax)>=halfw) || (halfw<1) || (rejmin<0) || (rejmax<0)) {</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"cannot compute running median with "</span></div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>                 <span class="stringliteral">"rejection  parameters %d (%d-%d)"</span>,</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>                 halfw, rejmin, rejmax);</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Pre-compute median value in each plane */</span></div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     medians = cpl_vector_new(ni) ;</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>         cur_ima = cpl_imagelist_get(in, i) ;</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>         cpl_vector_set(medians, i, cpl_image_get_median(cur_ima)) ;</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="comment">/* Allocate output cube */</span></div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     result_buffer = cpl_imagelist_new() ;</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>     <span class="comment">/* Allocate output bg stats */</span></div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>     cpl_table_set_size(bkg_stats[idet], ni);</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>     <span class="comment">/* Main loop over input planes */</span></div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     <span class="keywordflow">for</span> (k=0 ; k<ni ; k++)</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>         cpl_image * bkg;</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="comment">/* Create the background image, to later compute stats */</span></div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>         bkg = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</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>         hawki_bkg_from_running_mean</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>             (in, medians, k, halfw, rejmin, rejmax, bkg);</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>         <span class="comment">/* Subtract the background from the current image */</span></div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         tmp_ima = cpl_image_subtract_create(cpl_imagelist_get(in, k), bkg);</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">/* Statistics on the background */</span></div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>         <span class="keywordflow">if</span>(bkg_stats != NULL)</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>             <a class="code" href="group__hawki__image__stats.html#gaddd6e9623519487c0775de8c3a0aee0f" title="Fills a table with the statistics of an image.">hawki_image_stats_fill_from_image</a></div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>                 (bkg_stats, bkg,</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>                  1, 1, nx, ny,</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>                  idet, k);</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_image_delete(bkg);</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="comment">/* Place the new image in a result buffer */</span></div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>         cpl_imagelist_set(result_buffer, tmp_ima,</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>                           cpl_imagelist_get_size(result_buffer));</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>         </div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         <span class="comment">/* Empty the buffer as much as possible */</span></div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>         next_not_to_be_used = k - halfw;</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>         <span class="keywordflow">while</span>(next_not_to_be_used >= first_buffered)</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>             cpl_imagelist_set(in, cpl_imagelist_unset(result_buffer, 0),</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>                               first_buffered);</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>             first_buffered++;</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>     }</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>     <span class="comment">/* Empty the buffer finally */</span></div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>     next_not_to_be_used = ni - 1;</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>     <span class="keywordflow">while</span>(next_not_to_be_used >= first_buffered)</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>         cpl_imagelist_set(in, cpl_imagelist_unset(result_buffer, 0),</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>                           first_buffered);</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>         first_buffered++;</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>     cpl_imagelist_delete(result_buffer);</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>     cpl_vector_delete(medians);</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>     <span class="comment">/* Subtract median from each frame */</span></div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>     <span class="keywordflow">for</span> (i=0 ; i<ni ; i++) {</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>         cur_ima = cpl_imagelist_get(in, i);</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         one_med = cpl_image_get_median(cur_ima) ;</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>         cpl_image_subtract_scalar(cur_ima, one_med) ;</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>     <span class="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span> <span class="keyword">static</span> cpl_image ** hawki_sci_jitter_saa(</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>         cpl_imagelist   **  in,</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>         cpl_bivector    *   offsets,</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>         <span class="keywordtype">double</span>          *   pos_x,</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>         <span class="keywordtype">double</span>          *   pos_y)</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_bivector        *   offs_est;</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>     cpl_bivector        *   offs_used;</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>     cpl_bivector        *   objs ;</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>     cpl_image           **  combined ;</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>     <span class="keywordtype">int</span>                     nfiles, ngood, nima, nx, ny ;</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>     <span class="keywordtype">int</span>                     i;</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>     <span class="comment">/* Check entries */</span></div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>     <span class="keywordflow">if</span> (pos_x == NULL || pos_y == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <span class="keywordflow">if</span> (offsets == NULL) <span class="keywordflow">return</span> NULL ;</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="comment">/* Get the number of images */</span></div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     nfiles = cpl_imagelist_get_size(*in) ;</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>     <span class="keywordflow">if</span> (cpl_bivector_get_size(offsets) != nfiles) {</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Invalid input objects sizes"</span>) ; </div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>         <span class="keywordflow">return</span> NULL ;</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>     </div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     <span class="comment">/* Get the offsets estimation of each input file pair */</span></div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Get the offsets estimation"</span>) ;</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>     offs_est = NULL ;</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_config.offsets &&</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>             hawki_sci_jitter_config.offsets[0] != (<span class="keywordtype">char</span>)0) {</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>         <span class="comment">/* A file has been provided on the command line */</span></div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>         offs_est = cpl_bivector_read((<span class="keywordtype">char</span>*)hawki_sci_jitter_config.offsets);</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>         <span class="keywordflow">if</span> ((offs_est==NULL)||(cpl_bivector_get_size(offs_est)!=nfiles)) {</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get offsets from %s"</span>, </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                     hawki_sci_jitter_config.offsets) ;</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>             <span class="keywordflow">return</span> 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>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>         <span class="comment">/* Use the offsets from the header */</span></div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>         offs_est = cpl_bivector_duplicate(offsets) ;</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>         cpl_vector_multiply_scalar(cpl_bivector_get_x(offs_est), -1.0) ;</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>         cpl_vector_multiply_scalar(cpl_bivector_get_y(offs_est), -1.0) ;</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>     <span class="comment">/* Read the provided objects file if provided */</span></div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>     objs = NULL ;</div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine &&</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>             hawki_sci_jitter_config.objects &&</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>             hawki_sci_jitter_config.objects[0] != (<span class="keywordtype">char</span>)0) {</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Get the user provided correlation objects"</span>) ;</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>         <span class="comment">/* A file has been provided on the command line */</span></div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>         objs = cpl_bivector_read((<span class="keywordtype">char</span>*)hawki_sci_jitter_config.objects) ;</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>         <span class="keywordflow">if</span> (objs==NULL) {</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get objects from %s"</span>,</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                     hawki_sci_jitter_config.objects) ;</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>             cpl_bivector_delete(offs_est) ;</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>             <span class="keywordflow">return</span> 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>     }</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="comment">/* Get a correlation point from the difference of the first images */</span></div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine && objs == NULL) {</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         cpl_apertures  *   aperts;</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>         cpl_image      *   detect_image;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>         cpl_vector     *   thresh_vect;</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>         <span class="keywordtype">double</span>         *   objs_x ;</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>         <span class="keywordtype">double</span>         *   objs_y ;</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Get a cross-correlation point"</span>) ;</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         thresh_vect = cpl_vector_new(4) ;</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>         cpl_vector_set(thresh_vect, 0, 5.0) ;</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>         cpl_vector_set(thresh_vect, 1, 2.0) ;</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>         cpl_vector_set(thresh_vect, 2, 1.0) ;</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>         cpl_vector_set(thresh_vect, 3, 0.5) ;</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>         detect_image  = cpl_imagelist_get(*in, 0);</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>         <span class="keywordflow">if</span> ((aperts = cpl_apertures_extract_window(detect_image, thresh_vect, </div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>                         400, 400, 1600, 1600, NULL)) == NULL) {</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find any cross-correlation point"</span>) ;</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>             cpl_bivector_delete(offs_est) ;</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>             cpl_vector_delete(thresh_vect) ;</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>             <span class="keywordflow">return</span> 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_vector_delete(thresh_vect) ;</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>         cpl_apertures_sort_by_npix(aperts) ;</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>         objs = cpl_bivector_new(1) ;</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>         objs_x = cpl_bivector_get_x_data(objs) ;</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>         objs_y = cpl_bivector_get_y_data(objs) ;</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>         objs_x[0] = cpl_apertures_get_pos_x(aperts, 1) ;</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>         objs_y[0] = cpl_apertures_get_pos_y(aperts, 1) ;</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>         cpl_apertures_delete(aperts) ;</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>         <span class="keywordflow">if</span> (objs == NULL) {</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot find any cross-correlation point"</span>) ;</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>             cpl_bivector_delete(offs_est) ;</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>             <span class="keywordflow">return</span> NULL ;</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>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                 <span class="stringliteral">"Correlation point: %g %g\n"</span>, objs_x[0], objs_y[0]);</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">/* Refine the offsets */</span></div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_config.refine) {</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>         cpl_bivector *   offs_refined;</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>         <span class="keywordtype">double</span>       *   offs_refined_x;</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>         <span class="keywordtype">double</span>       *   offs_refined_y;</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         <span class="keywordtype">double</span>       *   offs_est_x;</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>         <span class="keywordtype">double</span>       *   offs_est_y;</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>         cpl_vector   *   correl ;</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>         <span class="keywordtype">double</span>       *   correl_data ;</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Refine the offsets"</span>);</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>         nima = cpl_imagelist_get_size(*in) ;</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         correl = cpl_vector_new(nima) ;</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>         <span class="keywordflow">if</span> ((offs_refined = cpl_geom_img_offset_fine(*in, offs_est, objs,</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                         hawki_sci_jitter_config.sx, </div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>                         hawki_sci_jitter_config.sy,</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>                         hawki_sci_jitter_config.mx, </div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>                         hawki_sci_jitter_config.my,</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                         correl)) == NULL) {</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot refine the offsets"</span>);</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>             cpl_bivector_delete(offs_est) ;</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>             <span class="keywordflow">if</span> (objs != NULL) cpl_bivector_delete(objs) ;</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>             cpl_vector_delete(correl) ;</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>             <span class="keywordflow">return</span> NULL ;</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>         <span class="keywordflow">if</span> (objs != NULL) cpl_bivector_delete(objs) ;</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">/* Display the results */</span></div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>         offs_est_x = cpl_bivector_get_x_data(offs_est);</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>         offs_est_y = cpl_bivector_get_y_data(offs_est);</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>         offs_refined_x = cpl_bivector_get_x_data(offs_refined);</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>         offs_refined_y = cpl_bivector_get_y_data(offs_refined) ;</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>         correl_data = cpl_vector_get_data(correl) ;</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Refined offsets [correlation factor]"</span>) ;</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>         ngood = 0 ;</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>         <span class="keywordflow">for</span> (i=0 ; i<nima ; i++) {</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"#%02d: %8.2f %8.2f [%12.2f]"</span>,</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>                     i+1, offs_refined_x[i], offs_refined_y[i], correl_data[i]);</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>             <span class="keywordflow">if</span> (correl_data[i] > -0.5) ngood++ ;</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> (ngood == 0) {</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"No frame correctly correlated"</span>) ;</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>             cpl_bivector_delete(offs_est);</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>             cpl_bivector_delete(offs_refined);</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>             cpl_vector_delete(correl);</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>             <span class="keywordflow">return</span> 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>         cpl_msg_indent_less();</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">/* Replace bad correlated images with the nominal offsets */</span></div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Using nominal offsets for badly "</span></div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>                      <span class="stringliteral">"correlated images (%d out of %d)"</span>, nima-ngood, nima);</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>         <span class="keywordflow">for</span> (i=0 ; i<nima ; i++) {</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>             <span class="keywordflow">if</span> (correl_data[i] < -0.5) {</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>                 offs_refined_x[i] = offs_est_x[i];</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>                 offs_refined_y[i] = offs_est_y[i];</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>         offs_used = cpl_bivector_duplicate(offs_refined);</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>         cpl_bivector_delete(offs_est);</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>         cpl_bivector_delete(offs_refined);</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>         cpl_vector_delete(correl);</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="keywordflow">else</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>         offs_used = cpl_bivector_duplicate(offs_est);</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>         cpl_bivector_delete(offs_est);</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> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>     <span class="comment">/* Discard the pixels on the sides */</span></div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>     <span class="keywordflow">if</span> (hawki_sci_jitter_config.borders > 0) {</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>         cpl_imagelist  *   in_ext ;</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>         cpl_image      *   tmp1 ;</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>         cpl_image      *   tmp2 ;</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>         nx = cpl_image_get_size_x(cpl_imagelist_get(*in, 0)) ;</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>         ny = cpl_image_get_size_y(cpl_imagelist_get(*in, 0)) ;</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>         in_ext = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>         <span class="keywordflow">while</span>(cpl_imagelist_get_size(*in) > 0)</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>             tmp1 = cpl_imagelist_unset(*in, 0);</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>             tmp2 = cpl_image_extract(tmp1, </div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>                     hawki_sci_jitter_config.borders+1, </div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>                     hawki_sci_jitter_config.borders+1, </div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>                     nx-hawki_sci_jitter_config.borders, </div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>                     ny-hawki_sci_jitter_config.borders) ;</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>             cpl_image_delete(tmp1);</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>             cpl_imagelist_set(in_ext, tmp2, cpl_imagelist_get_size(in_ext)) ;</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>         cpl_imagelist_delete(*in) ;</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>         *in = in_ext ;</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> </div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>     <span class="comment">/* Apply the shift & add */</span></div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Recombine the images set"</span>) ;</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>     <span class="keywordflow">if</span> ((combined=cpl_geom_img_offset_saa(*in, offs_used,</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>                     CPL_KERNEL_DEFAULT, </div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>                     hawki_sci_jitter_config.rej_low,</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                     hawki_sci_jitter_config.rej_high,</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                     hawki_sci_jitter_config.comb_meth,</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>                     pos_x, pos_y)) == NULL) {</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>         cpl_bivector_delete(offs_used) ;</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>         <span class="keywordflow">return</span> NULL ;</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>     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>     *pos_x -= hawki_sci_jitter_config.borders ;</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>     *pos_y -= hawki_sci_jitter_config.borders ;</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">/* Free and return */</span></div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>     cpl_bivector_delete(offs_used) ;</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>     <span class="keywordflow">return</span> combined ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_qc</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span> (cpl_frameset *   science_frames,</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>  cpl_image   **   combined_images, </div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>  cpl_table   **   obj_charac)</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>     cpl_vector      *   thresh_vec ;</div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     cpl_apertures   *   aperts ;</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>     <span class="keywordtype">int</span>                 nb_objs ;</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>     <span class="keywordtype">double</span>              angle ;</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>     <span class="keywordtype">double</span>          *   fwhms_x ;</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     <span class="keywordtype">double</span>          *   fwhms_y ;</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>     cpl_bivector    *   iqe ;</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>     <span class="keywordtype">int</span>                 nb_good ;</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>     cpl_vector      *   fwhms_good ;</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     <span class="keywordtype">double</span>          *   fwhms_good_data ;</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>     <span class="keywordtype">double</span>              f_min, f_max, fr, fx, fy ;</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     <span class="keywordtype">int</span>                 chip;</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>     <span class="keywordtype">int</span>                 iobj;</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>     <span class="keywordtype">int</span>                 j;</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">/* Initialise */</span></div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>     <span class="keywordtype">double</span>              seeing_min_arcsec = 0.1 ;</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>     <span class="keywordtype">double</span>              seeing_max_arcsec = 5.0 ;</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     <span class="keywordtype">double</span>              seeing_fwhm_var   = 0.2 ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     <span class="keywordflow">if</span> (combined_images  == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>     <span class="keywordflow">if</span> (obj_charac       == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Create the vector for the detection thresholds */</span></div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>     thresh_vec = cpl_vector_new(11) ;</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>     cpl_vector_set(thresh_vec, 0, 100.0) ;</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>     cpl_vector_set(thresh_vec, 0, 90.0) ;</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>     cpl_vector_set(thresh_vec, 0, 80.0) ;</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>     cpl_vector_set(thresh_vec, 0, 70.0) ;</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>     cpl_vector_set(thresh_vec, 0, 60.0) ;</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>     cpl_vector_set(thresh_vec, 0, 50.0) ;</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>     cpl_vector_set(thresh_vec, 1, 40.0) ;</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>     cpl_vector_set(thresh_vec, 1, 30.0) ;</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>     cpl_vector_set(thresh_vec, 1, 20.0) ;</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>     cpl_vector_set(thresh_vec, 1, 10.0) ;</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>     cpl_vector_set(thresh_vec, 2, 5.0) ;</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">/* Get the mean airmass */</span></div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>     hawki_sci_jitter_output.mean_airmass = </div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>         <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(science_frames);;</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="comment">/* Loop on the HAWK-I detectors */</span></div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>     <span class="keywordflow">for</span> (chip=0 ; chip<HAWKI_NB_DETECTORS ; chip++) </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">/* Check entries */</span></div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>         <span class="keywordflow">if</span> (combined_images[chip]  == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>         <span class="keywordflow">if</span> (obj_charac[chip] == NULL) <span class="keywordflow">return</span> -1 ;</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="comment">/* Detect apertures */</span></div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>         <span class="keywordflow">if</span> ((aperts = cpl_apertures_extract</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                 (combined_images[chip], thresh_vec, NULL)) == NULL) {</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot detect any aperture on chip %d"</span>,</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>                             chip+1) ;</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</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> </div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>         <span class="comment">/* Number of detected objects */</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>         nb_objs = cpl_apertures_get_size(aperts);</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"%d objects detected on chip %d"</span>,nb_objs,chip+1);</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>         hawki_sci_jitter_output.nbobjs[chip] = nb_objs ;</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>         fwhms_x = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>         fwhms_y = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</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>         <span class="comment">/* Initialize the output table */</span></div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>         cpl_table_set_size(obj_charac[chip], nb_objs);</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>             (obj_charac[chip], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>             (obj_charac[chip], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSY,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>             (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_ANGLE,<span class="stringliteral">"grad"</span>);</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MAJAX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MINAX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>             (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>         cpl_table_new_column</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>             (obj_charac[chip], HAWKI_COL_OBJ_FLUX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FLUX,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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>             <span class="comment">/* Fill with the already known information */</span></div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSX, iobj, </div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>                                  cpl_apertures_get_centroid_x(aperts, iobj+1));</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSY, iobj, </div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>                                  cpl_apertures_get_centroid_y(aperts, iobj+1));</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_FLUX, iobj, </div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>                                  cpl_apertures_get_flux(aperts, iobj+1)) ;</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>             <span class="comment">/* Compute the FWHM informations */</span></div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>             <span class="keywordflow">if</span> ((iqe = cpl_image_iqe(combined_images[chip], </div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(aperts, iobj+1) - 10,</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(aperts, iobj+1) - 10,</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(aperts, iobj+1) + 10,</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(aperts, iobj+1) + 10))==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>                 cpl_error_reset() ;</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Cannot get FWHM for obj at pos %g %g"</span>,</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>                               cpl_apertures_get_centroid_x(aperts, iobj+1),</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>                               cpl_apertures_get_centroid_y(aperts, iobj+1)) ;</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>                 fwhms_x[iobj] = -1.0 ;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>                 fwhms_y[iobj] = -1.0 ;</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>                 angle = 0.0 ;</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>             <span class="keywordflow">else</span> </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>                 fwhms_x[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 2) ;</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>                 fwhms_y[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 3) ;</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>                 angle = cpl_vector_get(cpl_bivector_get_x(iqe), 4) ;</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>                 cpl_bivector_delete(iqe) ;</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>                 cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>                               <span class="stringliteral">"FWHM for obj at pos %g %g: %g x %g (%g)"</span>,</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                               cpl_apertures_get_centroid_x(aperts, iobj+1),</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>                               cpl_apertures_get_centroid_y(aperts, iobj+1),</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                               fwhms_x[iobj], fwhms_y[iobj], angle) ;</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>             cpl_table_set_double</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>                 (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, iobj, angle) ;</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>             cpl_table_set_double</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, iobj,</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>                  fwhms_x[iobj]);</div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>             cpl_table_set_double</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, iobj,</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>                  fwhms_y[iobj]);</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>             cpl_table_set_double</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>                 (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, iobj,</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>                  1 - fwhms_y[iobj] / fwhms_x[iobj]);</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>         cpl_apertures_delete(aperts) ;</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="comment">/* Get the number of good values */</span></div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>         nb_good = 0 ;</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) nb_good++ ;</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="keywordflow">if</span> (nb_good == 0)</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_warning(cpl_func, <span class="stringliteral">"No objects to compute FWHM on chip %d"</span>,</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>                             chip+1);</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>             cpl_free(fwhms_x) ;</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>             cpl_free(fwhms_y) ;</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>             <span class="keywordflow">continue</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>     </div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>         <span class="comment">/* Get the good values */</span></div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>         fwhms_good = cpl_vector_new(nb_good) ;</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>         j=0 ;</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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="keywordflow">if</span> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.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>                 fwhms_good_data[j] = (fwhms_x[iobj]+fwhms_y[iobj])/2.0 ;</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>                 j++ ;</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="comment">/* Compute the fwhm */</span></div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>         <span class="keywordflow">if</span> (nb_good < 3) </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">/* Too few values to compute the median */</span></div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>             hawki_sci_jitter_output.fwhm_pix[chip] = fwhms_good_data[0] ;</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> </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="comment">/* Compute the median */</span></div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>             hawki_sci_jitter_output.fwhm_pix[chip] =</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>                 cpl_vector_get_median_const(fwhms_good) ;</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>         hawki_sci_jitter_output.fwhm_arcsec[chip] = </div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>             hawki_sci_jitter_output.fwhm_pix[chip] *</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>             hawki_sci_jitter_output.pixscale ;</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>         <span class="comment">/* Compute the mode of the FWHMs */</span></div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>         <span class="keywordflow">if</span> (nb_good > 5) </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>             hawki_sci_jitter_output.fwhm_mode[chip] =</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>                 <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(fwhms_good);</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>             hawki_sci_jitter_output.fwhm_mode[chip] *= </div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>                 hawki_sci_jitter_output.pixscale ;</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>         cpl_vector_delete(fwhms_good) ;</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">/* IQ is the median of the (fwhm_x+fwhm_y/2) of the good stars */</span></div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>         <span class="comment">/* Compute f_min and f_max */</span></div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>         f_min = seeing_min_arcsec / hawki_sci_jitter_output.pixscale ;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>         f_max = seeing_max_arcsec / hawki_sci_jitter_output.pixscale ;</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="comment">/* Get the number of good values */</span></div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>         nb_good = 0 ;</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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>             fx = fwhms_x[iobj] ;</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>             fy = fwhms_y[iobj] ;</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>                     (fr < seeing_fwhm_var)) nb_good++ ;</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> (nb_good == 0) </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>             cpl_msg_warning(cpl_func, <span class="stringliteral">"No objects to compute IQ on chip %d"</span>,</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>                             chip+1);</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>             cpl_free(fwhms_x) ;</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>             cpl_free(fwhms_y) ;</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>             <span class="keywordflow">continue</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> </div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>         <span class="comment">/* Get the good values */</span></div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>         fwhms_good = cpl_vector_new(nb_good) ;</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>         j=0 ;</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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>             fx = fwhms_x[iobj] ;</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>             fy = fwhms_y[iobj] ;</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>                     (fr < seeing_fwhm_var)) </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>                 fwhms_good_data[j] = (fx + fy)/2.0 ;</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                 j++ ;</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_free(fwhms_x) ;</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>         cpl_free(fwhms_y) ;</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">/* Compute the fwhm */</span></div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>         <span class="keywordflow">if</span> (nb_good < 3) </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>             <span class="comment">/* Too few values to compute the median */</span></div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>             hawki_sci_jitter_output.iq[chip] = fwhms_good_data[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="keywordflow">else</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="comment">/* Compute the median */</span></div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>             hawki_sci_jitter_output.iq[chip] = </div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                 cpl_vector_get_median_const(fwhms_good) ;</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>         cpl_vector_delete(fwhms_good) ;</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>         hawki_sci_jitter_output.iq[chip] *= hawki_sci_jitter_output.pixscale ;</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="comment">/* Cleanup */</span></div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>     cpl_vector_delete(thresh_vec) ;</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>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_read_calib</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *  flat,</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *  dark,</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *  bpm,</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>  cpl_image  ** flat_image,</div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>  cpl_image  ** dark_image,</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>  cpl_image  ** bpm_image,</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>  <span class="keywordtype">int</span>           idet)</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="keyword">const</span> <span class="keywordtype">char</span> * reffile;</div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>     <span class="keywordtype">int</span>          ext_nb;</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>(flat == NULL && dark == NULL && bpm == NULL)</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>     <span class="keywordflow">if</span>(*flat_image != NULL || *dark_image != NULL || *bpm_image != NULL)</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>         <span class="keywordflow">return</span> 0;</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">/* Get the extension number for this detector */</span></div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>     <span class="keywordflow">if</span>(flat != NULL)</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>         reffile = flat;</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(dark != NULL)</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>         reffile = dark;</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>         reffile = bpm;</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>     <span class="comment">/* Guess which is the extension to read */</span></div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>     <span class="keywordflow">if</span> ((ext_nb = <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(reffile, idet + 1)) == -1) {</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot get the extension with detector %d"</span>,</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>                       idet + 1);</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>         <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>     <span class="comment">/* Load the dark image */</span></div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>     <span class="keywordflow">if</span>(dark != NULL)</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>         *dark_image = cpl_image_load(dark, CPL_TYPE_FLOAT, 0, ext_nb);</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>     <span class="comment">/* Load the flat image */</span></div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>     <span class="keywordflow">if</span>(flat != NULL)</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>         *flat_image = cpl_image_load(flat, CPL_TYPE_FLOAT, 0, ext_nb);</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>     <span class="comment">/* Load the bpm image */</span></div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>     <span class="keywordflow">if</span>(bpm != NULL)</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>         *bpm_image = cpl_image_load(bpm, CPL_TYPE_FLOAT, 0, ext_nb);</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>     <span class="comment">/* Multiply the dark image by the science exposure time */</span></div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>     <span class="keywordflow">if</span>(dark != NULL)</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>         cpl_image_multiply_scalar(*dark_image, hawki_sci_jitter_output.dit);</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="comment">/* Return */</span></div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_sci_jitter_save</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span> (cpl_image           **  combined,</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>  cpl_image           *   stitched,</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>  cpl_table           **  obj_charac,</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>  cpl_table           **  raw_jitter_stats,</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>  cpl_table           **  bkg_stats,</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>  <span class="keyword">const</span> cpl_table     *   raw_obj_tel_info,</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>  cpl_frameset        *   science_frames,</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>  cpl_frameset        *   calib_frames,</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>  cpl_frameset        *   <span class="keyword">set</span>)</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>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     <span class="keywordtype">double</span>                  pscale, dit, bg_mean, bg_stdev, bg_instmag ;</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     cpl_propertylist    **  qclists ;</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     <span class="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>     cpl_frameset        *   used_frames;</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>     cpl_propertylist    *   wcslist ;</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>     cpl_propertylist    *   telstats;</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>     <span class="keywordtype">double</span>                  crpix1, crpix2 ;</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_sci_jitter"</span> ;</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>     <span class="keywordtype">int</span>                     i;</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>     <span class="keywordtype">int</span>                     ext_chip_1;</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>     pscale = hawki_sci_jitter_output.pixscale;</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>     dit = hawki_sci_jitter_output.dit;</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>     <span class="comment">/* Get reference frame */</span></div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>     ref_frame = irplib_frameset_get_first_from_group(<span class="keyword">set</span>, CPL_FRAME_GROUP_RAW);</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="comment">/* Get the used frames */</span> </div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>     used_frames = cpl_frameset_duplicate(science_frames);</div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>     <span class="keywordflow">for</span>(i = 0; i< cpl_frameset_get_size(calib_frames); ++i)</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>         cpl_frameset_insert(used_frames, </div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>                 cpl_frame_duplicate(cpl_frameset_get_frame(calib_frames, i)));</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="comment">/* Create the telescope data statistics */</span></div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>     telstats = cpl_propertylist_new();</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>     hawki_compute_prop_tel_qc_stats(raw_obj_tel_info, telstats);</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="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span> </div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>         <span class="comment">/* Get the extension number */</span></div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);</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="comment">/* Handle WCS keys */</span></div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>         wcslist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>                 cpl_frame_get_filename(ref_frame), ext_nb, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>         qclists[i] = cpl_propertylist_new() ;</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="comment">/* Compute bg_instmag */</span></div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>         bg_mean = cpl_table_get_column_mean(bkg_stats[i], HAWKI_COL_STAT_MEAN);</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>         <span class="keywordflow">if</span> (cpl_table_get_nrow(bkg_stats[i]) < 2) bg_stdev = 0 ;</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>         <span class="keywordflow">else</span> bg_stdev = cpl_table_get_column_stdev</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>             (bkg_stats[i], HAWKI_COL_STAT_MEAN);</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>         <span class="keywordflow">if</span>(bg_mean >= 0)</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>             bg_instmag = -2.5 * log10(bg_mean/(pscale*pscale*dit));</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>             bg_instmag = 0;</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>         <span class="comment">/* Fill the QC */</span></div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>             (qclists[i], <span class="stringliteral">"ESO QC BACKGD MEAN"</span>, bg_mean);</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD MEAN"</span>,</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>                                      <span class="stringliteral">"Mean of all the image mean backgrounds"</span>);</div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>             (qclists[i], <span class="stringliteral">"ESO QC BACKGD STDEV"</span>, bg_stdev);</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD STDEV"</span>,</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                    <span class="stringliteral">"The standard deviation of all the image mean backgrounds"</span>);</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>             (qclists[i], <span class="stringliteral">"ESO QC BACKGD INSTMAG"</span>, bg_instmag) ;</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC BACKGD INSTMAG"</span>,</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>           <span class="stringliteral">"Mean of all the image mean backgrounds in instrumental magnitudes"</span>);</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>         cpl_propertylist_append_int</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>             (qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>, hawki_sci_jitter_output.nbobjs[i]);</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>,</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>                            <span class="stringliteral">"Number of detected objects in the combined image"</span>);</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>             (qclists[i], <span class="stringliteral">"ESO QC IQ"</span>, hawki_sci_jitter_output.iq[i]);</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC IQ"</span>,</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>                            <span class="stringliteral">"Estimated image quality [arcsec]"</span>);</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>             (qclists[i], <span class="stringliteral">"ESO QC IQ DIFF AMBI"</span>,</div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double</div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>                  (telstats, <span class="stringliteral">"ESO QC TEL AMBI FWHM MEAN"</span>));</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC IQ DIFF AMBI"</span>,</div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>                            <span class="stringliteral">"Mean Observatory seeing measured by AS"</span>);</div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>             (qclists[i], <span class="stringliteral">"ESO QC IQ DIFF TEL"</span>,</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double</div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>                  (telstats, <span class="stringliteral">"ESO QC TEL IA FWHM MEAN"</span>));</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC IQ DIFF TEL"</span>,</div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                 <span class="stringliteral">"Mean Observatory seeing measured by AS corrected by airmass"</span>);</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>              hawki_sci_jitter_output.fwhm_pix[i]);</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>                                      <span class="stringliteral">"The median FWHM in the image [pixels]"</span>);</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>              hawki_sci_jitter_output.fwhm_arcsec[i]);</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,</div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>                                      <span class="stringliteral">"The median FWHM in the image [arcsec]"</span>);</div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>              hawki_sci_jitter_output.fwhm_mode[i]);</div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>                                      <span class="stringliteral">"The mode FWHM in the image [pixels]"</span>);</div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>             (qclists[i], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>              hawki_sci_jitter_output.combined_pos_x[i]);</div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>                                      <span class="stringliteral">"Position in X of the first image"</span>);</div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>             (qclists[i], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>              hawki_sci_jitter_output.combined_pos_y[i]);</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>                                      <span class="stringliteral">"Position in Y of the first image"</span>);</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>             (qclists[i], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</span>,</div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>              hawki_sci_jitter_output.combined_cumoffset_x[i]);</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>             (qclists[i], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</span>,</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>              hawki_sci_jitter_output.combined_cumoffset_y[i]);</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>         cpl_propertylist_append_int</div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>             (qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,hawki_sci_jitter_output.ncomb[i]);</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC DATANCOM"</span>,</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>                                      <span class="stringliteral">"Number of files used for the reduction"</span>);</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>             (qclists[i], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,</div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>              hawki_sci_jitter_output.mean_airmass);</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>         cpl_propertylist_set_comment(qclists[i], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>                                      <span class="stringliteral">"Average airmass"</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="comment">/* Update WCS and write them */</span></div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>         crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); </div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>         crpix1 += hawki_sci_jitter_output.combined_pos_x[i];</div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;</div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>         crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); </div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>         crpix2 += hawki_sci_jitter_output.combined_pos_y[i] ;</div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>         cpl_propertylist_copy_property_regexp</div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>             (qclists[i], wcslist, HAWKI_HEADER_WCS, 0) ;</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>         cpl_propertylist_delete(wcslist);</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>         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>         cpl_propertylist_append(qclists[i], inputlist);</div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>         cpl_propertylist_delete(inputlist) ;</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>     </div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>     <span class="comment">/* Statistics of the raw images in the QC */</span></div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_jitter_stats, qclists);</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">/* Statistics of the detected objects in the QC */</span></div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>     <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>(obj_charac, qclists);</div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span> </div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>     <span class="comment">/* Write the combined image */</span></div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>                       parlist,</div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>                       used_frames,</div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>                       (<span class="keyword">const</span> cpl_image **)combined,</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>                       recipe_name,</div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>                       HAWKI_CALPRO_COMBINED,</div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>                       HAWKI_PROTYPE_COMBINED, </div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>                       NULL,</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>                       (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>                       <span class="stringliteral">"hawki_sci_jitter.fits"</span>);</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="comment">/* Erase the WCS */</span></div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>         cpl_propertylist_erase_regexp(qclists[i], HAWKI_HEADER_WCS, 0) ;</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> </div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>     <span class="comment">/* Create a propertylist for PRO.x */</span></div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>     plist = cpl_propertylist_new();</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>                                    HAWKI_PROTYPE_STITCHED) ;</div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>                                    HAWKI_CALPRO_STITCHED) ;</div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>     <span class="comment">/* Handle WCS keys */</span></div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>     ext_chip_1 = 1;</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>     wcslist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>             cpl_frame_get_filename(ref_frame), ext_chip_1, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>     <span class="comment">/* Update WCS and write them */</span></div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>     crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); </div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>     crpix1 += hawki_sci_jitter_output.combined_pos_x[0];</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>     cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;</div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>     crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); </div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>     crpix2 += hawki_sci_jitter_output.combined_pos_y[0] ;</div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>     cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;</div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>     cpl_propertylist_append(plist, wcslist);</div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>     cpl_propertylist_delete(wcslist) ;</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>     <span class="comment">/* Write the stitched image */</span></div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>     cpl_dfs_save_image(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>                        NULL,</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>                        parlist,</div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>                        used_frames,</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>                        NULL,</div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>                        stitched,</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>                        CPL_BPP_IEEE_FLOAT,</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>                        recipe_name,</div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>                        plist,</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>                        NULL,</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>                        PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>                        <span class="stringliteral">"hawki_sci_jitter_stitched.fits"</span>);</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>     cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span> </div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>     <span class="comment">/* Write the FITS table with the objects statistics */</span></div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>     <span class="keywordflow">if</span> (obj_charac) </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>         <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>                           parlist,</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>                           used_frames,</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>                           (<span class="keyword">const</span> cpl_table **)obj_charac,</div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>                           recipe_name,</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>                           HAWKI_CALPRO_OBJ_PARAM,</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>                           HAWKI_PROTYPE_OBJ_PARAM,</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>                           NULL,</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>                           (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>                           <span class="stringliteral">"hawki_sci_jitter_stars.fits"</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="comment">/* Write the table with the background statistics */</span></div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>                       parlist,</div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>                       used_frames,   </div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>                       (<span class="keyword">const</span> cpl_table **)bkg_stats,</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>                       recipe_name,</div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>                       HAWKI_CALPRO_JITTER_BKG_STATS,</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>                       HAWKI_PROTYPE_JITTER_BKG_STATS,</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>                       NULL,</div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>                       (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>                       <span class="stringliteral">"hawki_sci_jitter_bkg_stats.fits"</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>     cpl_frameset_delete(used_frames);</div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>         cpl_propertylist_delete(qclists[i]) ;</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>     cpl_propertylist_delete(telstats) ;</div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>     cpl_free(qclists) ;</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>         <span class="keywordflow">return</span> -1;</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">return</span>  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> </div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span> <span class="keywordtype">int</span> hawki_sci_jitter_whole_image_algo</div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span> (cpl_frameset       *  obj,</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>  cpl_table          ** raw_jitter_stats,</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>  cpl_table          *  raw_obj_tel_info,</div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>  cpl_parameterlist  *  parlist,</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>  cpl_frameset       *  recipe_set)</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="keywordtype">int</span>                 nframes;</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>     <span class="keywordtype">int</span>                 iframe;</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>     </div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>     nframes = cpl_frameset_get_size(obj);</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)</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="comment">/* Local storage variables */</span></div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>         cpl_frame        * this_target_frame;</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>         cpl_propertylist * this_properties;</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="comment">/* Computing statistics for this frame */</span></div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Getting statistics for image %d"</span>, iframe + 1);</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>         this_target_frame = cpl_frameset_get_frame(obj, iframe);</div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a></div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>             (raw_jitter_stats, this_target_frame, iframe);</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">/* Compute the telescope pcs statistics */</span></div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>         this_properties = cpl_propertylist_load</div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>             (cpl_frame_get_filename(this_target_frame), 0);</div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>         <span class="keywordflow">if</span>(this_properties == NULL)</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>             cpl_msg_error(cpl_func,<span class="stringliteral">"Could not read the header of object frame"</span>);</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>             <span class="keywordflow">return</span>  -1;</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__hawki__properties__tel.html#gaedbe52365a410453e02d6b36d9d1b612" title="Extracts all the QC keywords and append them to the table.">hawki_extract_prop_tel_qc</a>(this_properties, raw_obj_tel_info, iframe))</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>         {</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>             cpl_msg_warning(cpl_func,<span class="stringliteral">"Some telescope properties could not be "</span></div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>                             <span class="stringliteral">"read for image %d"</span>, iframe+1);</div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>             cpl_errorstate_set(CPL_ERROR_NONE);</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>         cpl_propertylist_delete(this_properties);</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>     <span class="comment">/* Saving the already computed products */</span></div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Saving image statistics"</span>);</div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>     <span class="keywordflow">if</span>(hawki_sci_jitter_save_stats(raw_jitter_stats, raw_obj_tel_info, </div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>                                    obj,</div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>                                    parlist, recipe_set) != 0)</div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>         cpl_msg_warning(cpl_func,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>                         <span class="stringliteral">"Check permisions or disk space"</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>     <span class="keywordflow">return</span> 0;</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="keywordtype">int</span> hawki_sci_jitter_save_stats</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span> (cpl_table          ** raw_jitter_stats,</div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>  cpl_table          *  raw_obj_tel_info,</div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>  cpl_frameset       *  jitter_frames,</div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>  cpl_parameterlist  *  parlist,</div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>  cpl_frameset       *  recipe_set)</div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span> {</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>     <span class="keyword">const</span> cpl_frame  *  ref_frame;</div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>     cpl_propertylist ** qcstats;</div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>     cpl_propertylist *  telstats;</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_sci_jitter"</span> ;</div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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="comment">/* Statistics of the raw images in the QC */</span></div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>     qcstats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>     <span class="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>     ref_frame = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>         (recipe_set, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">int</span>                ext_nb;</div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>         cpl_propertylist * reflist;</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>         qcstats[idet] = cpl_propertylist_new();</div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>         ext_nb = </div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>             <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+1);</div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>         reflist = cpl_propertylist_load_regexp</div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>             (cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>              HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>         cpl_propertylist_append(qcstats[idet], reflist);</div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>         cpl_propertylist_delete(reflist);</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>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(raw_jitter_stats, qcstats);</div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>     <span class="comment">/* Write the table with the raw jitter objects statistics */</span></div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_set,</div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>                       parlist,</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>                       jitter_frames,</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>                       (<span class="keyword">const</span> cpl_table **)raw_jitter_stats,</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>                       recipe_name,</div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>                       HAWKI_CALPRO_JITTER_STATS,</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>                       HAWKI_PROTYPE_JITTER_STATS,</div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                       NULL,</div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                       (<span class="keyword">const</span> cpl_propertylist**)qcstats,</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>                       <span class="stringliteral">"hawki_sci_jitter_stats.fits"</span>);</div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>     <span class="comment">/* Free qcstats */</span></div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>         cpl_propertylist_delete(qcstats[idet]);</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="comment">/* Write the FITS table with the raw telescope data */</span></div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>     telstats = cpl_propertylist_new();</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>     cpl_propertylist_append_string(telstats, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>                                    HAWKI_PROTYPE_SCIENCE_PCS);</div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>     cpl_propertylist_append_string(telstats, CPL_DFS_PRO_CATG,</div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>                                    HAWKI_CALPRO_SCIENCE_PCS);</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>     hawki_compute_prop_tel_qc_stats(raw_obj_tel_info, telstats);</div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>     <span class="keywordflow">if</span>(cpl_dfs_save_table(recipe_set,</div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>                           NULL,</div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>                           parlist,</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>                           jitter_frames,</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>                           NULL,</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>                           raw_obj_tel_info,</div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>                           NULL,</div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>                           recipe_name,</div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>                           telstats,</div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>                           NULL,</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>                           PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>                           <span class="stringliteral">"hawki_sci_jitter_pcs.fits"</span>) != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot save PCS table"</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>     cpl_propertylist_delete(telstats);</div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>     cpl_free(qcstats);</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>         <span class="keywordflow">return</span> -1;</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>         </div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</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/hawki__step__apply__dist_8c_source.html b/html/hawki__step__apply__dist_8c_source.html
index d26051c..0db304a 100644
--- a/html/hawki__step__apply__dist_8c_source.html
+++ b/html/hawki__step__apply__dist_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_apply_dist.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,491 +40,492 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_apply_dist.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_apply_dist.c,v 1.10 2011/03/09 10:48: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/03/09 10:48:38 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.10 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                            Functions prototypes</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_create(cpl_plugin *) ;
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_exec(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_destroy(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_save
-<a name="l00057"></a>00057 (cpl_imagelist      *   images,
-<a name="l00058"></a>00058  <span class="keywordtype">int</span>                    iserie,
-<a name="l00059"></a>00059  cpl_parameterlist  *   recipe_parlist,
-<a name="l00060"></a>00060  cpl_frameset       *   used_frameset,
-<a name="l00061"></a>00061  cpl_frameset       *   recipe_frameset);
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 <span class="keywordtype">int</span> hawki_step_apply_dist_compute_and_save
-<a name="l00064"></a>00064 (cpl_frameset      * objects,
-<a name="l00065"></a>00065  cpl_frameset      * distortion_x,
-<a name="l00066"></a>00066  cpl_frameset      * distortion_y,
-<a name="l00067"></a>00067  cpl_parameterlist * parlist,
-<a name="l00068"></a>00068  cpl_frameset      * recipe_frameset);
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00071"></a>00071 <span class="comment">                            Static variables</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">char</span> hawki_step_apply_dist_description[] =
-<a name="l00075"></a>00075 <span class="stringliteral">"hawki_step_apply_dist -- Distortion correction utility\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"This recipe accepts three types of frames:\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"object.fits  Images to correct (PRO.CATG = "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">")\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"distmap_x.fits The image with the distortion in X.\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">")\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"distmap_y.fits The image with the distortion in Y.\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">")\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"This recipe produces:\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"hawki_step_apply_dist.fits:     the corrected image.\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">")\n"</span> ;
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00088"></a>00088 <span class="comment">                                Functions code</span>
-<a name="l00089"></a>00089 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00100"></a>00100 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00101"></a>00101 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00109"></a>00109                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00110"></a>00110                     <span class="stringliteral">"hawki_step_apply_dist"</span>,
-<a name="l00111"></a>00111                     <span class="stringliteral">"Distortion correction utility"</span>,
-<a name="l00112"></a>00112                     hawki_step_apply_dist_description,
-<a name="l00113"></a>00113                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00114"></a>00114                     PACKAGE_BUGREPORT,  
-<a name="l00115"></a>00115                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00116"></a>00116                     hawki_step_apply_dist_create,
-<a name="l00117"></a>00117                     hawki_step_apply_dist_exec,
-<a name="l00118"></a>00118                     hawki_step_apply_dist_destroy) ;
-<a name="l00119"></a>00119 
-<a name="l00120"></a>00120     cpl_pluginlist_append(list, plugin) ;
-<a name="l00121"></a>00121     
-<a name="l00122"></a>00122     <span class="keywordflow">return</span> 0;
-<a name="l00123"></a>00123 }
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00133"></a>00133 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00134"></a>00134 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_create(cpl_plugin * plugin)
-<a name="l00135"></a>00135 {
-<a name="l00136"></a>00136     cpl_recipe      *   recipe ;
-<a name="l00137"></a>00137         
-<a name="l00138"></a>00138     <span class="comment">/* Check that the plugin is part of a valid recipe */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00144"></a>00144     recipe->parameters = cpl_parameterlist_new() ; 
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146     <span class="comment">/* Return */</span>
-<a name="l00147"></a>00147     <span class="keywordflow">return</span> 0;
-<a name="l00148"></a>00148 }
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00156"></a>00156 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00157"></a>00157 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_exec(cpl_plugin * plugin)
-<a name="l00158"></a>00158 {
-<a name="l00159"></a>00159     cpl_recipe  *   recipe ;
-<a name="l00160"></a>00160     
-<a name="l00161"></a>00161     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00162"></a>00162     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00163"></a>00163         recipe = (cpl_recipe *)plugin ;
-<a name="l00164"></a>00164     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="comment">/* Issue a banner */</span>
-<a name="l00167"></a>00167     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00168"></a>00168 
-<a name="l00169"></a>00169     <span class="keywordflow">return</span> hawki_step_apply_dist(recipe->parameters, recipe->frames) ;
-<a name="l00170"></a>00170 }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00178"></a>00178 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00179"></a>00179 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_destroy(cpl_plugin * plugin)
-<a name="l00180"></a>00180 {
-<a name="l00181"></a>00181     cpl_recipe  *   recipe ;
-<a name="l00182"></a>00182     
-<a name="l00183"></a>00183     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     cpl_parameterlist_delete(recipe->parameters) ; 
-<a name="l00189"></a>00189     <span class="keywordflow">return</span> 0 ;
-<a name="l00190"></a>00190 }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00199"></a>00199 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00200"></a>00200 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist(
-<a name="l00201"></a>00201         cpl_parameterlist   *   parlist,
-<a name="l00202"></a>00202         cpl_frameset        *   frameset)
-<a name="l00203"></a>00203 {
-<a name="l00204"></a>00204     cpl_frameset *   objframes;
-<a name="l00205"></a>00205     cpl_frameset *   distortion_x;
-<a name="l00206"></a>00206     cpl_frameset *   distortion_y;
-<a name="l00207"></a>00207     
-<a name="l00208"></a>00208     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00209"></a>00209  
-<a name="l00210"></a>00210     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00212"></a>00212         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00213"></a>00213         <span class="keywordflow">return</span> -1 ;
-<a name="l00214"></a>00214     }
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     <span class="comment">/* Identifying objects frames */</span>
-<a name="l00217"></a>00217     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects"</span>);
-<a name="l00218"></a>00218     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00219"></a>00219         (frameset, HAWKI_CALPRO_BKG_SUBTRACTED);
-<a name="l00220"></a>00220     <span class="keywordflow">if</span> (objframes == NULL)
-<a name="l00221"></a>00221     {
-<a name="l00222"></a>00222         cpl_msg_error(__func__, <span class="stringliteral">"No object frames provided (%s)"</span>,
-<a name="l00223"></a>00223                       HAWKI_CALPRO_BKG_SUBTRACTED);
-<a name="l00224"></a>00224         <span class="keywordflow">return</span> -1 ;
-<a name="l00225"></a>00225     }
-<a name="l00226"></a>00226     
-<a name="l00227"></a>00227     <span class="comment">/* Identifying distortion frames */</span>
-<a name="l00228"></a>00228     cpl_msg_info(__func__, <span class="stringliteral">"Identifying distortion maps"</span>);
-<a name="l00229"></a>00229     distortion_x = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00230"></a>00230         (frameset, HAWKI_CALPRO_DISTORTION_X);
-<a name="l00231"></a>00231     distortion_y = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00232"></a>00232         (frameset, HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00233"></a>00233     <span class="keywordflow">if</span>(cpl_frameset_get_size(distortion_x) != 1 && 
-<a name="l00234"></a>00234        cpl_frameset_get_size(distortion_y) != 1 )
-<a name="l00235"></a>00235     {
-<a name="l00236"></a>00236         cpl_msg_error(__func__, <span class="stringliteral">"One X-distortion frame and one Y-distortion "</span>
-<a name="l00237"></a>00237                       <span class="stringliteral">"must be provided (%s, %s)"</span>,
-<a name="l00238"></a>00238                       HAWKI_CALPRO_DISTORTION_X, HAWKI_CALPRO_DISTORTION_Y);
-<a name="l00239"></a>00239         cpl_frameset_delete(objframes);
-<a name="l00240"></a>00240         cpl_frameset_delete(distortion_x);
-<a name="l00241"></a>00241         cpl_frameset_delete(distortion_y);
-<a name="l00242"></a>00242         <span class="keywordflow">return</span> -1 ;
-<a name="l00243"></a>00243     }
-<a name="l00244"></a>00244     
-<a name="l00245"></a>00245     <span class="comment">/* Apply the correction and save */</span>
-<a name="l00246"></a>00246     <span class="keywordflow">if</span>(hawki_step_apply_dist_compute_and_save
-<a name="l00247"></a>00247         (objframes, distortion_x, distortion_y, parlist, frameset) == -1)
-<a name="l00248"></a>00248     {
-<a name="l00249"></a>00249         cpl_msg_error(__func__,<span class="stringliteral">"Could not correct the frames"</span>); 
-<a name="l00250"></a>00250         cpl_frameset_delete(objframes);
-<a name="l00251"></a>00251         cpl_frameset_delete(distortion_x);
-<a name="l00252"></a>00252         cpl_frameset_delete(distortion_y);
-<a name="l00253"></a>00253         <span class="keywordflow">return</span> -1;
-<a name="l00254"></a>00254     }
-<a name="l00255"></a>00255     
-<a name="l00256"></a>00256     <span class="comment">/* Free and return */</span>
-<a name="l00257"></a>00257     cpl_frameset_delete(objframes);
-<a name="l00258"></a>00258     cpl_frameset_delete(distortion_x);
-<a name="l00259"></a>00259     cpl_frameset_delete(distortion_y);
-<a name="l00260"></a>00260     
-<a name="l00261"></a>00261     <span class="comment">/* Return */</span>
-<a name="l00262"></a>00262     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00263"></a>00263     {
-<a name="l00264"></a>00264         cpl_msg_error(__func__,
-<a name="l00265"></a>00265                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00266"></a>00266         <span class="keywordflow">return</span> -1 ;
-<a name="l00267"></a>00267     }
-<a name="l00268"></a>00268     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00269"></a>00269 }
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00280"></a>00280 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00281"></a>00281 <span class="keywordtype">int</span> hawki_step_apply_dist_compute_and_save
-<a name="l00282"></a>00282 (cpl_frameset      * objects,
-<a name="l00283"></a>00283  cpl_frameset      * distortion_x,
-<a name="l00284"></a>00284  cpl_frameset      * distortion_y,
-<a name="l00285"></a>00285  cpl_parameterlist * parlist,
-<a name="l00286"></a>00286  cpl_frameset      * recipe_frameset)
-<a name="l00287"></a>00287 {
-<a name="l00288"></a>00288     <span class="keyword">const</span> cpl_frame   *  distframe_x;
-<a name="l00289"></a>00289     <span class="keyword">const</span> cpl_frame   *  distframe_y;
-<a name="l00290"></a>00290     cpl_image        **  dist_x;
-<a name="l00291"></a>00291     cpl_image        **  dist_y;
-<a name="l00292"></a>00292     cpl_image         *  first_image;
-<a name="l00293"></a>00293     <span class="keywordtype">int</span>                  nx;
-<a name="l00294"></a>00294     <span class="keywordtype">int</span>                  ny;
-<a name="l00295"></a>00295     <span class="keywordtype">int</span>                  iframe;
-<a name="l00296"></a>00296     <span class="keywordtype">int</span>                  nframes;
-<a name="l00297"></a>00297     <span class="keywordtype">int</span>                  idet;
-<a name="l00298"></a>00298     <span class="keywordtype">int</span>                  jdet;
-<a name="l00299"></a>00299     cpl_errorstate       error_prevstate = cpl_errorstate_get();
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     <span class="comment">/* Get the distortion filename and distortion maps */</span>
-<a name="l00302"></a>00302     cpl_msg_info(__func__,<span class="stringliteral">"Creating the distortion maps"</span>);
-<a name="l00303"></a>00303     distframe_x = cpl_frameset_get_first_const(distortion_x);
-<a name="l00304"></a>00304     distframe_y = cpl_frameset_get_first_const(distortion_y);
-<a name="l00305"></a>00305     first_image = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(objects, 0, 1, CPL_TYPE_FLOAT);
-<a name="l00306"></a>00306     nx = cpl_image_get_size_x(first_image);
-<a name="l00307"></a>00307     ny = cpl_image_get_size_y(first_image);
-<a name="l00308"></a>00308     cpl_image_delete(first_image);
-<a name="l00309"></a>00309     dist_x = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l00310"></a>00310     dist_y = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l00311"></a>00311     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00312"></a>00312     {
-<a name="l00313"></a>00313         hawki_distortion * distortion;
-<a name="l00314"></a>00314         dist_x[idet] = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
-<a name="l00315"></a>00315         dist_y[idet] = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE) ;
-<a name="l00316"></a>00316         
-<a name="l00317"></a>00317         <span class="comment">/* Load the distortion */</span>
-<a name="l00318"></a>00318         <span class="keywordflow">if</span> ((distortion = <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a>
-<a name="l00319"></a>00319                 (distframe_x, distframe_y , idet+1)) == NULL) 
-<a name="l00320"></a>00320         {
-<a name="l00321"></a>00321             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the distortion for chip %d: %s"</span>, 
-<a name="l00322"></a>00322                     idet+1, cpl_error_get_message());
-<a name="l00323"></a>00323             <span class="keywordflow">for</span> (jdet=0 ; jdet<=idet; jdet++)
-<a name="l00324"></a>00324             {
-<a name="l00325"></a>00325                 cpl_image_delete(dist_x[jdet]);
-<a name="l00326"></a>00326                 cpl_image_delete(dist_y[jdet]);
-<a name="l00327"></a>00327             }
-<a name="l00328"></a>00328             cpl_free(dist_x);
-<a name="l00329"></a>00329             cpl_free(dist_y);
-<a name="l00330"></a>00330             <span class="keywordflow">return</span> -1 ;
-<a name="l00331"></a>00331         }
-<a name="l00332"></a>00332         <span class="keywordflow">if</span> (hawki_distortion_create_maps_detector
-<a name="l00333"></a>00333                 (distortion, dist_x[idet], dist_y[idet]))
-<a name="l00334"></a>00334         {
-<a name="l00335"></a>00335             cpl_msg_error(__func__, <span class="stringliteral">"Cannot create the distortion maps"</span>) ;
-<a name="l00336"></a>00336             <span class="keywordflow">for</span> (jdet=0 ; jdet<=idet; jdet++)
-<a name="l00337"></a>00337             {
-<a name="l00338"></a>00338                 cpl_image_delete(dist_x[jdet]);
-<a name="l00339"></a>00339                 cpl_image_delete(dist_y[jdet]);
-<a name="l00340"></a>00340             }
-<a name="l00341"></a>00341             cpl_free(dist_x);
-<a name="l00342"></a>00342             cpl_free(dist_y);
-<a name="l00343"></a>00343             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);
-<a name="l00344"></a>00344             <span class="keywordflow">return</span> -1;
-<a name="l00345"></a>00345         }
-<a name="l00346"></a>00346         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);
-<a name="l00347"></a>00347     }
-<a name="l00348"></a>00348     
-<a name="l00349"></a>00349     <span class="comment">/* Loop on frames */</span>
-<a name="l00350"></a>00350     nframes = cpl_frameset_get_size(objects);
-<a name="l00351"></a>00351     cpl_msg_info(__func__,<span class="stringliteral">"Number of frames to process: %d"</span>, nframes);
-<a name="l00352"></a>00352     cpl_msg_indent_more();
-<a name="l00353"></a>00353     <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes; ++iframe)
-<a name="l00354"></a>00354     {
-<a name="l00355"></a>00355         cpl_imagelist * object_images;
-<a name="l00356"></a>00356         cpl_frame     * this_frame;
-<a name="l00357"></a>00357         cpl_frameset  * used_frameset;
-<a name="l00358"></a>00358     
-<a name="l00359"></a>00359         <span class="comment">/* Msg */</span>
-<a name="l00360"></a>00360         cpl_msg_info(__func__,<span class="stringliteral">"Correcting distortion in frame %d"</span>,iframe+1);
-<a name="l00361"></a>00361         
-<a name="l00362"></a>00362         <span class="comment">/* Load the HAWKI images */</span>
-<a name="l00363"></a>00363         this_frame = cpl_frameset_get_frame(objects, iframe);
-<a name="l00364"></a>00364         <span class="keywordflow">if</span>((object_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(this_frame, CPL_TYPE_FLOAT)) == NULL)
-<a name="l00365"></a>00365         {
-<a name="l00366"></a>00366             cpl_msg_error(__func__,<span class="stringliteral">"Could not load input object images"</span>);
-<a name="l00367"></a>00367             cpl_msg_indent_less();
-<a name="l00368"></a>00368             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00369"></a>00369             {
-<a name="l00370"></a>00370                 cpl_image_delete(dist_x[idet]);
-<a name="l00371"></a>00371                 cpl_image_delete(dist_y[idet]);
-<a name="l00372"></a>00372             }
-<a name="l00373"></a>00373             cpl_free(dist_x);
-<a name="l00374"></a>00374             cpl_free(dist_y);
-<a name="l00375"></a>00375             <span class="keywordflow">return</span> -1;
-<a name="l00376"></a>00376         }
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378         <span class="comment">/* Apply the correction on the current image */</span>
-<a name="l00379"></a>00379         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a>(object_images, dist_x, dist_y) == -1) 
-<a name="l00380"></a>00380         {
-<a name="l00381"></a>00381             cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct distortion"</span>) ;
-<a name="l00382"></a>00382             cpl_msg_indent_less();
-<a name="l00383"></a>00383             cpl_imagelist_delete(object_images);
-<a name="l00384"></a>00384             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00385"></a>00385             {
-<a name="l00386"></a>00386                 cpl_image_delete(dist_x[idet]);
-<a name="l00387"></a>00387                 cpl_image_delete(dist_y[idet]);
-<a name="l00388"></a>00388             }
-<a name="l00389"></a>00389             cpl_free(dist_x);
-<a name="l00390"></a>00390             cpl_free(dist_y);
-<a name="l00391"></a>00391             <span class="keywordflow">return</span> -1 ;
-<a name="l00392"></a>00392         }
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394         <span class="comment">/* Set the used frameset */</span>
-<a name="l00395"></a>00395         used_frameset = cpl_frameset_new(); 
-<a name="l00396"></a>00396         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(this_frame));
-<a name="l00397"></a>00397         cpl_frameset_insert
-<a name="l00398"></a>00398             (used_frameset,cpl_frame_duplicate
-<a name="l00399"></a>00399                  (cpl_frameset_get_first_const((distortion_x))));
-<a name="l00400"></a>00400         cpl_frameset_insert
-<a name="l00401"></a>00401             (used_frameset,cpl_frame_duplicate
-<a name="l00402"></a>00402                  (cpl_frameset_get_first_const((distortion_y))));
-<a name="l00403"></a>00403             
-<a name="l00404"></a>00404         <span class="comment">/* Save the corrected image */</span>
-<a name="l00405"></a>00405         <span class="keywordflow">if</span> (hawki_step_apply_dist_save
-<a name="l00406"></a>00406                 (object_images, iframe, 
-<a name="l00407"></a>00407                  parlist, used_frameset, recipe_frameset) == -1)
-<a name="l00408"></a>00408         {
-<a name="l00409"></a>00409             cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00410"></a>00410         }
-<a name="l00411"></a>00411         
-<a name="l00412"></a>00412         <span class="comment">/* Free resources */</span>
-<a name="l00413"></a>00413         cpl_frameset_delete(used_frameset);
-<a name="l00414"></a>00414         cpl_imagelist_delete(object_images);
-<a name="l00415"></a>00415         
-<a name="l00416"></a>00416     }
-<a name="l00417"></a>00417     cpl_msg_indent_less();
-<a name="l00418"></a>00418     
-<a name="l00419"></a>00419     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00420"></a>00420     {
-<a name="l00421"></a>00421         cpl_image_delete(dist_x[idet]);
-<a name="l00422"></a>00422         cpl_image_delete(dist_y[idet]);
-<a name="l00423"></a>00423     }
-<a name="l00424"></a>00424     cpl_free(dist_x);
-<a name="l00425"></a>00425     cpl_free(dist_y);
-<a name="l00426"></a>00426     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00427"></a>00427     {
-<a name="l00428"></a>00428         cpl_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span>
-<a name="l00429"></a>00429                         <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00430"></a>00430     }                           
-<a name="l00431"></a>00431     <span class="keywordflow">return</span> 0;
-<a name="l00432"></a>00432 }
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00443"></a>00443 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00444"></a>00444 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_save
-<a name="l00445"></a>00445 (cpl_imagelist      *   images,
-<a name="l00446"></a>00446  <span class="keywordtype">int</span>                    iserie,
-<a name="l00447"></a>00447  cpl_parameterlist  *   recipe_parlist,
-<a name="l00448"></a>00448  cpl_frameset       *   used_frameset,
-<a name="l00449"></a>00449  cpl_frameset       *   recipe_frameset)
-<a name="l00450"></a>00450 {
-<a name="l00451"></a>00451     <span class="keyword">const</span> cpl_frame     *   raw_reference;
-<a name="l00452"></a>00452     cpl_propertylist    **  extproplists;
-<a name="l00453"></a>00453     <span class="keywordtype">char</span>                    filename[256] ;
-<a name="l00454"></a>00454     cpl_propertylist    *   inputlist ;
-<a name="l00455"></a>00455     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00456"></a>00456     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_apply_dist"</span>;
-<a name="l00457"></a>00457     <span class="keywordtype">int</span>                     idet;
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="comment">/* Get the reference frame (the raw frame) */</span>
-<a name="l00460"></a>00460     raw_reference = irplib_frameset_get_first_from_group
-<a name="l00461"></a>00461         (used_frameset, CPL_FRAME_GROUP_RAW);
-<a name="l00462"></a>00462     
-<a name="l00463"></a>00463     <span class="comment">/* Create the prop lists */</span>
-<a name="l00464"></a>00464     cpl_msg_indent_more();
-<a name="l00465"></a>00465     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l00466"></a>00466     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00467"></a>00467     {
-<a name="l00468"></a>00468         <span class="comment">/* Get the extension number */</span>
-<a name="l00469"></a>00469         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00470"></a>00470             (cpl_frame_get_filename(raw_reference), idet+1);
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472         <span class="comment">/* Allocate this property list */</span>
-<a name="l00473"></a>00473         extproplists[idet] = cpl_propertylist_new();
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00476"></a>00476         inputlist = cpl_propertylist_load_regexp(
-<a name="l00477"></a>00477                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00478"></a>00478                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00479"></a>00479         cpl_propertylist_append(extproplists[idet], inputlist);
-<a name="l00480"></a>00480         cpl_propertylist_delete(inputlist);
-<a name="l00481"></a>00481         inputlist = cpl_propertylist_load_regexp(
-<a name="l00482"></a>00482                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00483"></a>00483                 HAWKI_HEADER_WCS, 0);
-<a name="l00484"></a>00484         cpl_propertylist_append(extproplists[idet], inputlist);
-<a name="l00485"></a>00485         cpl_propertylist_delete(inputlist);
-<a name="l00486"></a>00486     }
-<a name="l00487"></a>00487     
-<a name="l00488"></a>00488     <span class="comment">/* Write the image */</span>
-<a name="l00489"></a>00489     snprintf(filename, 256, <span class="stringliteral">"hawki_step_apply_dist_%03d.fits"</span>, iserie+1);
-<a name="l00490"></a>00490     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>
-<a name="l00491"></a>00491         (recipe_frameset,
-<a name="l00492"></a>00492          recipe_parlist,
-<a name="l00493"></a>00493          used_frameset,
-<a name="l00494"></a>00494          images,
-<a name="l00495"></a>00495          recipe_name,
-<a name="l00496"></a>00496          HAWKI_CALPRO_DIST_CORRECTED,
-<a name="l00497"></a>00497          HAWKI_PROTYPE_DIST_CORRECTED,
-<a name="l00498"></a>00498          NULL,
-<a name="l00499"></a>00499          (<span class="keyword">const</span> cpl_propertylist**)extproplists,
-<a name="l00500"></a>00500          filename) != 0)
-<a name="l00501"></a>00501     {
-<a name="l00502"></a>00502         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00503"></a>00503             cpl_propertylist_delete(extproplists[idet]) ;
-<a name="l00504"></a>00504         cpl_free(extproplists) ;
-<a name="l00505"></a>00505         cpl_msg_indent_less();
-<a name="l00506"></a>00506         <span class="keywordflow">return</span> -1;
-<a name="l00507"></a>00507     }
-<a name="l00508"></a>00508     
-<a name="l00509"></a>00509     <span class="comment">/* Free and return */</span>
-<a name="l00510"></a>00510     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l00511"></a>00511         cpl_propertylist_delete(extproplists[idet]) ;
-<a name="l00512"></a>00512     }
-<a name="l00513"></a>00513     cpl_free(extproplists) ;
-<a name="l00514"></a>00514     cpl_msg_indent_less();
-<a name="l00515"></a>00515     <span class="keywordflow">return</span>  0;
-<a name="l00516"></a>00516 }
-<a name="l00517"></a>00517 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_apply_dist.c,v 1.10 2011/03/09 10:48: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/03/09 10:48: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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_distortion.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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist(cpl_parameterlist *, cpl_frameset *) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_save</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> (cpl_imagelist      *   images,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>  <span class="keywordtype">int</span>                    iserie,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  cpl_parameterlist  *   recipe_parlist,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>  cpl_frameset       *   used_frameset,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  cpl_frameset       *   recipe_frameset);</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="keywordtype">int</span> hawki_step_apply_dist_compute_and_save</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> (cpl_frameset      * objects,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  cpl_frameset      * distortion_x,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  cpl_frameset      * distortion_y,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  cpl_parameterlist * parlist,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  cpl_frameset      * recipe_frameset);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="comment">                            Static variables</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">char</span> hawki_step_apply_dist_description[] =</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"hawki_step_apply_dist -- Distortion correction utility\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"This recipe accepts three types of frames:\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"object.fits  Images to correct (PRO.CATG = "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"distmap_x.fits The image with the distortion in X.\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DISTORTION_X<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"distmap_y.fits The image with the distortion in Y.\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DISTORTION_Y<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"This recipe produces:\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"hawki_step_apply_dist.fits:     the corrected image.\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">")\n"</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="comment">                                Functions code</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="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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe ) ;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     <span class="stringliteral">"hawki_step_apply_dist"</span>,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <span class="stringliteral">"Distortion correction utility"</span>,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     hawki_step_apply_dist_description,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     hawki_step_apply_dist_create,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     hawki_step_apply_dist_exec,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     hawki_step_apply_dist_destroy) ;</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_pluginlist_append(list, plugin) ;</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> 0;</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="l00133"></a><span class="lineno">  133</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_create(cpl_plugin * plugin)</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 ;</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">/* Check that the plugin is part of a valid recipe */</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> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     recipe->parameters = cpl_parameterlist_new() ; </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">/* Return */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordflow">return</span> 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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">else</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_apply_dist(recipe->parameters, recipe->frames) ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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>     cpl_parameterlist_delete(recipe->parameters) ; </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist(</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>         cpl_frameset        *   frameset)</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_frameset *   objframes;</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     cpl_frameset *   distortion_x;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     cpl_frameset *   distortion_y;</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">/* Retrieve input parameters */</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Identifying objects frames */</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects"</span>);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         (frameset, HAWKI_CALPRO_BKG_SUBTRACTED);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">if</span> (objframes == 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>         cpl_msg_error(__func__, <span class="stringliteral">"No object frames provided (%s)"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                       HAWKI_CALPRO_BKG_SUBTRACTED);</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>     </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="comment">/* Identifying distortion frames */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying distortion maps"</span>);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     distortion_x = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         (frameset, HAWKI_CALPRO_DISTORTION_X);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     distortion_y = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>         (frameset, HAWKI_CALPRO_DISTORTION_Y);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="keywordflow">if</span>(cpl_frameset_get_size(distortion_x) != 1 && </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>        cpl_frameset_get_size(distortion_y) != 1 )</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>         cpl_msg_error(__func__, <span class="stringliteral">"One X-distortion frame and one Y-distortion "</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                       <span class="stringliteral">"must be provided (%s, %s)"</span>,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                       HAWKI_CALPRO_DISTORTION_X, HAWKI_CALPRO_DISTORTION_Y);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>         cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         cpl_frameset_delete(distortion_x);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>         cpl_frameset_delete(distortion_y);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Apply the correction and save */</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordflow">if</span>(hawki_step_apply_dist_compute_and_save</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>         (objframes, distortion_x, distortion_y, parlist, frameset) == -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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not correct the frames"</span>); </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         cpl_frameset_delete(distortion_x);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         cpl_frameset_delete(distortion_y);</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>     </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_frameset_delete(distortion_x);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_frameset_delete(distortion_y);</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 */</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>         <span class="keywordflow">return</span> -1 ;</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">else</span> <span class="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> hawki_step_apply_dist_compute_and_save</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> (cpl_frameset      * objects,</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>  cpl_frameset      * distortion_x,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>  cpl_frameset      * distortion_y,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>  cpl_parameterlist * parlist,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>  cpl_frameset      * recipe_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>     <span class="keyword">const</span> cpl_frame   *  distframe_x;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keyword">const</span> cpl_frame   *  distframe_y;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_image        **  dist_x;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_image        **  dist_y;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_image         *  first_image;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordtype">int</span>                  nx;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordtype">int</span>                  ny;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordtype">int</span>                  iframe;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span>                  nframes;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordtype">int</span>                  idet;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordtype">int</span>                  jdet;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_errorstate       error_prevstate = cpl_errorstate_get();</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">/* Get the distortion filename and distortion maps */</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     cpl_msg_info(__func__,<span class="stringliteral">"Creating the distortion maps"</span>);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     distframe_x = cpl_frameset_get_first_const(distortion_x);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     distframe_y = cpl_frameset_get_first_const(distortion_y);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     first_image = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(objects, 0, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     nx = cpl_image_get_size_x(first_image);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     ny = cpl_image_get_size_y(first_image);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_image_delete(first_image);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     dist_x = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     dist_y = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         hawki_distortion * distortion;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         dist_x[idet] = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         dist_y[idet] = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE) ;</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">/* Load the distortion */</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         <span class="keywordflow">if</span> ((distortion = <a class="code" href="group__hawki__distortion.html#gab9c3ebd02585f319d08b5149b44528e7" title="Loads the distortion solution for one detector.">hawki_distortion_load</a></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                 (distframe_x, distframe_y , idet+1)) == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the distortion for chip %d: %s"</span>, </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                     idet+1, cpl_error_get_message());</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>             <span class="keywordflow">for</span> (jdet=0 ; jdet<=idet; jdet++)</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>                 cpl_image_delete(dist_x[jdet]);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                 cpl_image_delete(dist_y[jdet]);</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(dist_x);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             cpl_free(dist_y);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             <span class="keywordflow">return</span> -1 ;</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> (hawki_distortion_create_maps_detector</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                 (distortion, dist_x[idet], dist_y[idet]))</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_error(__func__, <span class="stringliteral">"Cannot create the distortion maps"</span>) ;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>             <span class="keywordflow">for</span> (jdet=0 ; jdet<=idet; jdet++)</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_image_delete(dist_x[jdet]);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                 cpl_image_delete(dist_y[jdet]);</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_free(dist_x);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             cpl_free(dist_y);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);</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>         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion);</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">/* Loop on frames */</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     nframes = cpl_frameset_get_size(objects);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_msg_info(__func__,<span class="stringliteral">"Number of frames to process: %d"</span>, nframes);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordflow">for</span>(iframe = 0 ; iframe < nframes; ++iframe)</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_imagelist * object_images;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         cpl_frame     * this_frame;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         cpl_frameset  * used_frameset;</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">/* Msg */</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         cpl_msg_info(__func__,<span class="stringliteral">"Correcting distortion in frame %d"</span>,iframe+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>         <span class="comment">/* Load the HAWKI images */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>         this_frame = cpl_frameset_get_frame(objects, iframe);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         <span class="keywordflow">if</span>((object_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(this_frame, CPL_TYPE_FLOAT)) == NULL)</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_error(__func__,<span class="stringliteral">"Could not load input object images"</span>);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>                 cpl_image_delete(dist_x[idet]);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                 cpl_image_delete(dist_y[idet]);</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_free(dist_x);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>             cpl_free(dist_y);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>             <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         <span class="comment">/* Apply the correction on the current image */</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__distortion.html#ga4ad09d8cbb7f3ed8fddeb451f3b2056f" title="Apply the distortion correction.">hawki_distortion_apply_maps</a>(object_images, dist_x, dist_y) == -1) </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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot correct distortion"</span>) ;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>             cpl_imagelist_delete(object_images);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>             <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>                 cpl_image_delete(dist_x[idet]);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                 cpl_image_delete(dist_y[idet]);</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>             cpl_free(dist_x);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>             cpl_free(dist_y);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>             <span class="keywordflow">return</span> -1 ;</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>         <span class="comment">/* Set the used frameset */</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         used_frameset = cpl_frameset_new(); </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(this_frame));</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         cpl_frameset_insert</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>             (used_frameset,cpl_frame_duplicate</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                  (cpl_frameset_get_first_const((distortion_x))));</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         cpl_frameset_insert</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>             (used_frameset,cpl_frame_duplicate</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                  (cpl_frameset_get_first_const((distortion_y))));</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">/* Save the corrected image */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         <span class="keywordflow">if</span> (hawki_step_apply_dist_save</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                 (object_images, iframe, </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                  parlist, used_frameset, recipe_frameset) == -1)</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_errorstate_set(CPL_ERROR_NONE);</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="comment">/* Free resources */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         cpl_imagelist_delete(object_images);</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>     cpl_msg_indent_less();</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">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_image_delete(dist_x[idet]);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         cpl_image_delete(dist_y[idet]);</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_free(dist_x);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_free(dist_y);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                         <span class="stringliteral">"Check permisions or disk space"</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">return</span> 0;</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> </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_apply_dist_save</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> (cpl_imagelist      *   images,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>  <span class="keywordtype">int</span>                    iserie,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>  cpl_parameterlist  *   recipe_parlist,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>  cpl_frameset       *   used_frameset,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>  cpl_frameset       *   recipe_frameset)</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="keyword">const</span> cpl_frame     *   raw_reference;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     cpl_propertylist    **  extproplists;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordtype">char</span>                    filename[256] ;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_apply_dist"</span>;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordtype">int</span>                     idet;</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="comment">/* Get the reference frame (the raw frame) */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     raw_reference = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         (used_frameset, CPL_FRAME_GROUP_RAW);</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">/* Create the prop lists */</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>             (cpl_frame_get_filename(raw_reference), idet+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>         <span class="comment">/* Allocate this property list */</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         extproplists[idet] = cpl_propertylist_new();</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">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_propertylist_append(extproplists[idet], inputlist);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         cpl_propertylist_delete(inputlist);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                 HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_propertylist_append(extproplists[idet], inputlist);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         cpl_propertylist_delete(inputlist);</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>     <span class="comment">/* Write the image */</span></div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     snprintf(filename, 256, <span class="stringliteral">"hawki_step_apply_dist_%03d.fits"</span>, iserie+1);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a></div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         (recipe_frameset,</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>          recipe_parlist,</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>          used_frameset,</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>          images,</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>          recipe_name,</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>          HAWKI_CALPRO_DIST_CORRECTED,</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>          HAWKI_PROTYPE_DIST_CORRECTED,</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>          NULL,</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>          (<span class="keyword">const</span> cpl_propertylist**)extproplists,</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>          filename) != 0)</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> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             cpl_propertylist_delete(extproplists[idet]) ;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         cpl_free(extproplists) ;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         cpl_propertylist_delete(extproplists[idet]) ;</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_free(extproplists) ;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <span class="keywordflow">return</span>  0;</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><!-- 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/hawki__step__basic__calib_8c_source.html b/html/hawki__step__basic__calib_8c_source.html
index 75ae09c..9215a2f 100644
--- a/html/hawki__step__basic__calib_8c_source.html
+++ b/html/hawki__step__basic__calib_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_basic_calib.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,545 +40,546 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_basic_calib.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_basic_calib.c,v 1.13 2011/01/31 11:03:23 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/01/31 11:03:23 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.13 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                                Define</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span>
-<a name="l00055"></a>00055 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00056"></a>00056 <span class="comment">                            Functions prototypes</span>
-<a name="l00057"></a>00057 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_create(cpl_plugin *) ;
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_exec(cpl_plugin *) ;
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_destroy(cpl_plugin *) ;
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_applycal_qc_save
-<a name="l00065"></a>00065 (cpl_frameset      *  raw_target,
-<a name="l00066"></a>00066  <span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00067"></a>00067  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00068"></a>00068  <span class="keyword">const</span> cpl_frame   *  bpm,
-<a name="l00069"></a>00069  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,
-<a name="l00070"></a>00070  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,
-<a name="l00071"></a>00071  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,
-<a name="l00072"></a>00072  cpl_parameterlist *  recipe_parlist,
-<a name="l00073"></a>00073  cpl_frameset      *  recipe_framelist);
-<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_basic_calib_qc(<span class="keywordtype">void</span>);
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_save
-<a name="l00076"></a>00076 (cpl_imagelist     *  reduced,
-<a name="l00077"></a>00077  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,
-<a name="l00078"></a>00078  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,
-<a name="l00079"></a>00079  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,
-<a name="l00080"></a>00080  <span class="keywordtype">int</span>                  iserie,
-<a name="l00081"></a>00081  cpl_frameset      *  used_frameset,
-<a name="l00082"></a>00082  cpl_parameterlist *  recipe_parlist,
-<a name="l00083"></a>00083  cpl_frameset      *  recipe_framelist);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00086"></a>00086 <span class="comment">                            Static variables</span>
-<a name="l00087"></a>00087 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_basic_calib_description[] =
-<a name="l00090"></a>00090 <span class="stringliteral">"hawki_step_basic_calib -- hawki basic reduction utility (flat, dark).\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_SKY_RAW<span class="stringliteral">" \n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" \n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" \n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" \n"</span>;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00099"></a>00099 <span class="comment">                                Functions code</span>
-<a name="l00100"></a>00100 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00110"></a>00110 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00111"></a>00111 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00112"></a>00112 {
-<a name="l00113"></a>00113     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00114"></a>00114     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116     cpl_plugin_init(plugin,
-<a name="l00117"></a>00117                     CPL_PLUGIN_API,
-<a name="l00118"></a>00118                     HAWKI_BINARY_VERSION,
-<a name="l00119"></a>00119                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00120"></a>00120                     <span class="stringliteral">"hawki_step_basic_calib"</span>,
-<a name="l00121"></a>00121                     <span class="stringliteral">"Basic reduction recipe"</span>,
-<a name="l00122"></a>00122                     hawki_step_basic_calib_description,
-<a name="l00123"></a>00123                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00124"></a>00124                     <span class="stringliteral">"cgarcia at eso.org"</span>,
-<a name="l00125"></a>00125                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00126"></a>00126                     hawki_step_basic_calib_create,
-<a name="l00127"></a>00127                     hawki_step_basic_calib_exec,
-<a name="l00128"></a>00128                     hawki_step_basic_calib_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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00144"></a>00144 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00145"></a>00145 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_create(cpl_plugin * plugin)
-<a name="l00146"></a>00146 {
-<a name="l00147"></a>00147     cpl_recipe      * recipe ;
-<a name="l00148"></a>00148     <span class="comment">/* cpl_parameter   * p ; */</span>
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00156"></a>00156     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00157"></a>00157 
-<a name="l00158"></a>00158     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00159"></a>00159     <span class="comment">/* None.. */</span>
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00171"></a>00171 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00172"></a>00172 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_exec(cpl_plugin * plugin)
-<a name="l00173"></a>00173 {
-<a name="l00174"></a>00174     cpl_recipe  *   recipe ;
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00177"></a>00177     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00178"></a>00178         recipe = (cpl_recipe *)plugin ;
-<a name="l00179"></a>00179     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <span class="comment">/* Issue a banner */</span>
-<a name="l00182"></a>00182     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">return</span> hawki_step_basic_calib(recipe->parameters, recipe->frames) ;
-<a name="l00185"></a>00185 }
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00193"></a>00193 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00194"></a>00194 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_destroy(cpl_plugin * plugin)
-<a name="l00195"></a>00195 {
-<a name="l00196"></a>00196     cpl_recipe  *   recipe ;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00204"></a>00204     <span class="keywordflow">return</span> 0 ;
-<a name="l00205"></a>00205 }
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00214"></a>00214 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00215"></a>00215 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib(
-<a name="l00216"></a>00216         cpl_parameterlist   *   parlist, 
-<a name="l00217"></a>00217         cpl_frameset        *   framelist)
-<a name="l00218"></a>00218 {
-<a name="l00219"></a>00219     <span class="keyword">const</span> cpl_frame  * flat;
-<a name="l00220"></a>00220     <span class="keyword">const</span> cpl_frame  * dark;
-<a name="l00221"></a>00221     <span class="keyword">const</span> cpl_frame  * bpm;
-<a name="l00222"></a>00222     cpl_frameset     * objframes ;
-<a name="l00223"></a>00223     cpl_frameset     * skyframes ;
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00226"></a>00226     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00227"></a>00227         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00228"></a>00228         <span class="keywordflow">return</span> -1 ;
-<a name="l00229"></a>00229     }
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     <span class="comment">/* Retrieve calibration data */</span>
-<a name="l00232"></a>00232     cpl_msg_info(__func__, <span class="stringliteral">"Identifying calibration data"</span>);
-<a name="l00233"></a>00233     flat   = cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT);
-<a name="l00234"></a>00234     dark   = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DARK);
-<a name="l00235"></a>00235     bpm    = cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM);
-<a name="l00236"></a>00236     <span class="keywordflow">if</span> (flat == NULL && dark == NULL && bpm == NULL)
-<a name="l00237"></a>00237     {
-<a name="l00238"></a>00238         cpl_msg_error(__func__, <span class="stringliteral">"No calibration data provided (%s and/or %s and/or %s)"</span>,
-<a name="l00239"></a>00239                 HAWKI_CALPRO_FLAT, HAWKI_CALPRO_DARK, HAWKI_CALPRO_BPM);
-<a name="l00240"></a>00240         <span class="keywordflow">return</span> -1 ;
-<a name="l00241"></a>00241     }
-<a name="l00242"></a>00242     
-<a name="l00243"></a>00243     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00244"></a>00244     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects and sky data"</span>);
-<a name="l00245"></a>00245     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;
-<a name="l00246"></a>00246     <span class="comment">/* Retrieve sky frames */</span>
-<a name="l00247"></a>00247     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_SKY_RAW) ;
-<a name="l00248"></a>00248     <span class="keywordflow">if</span> (objframes == NULL && skyframes == NULL)
-<a name="l00249"></a>00249     {
-<a name="l00250"></a>00250         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find objs (%s) or sky frames (%s) in the input list"</span>,
-<a name="l00251"></a>00251                 HAWKI_IMG_JITTER_RAW, HAWKI_IMG_JITTER_SKY_RAW);
-<a name="l00252"></a>00252         <span class="keywordflow">return</span> -1 ;
-<a name="l00253"></a>00253     }
-<a name="l00254"></a>00254     
-<a name="l00255"></a>00255     <span class="comment">/* Applying the calibrations, QC and saving the results */</span>
-<a name="l00256"></a>00256     <span class="keywordflow">if</span> (objframes != NULL)
-<a name="l00257"></a>00257     {
-<a name="l00258"></a>00258         <span class="keyword">const</span> <span class="keywordtype">char</span> * procat  = HAWKI_CALPRO_BASICCALIBRATED;
-<a name="l00259"></a>00259         <span class="keyword">const</span> <span class="keywordtype">char</span> * protype = HAWKI_PROTYPE_BASICCALIBRATED;
-<a name="l00260"></a>00260         cpl_msg_info(__func__, <span class="stringliteral">"Apply the basic reduction to object frames"</span>);
-<a name="l00261"></a>00261         hawki_step_basic_calib_applycal_qc_save
-<a name="l00262"></a>00262             (objframes, flat, dark, bpm, <span class="stringliteral">"obj"</span>, procat, protype,
-<a name="l00263"></a>00263              parlist, framelist);
-<a name="l00264"></a>00264         cpl_frameset_delete(objframes);
-<a name="l00265"></a>00265     }
-<a name="l00266"></a>00266     <span class="keywordflow">if</span> (skyframes != NULL)
-<a name="l00267"></a>00267     {
-<a name="l00268"></a>00268         <span class="keyword">const</span> <span class="keywordtype">char</span> * procat  = HAWKI_CALPRO_SKY_BASICCALIBRATED;
-<a name="l00269"></a>00269         <span class="keyword">const</span> <span class="keywordtype">char</span> * protype = HAWKI_PROTYPE_SKY_BASICCALIBRATED;
-<a name="l00270"></a>00270         cpl_msg_info(__func__, <span class="stringliteral">"Apply the basic reduction to sky frames"</span>);
-<a name="l00271"></a>00271         hawki_step_basic_calib_applycal_qc_save
-<a name="l00272"></a>00272             (skyframes, flat, dark, bpm, <span class="stringliteral">"sky"</span>, procat, protype,
-<a name="l00273"></a>00273              parlist, framelist);
-<a name="l00274"></a>00274         cpl_frameset_delete(skyframes);
-<a name="l00275"></a>00275     }
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* return */</span>
-<a name="l00278"></a>00278     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l00279"></a>00279     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00280"></a>00280 }
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00292"></a>00292 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00293"></a>00293 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_applycal_qc_save
-<a name="l00294"></a>00294 (cpl_frameset      *  raw_target,
-<a name="l00295"></a>00295  <span class="keyword">const</span> cpl_frame   *  flat,
-<a name="l00296"></a>00296  <span class="keyword">const</span> cpl_frame   *  dark,
-<a name="l00297"></a>00297  <span class="keyword">const</span> cpl_frame   *  bpm,
-<a name="l00298"></a>00298  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,
-<a name="l00299"></a>00299  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,
-<a name="l00300"></a>00300  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,
-<a name="l00301"></a>00301  cpl_parameterlist *  recipe_parlist,
-<a name="l00302"></a>00302  cpl_frameset      *  recipe_framelist)
-<a name="l00303"></a>00303 {
-<a name="l00304"></a>00304     cpl_imagelist    *  flat_images;
-<a name="l00305"></a>00305     cpl_imagelist    *  dark_images;
-<a name="l00306"></a>00306     cpl_imagelist    *  bpm_images;
-<a name="l00307"></a>00307     cpl_frameset     *  calib_frameset;  
-<a name="l00308"></a>00308     cpl_propertylist *  plist ;
-<a name="l00309"></a>00309     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l00310"></a>00310     
-<a name="l00311"></a>00311     <span class="keywordtype">double</span>              science_dit;
-<a name="l00312"></a>00312     <span class="keywordtype">int</span>                 iframe;
-<a name="l00313"></a>00313     <span class="keywordtype">int</span>                 ntarget;
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     <span class="comment">/* Initializing the pointers */</span>
-<a name="l00316"></a>00316     flat_images = NULL;
-<a name="l00317"></a>00317     dark_images = NULL;
-<a name="l00318"></a>00318     bpm_images  = NULL;
-<a name="l00319"></a>00319     
-<a name="l00320"></a>00320     <span class="comment">/* Indentation */</span>
-<a name="l00321"></a>00321     cpl_msg_indent_more();
-<a name="l00322"></a>00322     
-<a name="l00323"></a>00323     <span class="comment">/* Initializating the calibration frameset */</span>
-<a name="l00324"></a>00324     calib_frameset = cpl_frameset_new();
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326     <span class="comment">/* Loading the calibration files */</span>
-<a name="l00327"></a>00327     cpl_msg_info(__func__, <span class="stringliteral">"Loading the calibration data"</span>) ;
-<a name="l00328"></a>00328     <span class="keywordflow">if</span>(flat != NULL)
-<a name="l00329"></a>00329     {
-<a name="l00330"></a>00330         flat_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(flat, CPL_TYPE_FLOAT);
-<a name="l00331"></a>00331         <span class="keywordflow">if</span>(flat_images == NULL)
-<a name="l00332"></a>00332         {
-<a name="l00333"></a>00333             cpl_msg_error(__func__, <span class="stringliteral">"Error reading flat"</span>) ;
-<a name="l00334"></a>00334             cpl_frameset_delete(calib_frameset);
-<a name="l00335"></a>00335             <span class="keywordflow">return</span> -1;
-<a name="l00336"></a>00336         }
-<a name="l00337"></a>00337         cpl_frameset_insert(calib_frameset, cpl_frame_duplicate(flat));
-<a name="l00338"></a>00338     }
-<a name="l00339"></a>00339     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l00340"></a>00340     {
-<a name="l00341"></a>00341         dark_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(dark, CPL_TYPE_FLOAT);
-<a name="l00342"></a>00342         <span class="keywordflow">if</span>(dark_images == NULL)
-<a name="l00343"></a>00343         {
-<a name="l00344"></a>00344             cpl_msg_error(__func__, <span class="stringliteral">"Error reading dark"</span>) ;
-<a name="l00345"></a>00345             cpl_imagelist_delete(flat_images);
-<a name="l00346"></a>00346             cpl_frameset_delete(calib_frameset);
-<a name="l00347"></a>00347             <span class="keywordflow">return</span> -1;
-<a name="l00348"></a>00348         }
-<a name="l00349"></a>00349         cpl_frameset_insert(calib_frameset, cpl_frame_duplicate(dark));
-<a name="l00350"></a>00350     }
-<a name="l00351"></a>00351     <span class="keywordflow">if</span>(bpm != NULL)
-<a name="l00352"></a>00352     {
-<a name="l00353"></a>00353         bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm, CPL_TYPE_INT);
-<a name="l00354"></a>00354         <span class="keywordflow">if</span>(bpm_images == NULL)
-<a name="l00355"></a>00355         {
-<a name="l00356"></a>00356             cpl_msg_error(__func__, <span class="stringliteral">"Error reading bpm"</span>) ;
-<a name="l00357"></a>00357             cpl_imagelist_delete(flat_images);
-<a name="l00358"></a>00358             cpl_imagelist_delete(dark_images);
-<a name="l00359"></a>00359             cpl_frameset_delete(calib_frameset);
-<a name="l00360"></a>00360             <span class="keywordflow">return</span> -1;
-<a name="l00361"></a>00361         }
-<a name="l00362"></a>00362         cpl_frameset_insert(calib_frameset, cpl_frame_duplicate(bpm));
-<a name="l00363"></a>00363     }
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365     <span class="comment">/* Multiply the dark image by the science exposure time */</span>
-<a name="l00366"></a>00366     <span class="keywordflow">if</span>(dark != NULL)
-<a name="l00367"></a>00367     {
-<a name="l00368"></a>00368         <span class="keywordflow">if</span> ((plist=cpl_propertylist_load
-<a name="l00369"></a>00369                 (cpl_frame_get_filename
-<a name="l00370"></a>00370                  (cpl_frameset_get_first_const(raw_target)), 0)) == NULL) 
-<a name="l00371"></a>00371         {
-<a name="l00372"></a>00372             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);
-<a name="l00373"></a>00373             cpl_imagelist_delete(flat_images);
-<a name="l00374"></a>00374             cpl_imagelist_delete(dark_images);
-<a name="l00375"></a>00375             cpl_frameset_delete(calib_frameset);
-<a name="l00376"></a>00376             <span class="keywordflow">return</span> -1 ;
-<a name="l00377"></a>00377         }
-<a name="l00378"></a>00378         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);
-<a name="l00379"></a>00379         cpl_imagelist_multiply_scalar(dark_images, science_dit);
-<a name="l00380"></a>00380         cpl_propertylist_delete(plist);
-<a name="l00381"></a>00381     }
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="comment">/* Loop on the number of frames */</span>
-<a name="l00384"></a>00384     ntarget = cpl_frameset_get_size(raw_target);
-<a name="l00385"></a>00385     cpl_msg_info(__func__, <span class="stringliteral">"Looping the science frames: %d frames"</span>, ntarget);
-<a name="l00386"></a>00386     <span class="keywordflow">for</span>( iframe = 0 ; iframe < ntarget ; ++iframe)
-<a name="l00387"></a>00387     {
-<a name="l00388"></a>00388         <span class="comment">/* Local storage variables */</span>
-<a name="l00389"></a>00389         cpl_frame     * target_frame;
-<a name="l00390"></a>00390         cpl_imagelist * target_images;
-<a name="l00391"></a>00391         cpl_frameset  * used_frameset;
-<a name="l00392"></a>00392         target_images = NULL;
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394         <span class="comment">/* Loading the target */</span>
-<a name="l00395"></a>00395         cpl_msg_indent_more();
-<a name="l00396"></a>00396         cpl_msg_info(__func__, <span class="stringliteral">"Loading frame %d"</span>, iframe+1) ;
-<a name="l00397"></a>00397         target_frame = cpl_frameset_get_frame(raw_target, iframe);
-<a name="l00398"></a>00398         <span class="keywordflow">if</span>(target_frame != NULL)
-<a name="l00399"></a>00399             target_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(target_frame, CPL_TYPE_FLOAT);
-<a name="l00400"></a>00400         <span class="keywordflow">if</span>(target_images == NULL)
-<a name="l00401"></a>00401         {
-<a name="l00402"></a>00402             cpl_msg_error(__func__, <span class="stringliteral">"Error reading frame"</span>) ;
-<a name="l00403"></a>00403             cpl_imagelist_delete(flat_images);
-<a name="l00404"></a>00404             cpl_imagelist_delete(dark_images);
-<a name="l00405"></a>00405             cpl_imagelist_delete(bpm_images);
-<a name="l00406"></a>00406             <span class="keywordflow">return</span> -1;
-<a name="l00407"></a>00407         }
-<a name="l00408"></a>00408         <span class="comment">/* Creating the used frameset */</span>
-<a name="l00409"></a>00409         used_frameset = cpl_frameset_duplicate(calib_frameset);
-<a name="l00410"></a>00410         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(target_frame));
-<a name="l00411"></a>00411     
-<a name="l00412"></a>00412         <span class="comment">/* TODO: Creating the variance array */</span>
-<a name="l00413"></a>00413         <span class="comment">/* cpl_create_variance_image(); */</span>
-<a name="l00414"></a>00414         
-<a name="l00415"></a>00415         <span class="comment">/* Applying the calibrations */</span>
-<a name="l00416"></a>00416         cpl_msg_info(__func__, <span class="stringliteral">"Calibrating frame"</span>) ;
-<a name="l00417"></a>00417         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a>
-<a name="l00418"></a>00418                 (target_images, flat_images, dark_images, bpm_images) == -1) 
-<a name="l00419"></a>00419         {
-<a name="l00420"></a>00420             cpl_msg_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;
-<a name="l00421"></a>00421             cpl_imagelist_delete(flat_images);
-<a name="l00422"></a>00422             cpl_imagelist_delete(dark_images);
-<a name="l00423"></a>00423             cpl_imagelist_delete(bpm_images);
-<a name="l00424"></a>00424             cpl_imagelist_delete(target_images);
-<a name="l00425"></a>00425             cpl_frameset_delete(used_frameset);            
-<a name="l00426"></a>00426             cpl_frameset_delete(calib_frameset);
-<a name="l00427"></a>00427             cpl_msg_indent_less() ;
-<a name="l00428"></a>00428             cpl_msg_indent_less() ;
-<a name="l00429"></a>00429             <span class="keywordflow">return</span> -1 ;
-<a name="l00430"></a>00430         }
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432         <span class="comment">/* Compute quality control */</span>
-<a name="l00433"></a>00433         hawki_step_basic_calib_qc();
-<a name="l00434"></a>00434         
-<a name="l00435"></a>00435         <span class="comment">/* Save the products */</span>
-<a name="l00436"></a>00436         cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00437"></a>00437         <span class="keywordflow">if</span> (hawki_step_basic_calib_save
-<a name="l00438"></a>00438                 (target_images, filename_postfix, procat, protype, iframe,
-<a name="l00439"></a>00439                  used_frameset, recipe_parlist, 
-<a name="l00440"></a>00440                  recipe_framelist) == -1)
-<a name="l00441"></a>00441         {
-<a name="l00442"></a>00442             cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the products"</span>) ;
-<a name="l00443"></a>00443             cpl_imagelist_delete(flat_images);
-<a name="l00444"></a>00444             cpl_imagelist_delete(dark_images);
-<a name="l00445"></a>00445             cpl_imagelist_delete(bpm_images);
-<a name="l00446"></a>00446             cpl_imagelist_delete(target_images);
-<a name="l00447"></a>00447             cpl_frameset_delete(used_frameset);
-<a name="l00448"></a>00448             cpl_frameset_delete(calib_frameset);
-<a name="l00449"></a>00449             cpl_msg_indent_less() ;
-<a name="l00450"></a>00450             cpl_msg_indent_less() ;
-<a name="l00451"></a>00451             <span class="keywordflow">return</span> -1 ;
-<a name="l00452"></a>00452         }
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454         <span class="comment">/* Delete the target and the used frameset */</span>
-<a name="l00455"></a>00455         cpl_imagelist_delete(target_images);
-<a name="l00456"></a>00456         cpl_frameset_delete(used_frameset);
-<a name="l00457"></a>00457         cpl_msg_indent_less();
-<a name="l00458"></a>00458     }
-<a name="l00459"></a>00459     
-<a name="l00460"></a>00460     cpl_msg_indent_less();
-<a name="l00461"></a>00461     <span class="comment">/* Delete the calibration files */</span>
-<a name="l00462"></a>00462     cpl_imagelist_delete(flat_images);
-<a name="l00463"></a>00463     cpl_imagelist_delete(dark_images);
-<a name="l00464"></a>00464     cpl_imagelist_delete(bpm_images);
-<a name="l00465"></a>00465     cpl_frameset_delete(calib_frameset);
-<a name="l00466"></a>00466     
-<a name="l00467"></a>00467     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00468"></a>00468     {
-<a name="l00469"></a>00469         cpl_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span>
-<a name="l00470"></a>00470                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00471"></a>00471         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00472"></a>00472         <span class="keywordflow">return</span> 1;
-<a name="l00473"></a>00473     }
-<a name="l00474"></a>00474     <span class="keywordflow">return</span> 0;
-<a name="l00475"></a>00475 }
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00484"></a>00484 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00485"></a>00485 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_basic_calib_qc(<span class="keywordtype">void</span>)
-<a name="l00486"></a>00486 {
-<a name="l00487"></a>00487     <span class="comment">/* Compute QC parameters from the combined image */</span>
-<a name="l00488"></a>00488     <span class="comment">//cpl_msg_info(__func__, "Compute QC parameters from the reduced images") ;</span>
-<a name="l00489"></a>00489 }
-<a name="l00490"></a>00490         
-<a name="l00491"></a>00491 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00501"></a>00501 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00502"></a>00502 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_save
-<a name="l00503"></a>00503 (cpl_imagelist     *  reduced,
-<a name="l00504"></a>00504  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,
-<a name="l00505"></a>00505  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,
-<a name="l00506"></a>00506  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,
-<a name="l00507"></a>00507  <span class="keywordtype">int</span>                  iserie,
-<a name="l00508"></a>00508  cpl_frameset      *  used_frameset,
-<a name="l00509"></a>00509  cpl_parameterlist *  recipe_parlist,
-<a name="l00510"></a>00510  cpl_frameset      *  recipe_framelist)
-<a name="l00511"></a>00511 {
-<a name="l00512"></a>00512     <span class="keyword">const</span> cpl_frame     *   raw_reference;
-<a name="l00513"></a>00513     cpl_propertylist    *   proplist;
-<a name="l00514"></a>00514     cpl_propertylist    **  extproplists;
-<a name="l00515"></a>00515     <span class="keywordtype">char</span>                    filename[256];
-<a name="l00516"></a>00516     cpl_propertylist    *   inputlist ;
-<a name="l00517"></a>00517     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00518"></a>00518     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_basic_calib"</span>;
-<a name="l00519"></a>00519     <span class="keywordtype">int</span> i;
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521     <span class="comment">/* Get the reference frame (the raw frame) */</span>
-<a name="l00522"></a>00522     raw_reference = irplib_frameset_get_first_from_group
-<a name="l00523"></a>00523         (used_frameset, CPL_FRAME_GROUP_RAW);
-<a name="l00524"></a>00524     
-<a name="l00525"></a>00525     <span class="comment">/* Create the prop lists */</span>
-<a name="l00526"></a>00526     cpl_msg_indent_more();
-<a name="l00527"></a>00527     proplist  = cpl_propertylist_new();
-<a name="l00528"></a>00528     inputlist = cpl_propertylist_load_regexp(
-<a name="l00529"></a>00529                     cpl_frame_get_filename(raw_reference), 0,
-<a name="l00530"></a>00530                                            HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00531"></a>00531     cpl_propertylist_append(proplist, inputlist);
-<a name="l00532"></a>00532     cpl_propertylist_delete(inputlist);
-<a name="l00533"></a>00533     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l00534"></a>00534     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00535"></a>00535     {
-<a name="l00536"></a>00536         <span class="comment">/* Get the extension number */</span>
-<a name="l00537"></a>00537         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00538"></a>00538             (cpl_frame_get_filename(raw_reference), i+1);
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540         <span class="comment">/* Allocate this pro perty list */</span>
-<a name="l00541"></a>00541         extproplists[i] = cpl_propertylist_new();
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00544"></a>00544         inputlist = cpl_propertylist_load_regexp(
-<a name="l00545"></a>00545                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00546"></a>00546                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00547"></a>00547         cpl_propertylist_append(extproplists[i], inputlist);
-<a name="l00548"></a>00548         cpl_propertylist_delete(inputlist);
-<a name="l00549"></a>00549         inputlist = cpl_propertylist_load_regexp(
-<a name="l00550"></a>00550                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00551"></a>00551                 HAWKI_HEADER_WCS, 0);
-<a name="l00552"></a>00552         cpl_propertylist_append(extproplists[i], inputlist);
-<a name="l00553"></a>00553         cpl_propertylist_delete(inputlist);
-<a name="l00554"></a>00554     }
-<a name="l00555"></a>00555     
-<a name="l00556"></a>00556     <span class="comment">/* Write the image */</span>
-<a name="l00557"></a>00557     snprintf(filename, 256, <span class="stringliteral">"hawki_step_basic_calib_%s%03d.fits"</span>,
-<a name="l00558"></a>00558              filename_postfix, iserie+1);
-<a name="l00559"></a>00559     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(recipe_framelist,
-<a name="l00560"></a>00560                          recipe_parlist,
-<a name="l00561"></a>00561                          used_frameset,
-<a name="l00562"></a>00562                          reduced,
-<a name="l00563"></a>00563                          recipe_name,
-<a name="l00564"></a>00564                          procat, 
-<a name="l00565"></a>00565                          protype, 
-<a name="l00566"></a>00566                          (<span class="keyword">const</span> cpl_propertylist*)proplist,
-<a name="l00567"></a>00567                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,
-<a name="l00568"></a>00568                          filename);
-<a name="l00569"></a>00569 
-<a name="l00570"></a>00570     <span class="comment">/* Free and return */</span>
-<a name="l00571"></a>00571     cpl_msg_indent_less();
-<a name="l00572"></a>00572     cpl_propertylist_delete(proplist) ;
-<a name="l00573"></a>00573     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) 
-<a name="l00574"></a>00574     {
-<a name="l00575"></a>00575         cpl_propertylist_delete(extproplists[i]) ;
-<a name="l00576"></a>00576     }
-<a name="l00577"></a>00577     cpl_free(extproplists) ;
-<a name="l00578"></a>00578     <span class="keywordflow">return</span>  0;
-<a name="l00579"></a>00579 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_basic_calib.c,v 1.13 2011/01/31 11:03:23 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/01/31 11:03:23 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_dfs.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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">                                Define</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> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></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="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib(cpl_parameterlist *, cpl_frameset *) ;</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="keywordtype">int</span> hawki_step_basic_calib_applycal_qc_save</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> (cpl_frameset      *  raw_target,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  <span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="keyword">const</span> cpl_frame   *  bpm,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  cpl_frameset      *  recipe_framelist);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_basic_calib_qc(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_save</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> (cpl_imagelist     *  reduced,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keywordtype">int</span>                  iserie,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_frameset      *  recipe_framelist);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment">                            Static variables</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">   89</span> <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_basic_calib_description[] =</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"hawki_step_basic_calib -- hawki basic reduction utility (flat, dark).\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_IMG_JITTER_SKY_RAW<span class="stringliteral">" \n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"flat-file.fits "</span>HAWKI_CALPRO_FLAT<span class="stringliteral">" \n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"dark-file.fits "</span>HAWKI_CALPRO_DARK<span class="stringliteral">" \n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" \n"</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</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">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     cpl_plugin  *   plugin = &recipe->interface ;</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>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     <span class="stringliteral">"hawki_step_basic_calib"</span>,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     <span class="stringliteral">"Basic reduction recipe"</span>,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     hawki_step_basic_calib_description,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     <span class="stringliteral">"cgarcia at eso.org"</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     hawki_step_basic_calib_create,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     hawki_step_basic_calib_exec,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     hawki_step_basic_calib_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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_create(cpl_plugin * plugin)</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>     cpl_recipe      * recipe ;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="comment">/* cpl_parameter   * p ; */</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     recipe->parameters = cpl_parameterlist_new() ;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="comment">/* None.. */</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="comment">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_exec(cpl_plugin * 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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordflow">else</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_basic_calib(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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib(</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         cpl_frameset        *   framelist)</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="keyword">const</span> cpl_frame  * flat;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keyword">const</span> cpl_frame  * dark;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="keyword">const</span> cpl_frame  * bpm;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_frameset     * objframes ;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_frameset     * skyframes ;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve calibration data */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying calibration data"</span>);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     flat   = cpl_frameset_find_const(framelist, HAWKI_CALPRO_FLAT);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     dark   = cpl_frameset_find_const(framelist, HAWKI_CALPRO_DARK);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     bpm    = cpl_frameset_find_const(framelist, HAWKI_CALPRO_BPM);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">if</span> (flat == NULL && dark == NULL && bpm == 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>         cpl_msg_error(__func__, <span class="stringliteral">"No calibration data provided (%s and/or %s and/or %s)"</span>,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                 HAWKI_CALPRO_FLAT, HAWKI_CALPRO_DARK, HAWKI_CALPRO_BPM);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects and sky data"</span>);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="comment">/* Retrieve sky frames */</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     skyframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_SKY_RAW) ;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordflow">if</span> (objframes == NULL && skyframes == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find objs (%s) or sky frames (%s) in the input list"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                 HAWKI_IMG_JITTER_RAW, HAWKI_IMG_JITTER_SKY_RAW);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Applying the calibrations, QC and saving the results */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keywordflow">if</span> (objframes != NULL)</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="keyword">const</span> <span class="keywordtype">char</span> * procat  = HAWKI_CALPRO_BASICCALIBRATED;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> * protype = HAWKI_PROTYPE_BASICCALIBRATED;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         cpl_msg_info(__func__, <span class="stringliteral">"Apply the basic reduction to object frames"</span>);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         hawki_step_basic_calib_applycal_qc_save</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>             (objframes, flat, dark, bpm, <span class="stringliteral">"obj"</span>, procat, protype,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>              parlist, framelist);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>         cpl_frameset_delete(objframes);</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> (skyframes != 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>         <span class="keyword">const</span> <span class="keywordtype">char</span> * procat  = HAWKI_CALPRO_SKY_BASICCALIBRATED;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> * protype = HAWKI_PROTYPE_SKY_BASICCALIBRATED;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         cpl_msg_info(__func__, <span class="stringliteral">"Apply the basic reduction to sky frames"</span>);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         hawki_step_basic_calib_applycal_qc_save</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             (skyframes, flat, dark, bpm, <span class="stringliteral">"sky"</span>, procat, protype,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>              parlist, framelist);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         cpl_frameset_delete(skyframes);</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="comment">/* return */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;</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> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_applycal_qc_save</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> (cpl_frameset      *  raw_target,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>  <span class="keyword">const</span> cpl_frame   *  flat,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>  <span class="keyword">const</span> cpl_frame   *  dark,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>  <span class="keyword">const</span> cpl_frame   *  bpm,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>  cpl_frameset      *  recipe_framelist)</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_imagelist    *  flat_images;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_imagelist    *  dark_images;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_imagelist    *  bpm_images;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_frameset     *  calib_frameset;  </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_propertylist *  plist ;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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>              science_dit;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keywordtype">int</span>                 iframe;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">int</span>                 ntarget;</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">/* Initializing the pointers */</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     flat_images = NULL;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     dark_images = NULL;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     bpm_images  = 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>     <span class="comment">/* Indentation */</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_msg_indent_more();</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="comment">/* Initializating the calibration frameset */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     calib_frameset = cpl_frameset_new();</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">/* Loading the calibration files */</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_msg_info(__func__, <span class="stringliteral">"Loading the calibration data"</span>) ;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordflow">if</span>(flat != 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>         flat_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(flat, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>         <span class="keywordflow">if</span>(flat_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading flat"</span>) ;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>             cpl_frameset_delete(calib_frameset);</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>         cpl_frameset_insert(calib_frameset, cpl_frame_duplicate(flat));</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>(dark != 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>         dark_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(dark, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         <span class="keywordflow">if</span>(dark_images == NULL)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading dark"</span>) ;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>             cpl_frameset_delete(calib_frameset);</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_frameset_insert(calib_frameset, cpl_frame_duplicate(dark));</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>(bpm != NULL)</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>         bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bpm, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         <span class="keywordflow">if</span>(bpm_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading bpm"</span>) ;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>             cpl_frameset_delete(calib_frameset);</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_frameset_insert(calib_frameset, cpl_frame_duplicate(bpm));</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> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="comment">/* Multiply the dark image by the science exposure time */</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">if</span>(dark != 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>         <span class="keywordflow">if</span> ((plist=cpl_propertylist_load</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                 (cpl_frame_get_filename</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                  (cpl_frameset_get_first_const(raw_target)), 0)) == 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_msg_error(__func__, <span class="stringliteral">"Cannot get header from frame"</span>);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>             cpl_frameset_delete(calib_frameset);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>             <span class="keywordflow">return</span> -1 ;</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>         science_dit = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         cpl_imagelist_multiply_scalar(dark_images, science_dit);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         cpl_propertylist_delete(plist);</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">/* Loop on the number of frames */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     ntarget = cpl_frameset_get_size(raw_target);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_msg_info(__func__, <span class="stringliteral">"Looping the science frames: %d frames"</span>, ntarget);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">for</span>( iframe = 0 ; iframe < ntarget ; ++iframe)</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">/* Local storage variables */</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         cpl_frame     * target_frame;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         cpl_imagelist * target_images;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>         cpl_frameset  * used_frameset;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>         target_images = 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>         <span class="comment">/* Loading the target */</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         cpl_msg_info(__func__, <span class="stringliteral">"Loading frame %d"</span>, iframe+1) ;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         target_frame = cpl_frameset_get_frame(raw_target, iframe);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         <span class="keywordflow">if</span>(target_frame != NULL)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>             target_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(target_frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         <span class="keywordflow">if</span>(target_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading frame"</span>) ;</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>             <span class="keywordflow">return</span> -1;</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">/* Creating the used frameset */</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         used_frameset = cpl_frameset_duplicate(calib_frameset);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(target_frame));</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">/* TODO: Creating the variance array */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         <span class="comment">/* cpl_create_variance_image(); */</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">/* Applying the calibrations */</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         cpl_msg_info(__func__, <span class="stringliteral">"Calibrating frame"</span>) ;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         <span class="keywordflow">if</span> (<a class="code" href="group__hawki__calib.html#gaa722d4147127c2af3088266c63d79489" title="Apply the calibration to the images.">hawki_flat_dark_bpm_imglist_calib</a></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                 (target_images, flat_images, dark_images, bpm_images) == -1) </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_error(__func__, <span class="stringliteral">"Cannot calibrate frame"</span>) ;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             cpl_imagelist_delete(target_images);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>             cpl_frameset_delete(used_frameset);            </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>             cpl_frameset_delete(calib_frameset);</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>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             <span class="keywordflow">return</span> -1 ;</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">/* Compute quality control */</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         hawki_step_basic_calib_qc();</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">/* Save the products */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         <span class="keywordflow">if</span> (hawki_step_basic_calib_save</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                 (target_images, filename_postfix, procat, protype, iframe,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                  used_frameset, recipe_parlist, </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                  recipe_framelist) == -1)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the products"</span>) ;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>             cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>             cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>             cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>             cpl_imagelist_delete(target_images);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>             cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>             cpl_frameset_delete(calib_frameset);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>             <span class="keywordflow">return</span> -1 ;</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="comment">/* Delete the target and the used frameset */</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>         cpl_imagelist_delete(target_images);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         cpl_msg_indent_less();</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>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="comment">/* Delete the calibration files */</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     cpl_imagelist_delete(flat_images);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     cpl_imagelist_delete(dark_images);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     cpl_imagelist_delete(bpm_images);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     cpl_frameset_delete(calib_frameset);</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_errorstate_is_equal(error_prevstate))</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_msg_warning(__func__,<span class="stringliteral">"Probably some data could not be saved. "</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                  <span class="stringliteral">"Check permisions or disk space"</span>);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         <span class="keywordflow">return</span> 1;</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">return</span> 0;</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> </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</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="keyword">static</span> <span class="keywordtype">void</span> hawki_step_basic_calib_qc(<span class="keywordtype">void</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="comment">/* Compute QC parameters from the combined image */</span></div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="comment">//cpl_msg_info(__func__, "Compute QC parameters from the reduced images") ;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_basic_calib_save</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> (cpl_imagelist     *  reduced,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  filename_postfix,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  procat,</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype,</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>  <span class="keywordtype">int</span>                  iserie,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>  cpl_frameset      *  recipe_framelist)</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> cpl_frame     *   raw_reference;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     cpl_propertylist    *   proplist;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     cpl_propertylist    **  extproplists;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <span class="keywordtype">char</span>                    filename[256];</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_basic_calib"</span>;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keywordtype">int</span> i;</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">/* Get the reference frame (the raw frame) */</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     raw_reference = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         (used_frameset, CPL_FRAME_GROUP_RAW);</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="comment">/* Create the prop lists */</span></div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     proplist  = cpl_propertylist_new();</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                     cpl_frame_get_filename(raw_reference), 0,</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                                            HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     cpl_propertylist_append(proplist, inputlist);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_propertylist_delete(inputlist);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)</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="comment">/* Get the extension number */</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             (cpl_frame_get_filename(raw_reference), i+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="comment">/* Allocate this pro perty list */</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         extproplists[i] = cpl_propertylist_new();</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="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_propertylist_append(extproplists[i], inputlist);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         cpl_propertylist_delete(inputlist);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>                 HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         cpl_propertylist_append(extproplists[i], inputlist);</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         cpl_propertylist_delete(inputlist);</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="comment">/* Write the image */</span></div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     snprintf(filename, 256, <span class="stringliteral">"hawki_step_basic_calib_%s%03d.fits"</span>,</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>              filename_postfix, iserie+1);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(recipe_framelist,</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                          recipe_parlist,</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                          used_frameset,</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                          reduced,</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                          recipe_name,</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                          procat, </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                          protype, </div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                          (<span class="keyword">const</span> cpl_propertylist*)proplist,</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                          filename);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     cpl_propertylist_delete(proplist) ;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) </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_propertylist_delete(extproplists[i]) ;</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>     cpl_free(extproplists) ;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keywordflow">return</span>  0;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</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/hawki__step__combine_8c_source.html b/html/hawki__step__combine_8c_source.html
index 02ccbdd..6abb4d6 100644
--- a/html/hawki__step__combine_8c_source.html
+++ b/html/hawki__step__combine_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_combine.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,986 +40,996 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_combine.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_combine.c,v 1.25 2012/11/30 14:50: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/30 14:50:51 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.25 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_calib.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_saa.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_bkg.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "hawki_properties_tel.h"</span>
-<a name="l00053"></a>00053 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00056"></a>00056 <span class="comment">                            Functions prototypes</span>
-<a name="l00057"></a>00057 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00061"></a>00061 <span class="preprocessor">#endif</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_create(cpl_plugin *) ;
-<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_exec(cpl_plugin *) ;
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_destroy(cpl_plugin *) ;
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_retrieve_input_param
-<a name="l00070"></a>00070 (cpl_parameterlist  *  parlist);
-<a name="l00071"></a>00071 <span class="keyword">static</span> cpl_image ** hawki_step_combine_apply_comb
-<a name="l00072"></a>00072 (cpl_frameset    * obj,
-<a name="l00073"></a>00073  cpl_frameset    * offsets,
-<a name="l00074"></a>00074  cpl_frameset    * bpm,
-<a name="l00075"></a>00075  cpl_frameset    * bkg_bpm_frames);
-<a name="l00076"></a>00076 <span class="keyword">static</span> cpl_image **  hawki_step_combine_chip
-<a name="l00077"></a>00077 (cpl_imagelist   * in,
-<a name="l00078"></a>00078  cpl_bivector    * offsets,
-<a name="l00079"></a>00079  <span class="keywordtype">double</span>          * pos_x,
-<a name="l00080"></a>00080  <span class="keywordtype">double</span>          * pos_y);
-<a name="l00081"></a>00081 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_interpolate_badpix
-<a name="l00082"></a>00082 (cpl_image           *  image);
-<a name="l00083"></a>00083 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_save
-<a name="l00084"></a>00084 (cpl_image           ** combined,
-<a name="l00085"></a>00085  cpl_image           ** contrib_map,
-<a name="l00086"></a>00086  cpl_frameset        *  used_frames,
-<a name="l00087"></a>00087  cpl_parameterlist   *  parlist,
-<a name="l00088"></a>00088  cpl_frameset        *  recipe_frameset);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00091"></a>00091 <span class="comment">                            Static variables</span>
-<a name="l00092"></a>00092 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00095"></a>00095 {
-<a name="l00096"></a>00096     <span class="comment">/* Inputs */</span>
-<a name="l00097"></a>00097     <span class="keywordtype">int</span>                 offset_max ;
-<a name="l00098"></a>00098     <span class="keywordtype">int</span>                 borders ;
-<a name="l00099"></a>00099     cpl_geom_combine    comb_meth ;
-<a name="l00100"></a>00100     <span class="keywordtype">int</span>                 rej_low;
-<a name="l00101"></a>00101     <span class="keywordtype">int</span>                 rej_high;
-<a name="l00102"></a>00102     cpl_kernel          resamp_kernel;
-<a name="l00103"></a>00103 } hawki_step_combine_config;
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00106"></a>00106 {
-<a name="l00107"></a>00107     <span class="comment">/* Outputs */</span>
-<a name="l00108"></a>00108     <span class="keywordtype">double</span>  mean_airmass;
-<a name="l00109"></a>00109     <span class="keywordtype">double</span>  combined_pos_x[HAWKI_NB_DETECTORS];
-<a name="l00110"></a>00110     <span class="keywordtype">double</span>  combined_pos_y[HAWKI_NB_DETECTORS];
-<a name="l00111"></a>00111     <span class="keywordtype">double</span>  combined_cumoffset_x[HAWKI_NB_DETECTORS];
-<a name="l00112"></a>00112     <span class="keywordtype">double</span>  combined_cumoffset_y[HAWKI_NB_DETECTORS];
-<a name="l00113"></a>00113 } hawki_step_combine_output;
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_combine_description[] =
-<a name="l00116"></a>00116 <span class="stringliteral">"hawki_step_combine -- hawki combine jitter images.\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00118"></a>00118 <span class="stringliteral">"science-file.fits "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">" or\n"</span>
-<a name="l00119"></a>00119 <span class="stringliteral">"science-file.fits "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">" or\n"</span>
-<a name="l00120"></a>00120 <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" (optional) \n"</span>
-<a name="l00121"></a>00121 <span class="stringliteral">"bkg_bpm-file.fits "</span>HAWKI_CALPRO_BKGBPM<span class="stringliteral">" (optional) \n"</span>
-<a name="l00122"></a>00122 <span class="stringliteral">"offsets-file.fits "</span>HAWKI_CALPRO_OFFSETS<span class="stringliteral">" (optional) \n"</span>
-<a name="l00123"></a>00123 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00124"></a>00124 <span class="stringliteral">"hawki_step_combine.fits ("</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"): \n"</span>
-<a name="l00125"></a>00125 <span class="stringliteral">"The recipe does the following steps:\n"</span>
-<a name="l00126"></a>00126 <span class="stringliteral">"-Allocate an image with the proper combined size \n"</span>
-<a name="l00127"></a>00127 <span class="stringliteral">"   (depends on parameters --comb_meth and --borders)\n"</span>
-<a name="l00128"></a>00128 <span class="stringliteral">"-Retrieve the offsets either from the offsets-file.fits or from the header\n"</span>
-<a name="l00129"></a>00129 <span class="stringliteral">"-For each combined pixel, the contribution of each individual frame \n"</span>
-<a name="l00130"></a>00130 <span class="stringliteral">"   is added using a resampling kernel. If any of the pixels involved in\n"</span>
-<a name="l00131"></a>00131 <span class="stringliteral">"   the resampling is a bad pixel (defined in bpm-file.fits), it is not\n"</span>
-<a name="l00132"></a>00132 <span class="stringliteral">"   taken into account.\n"</span>
-<a name="l00133"></a>00133 <span class="stringliteral">"   With the remaining pixels a minmax rejection is performed\n"</span>
-<a name="l00134"></a>00134 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00135"></a>00135 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00136"></a>00136 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00139"></a>00139 <span class="comment">                                Functions code</span>
-<a name="l00140"></a>00140 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00150"></a>00150 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00151"></a>00151 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00152"></a>00152 {
-<a name="l00153"></a>00153     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00154"></a>00154     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     cpl_plugin_init(plugin,
-<a name="l00157"></a>00157                     CPL_PLUGIN_API,
-<a name="l00158"></a>00158                     HAWKI_BINARY_VERSION,
-<a name="l00159"></a>00159                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00160"></a>00160                     <span class="stringliteral">"hawki_step_combine"</span>,
-<a name="l00161"></a>00161                     <span class="stringliteral">"Jitter image combination recipe"</span>,
-<a name="l00162"></a>00162                     hawki_step_combine_description,
-<a name="l00163"></a>00163                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00164"></a>00164                     PACKAGE_BUGREPORT,  
-<a name="l00165"></a>00165                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00166"></a>00166                     hawki_step_combine_create,
-<a name="l00167"></a>00167                     hawki_step_combine_exec,
-<a name="l00168"></a>00168                     hawki_step_combine_destroy) ;
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     cpl_pluginlist_append(list, plugin) ;
-<a name="l00171"></a>00171     
-<a name="l00172"></a>00172     <span class="keywordflow">return</span> 0;
-<a name="l00173"></a>00173 }
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00184"></a>00184 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00185"></a>00185 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_create(cpl_plugin * plugin)
-<a name="l00186"></a>00186 {
-<a name="l00187"></a>00187     cpl_recipe      * recipe ;
-<a name="l00188"></a>00188     cpl_parameter   * p ;
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00191"></a>00191     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00192"></a>00192         recipe = (cpl_recipe *)plugin ;
-<a name="l00193"></a>00193     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00196"></a>00196     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00197"></a>00197     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00198"></a>00198         <span class="keywordflow">return</span> 1;
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00201"></a>00201     <span class="comment">/* --offset_max */</span>
-<a name="l00202"></a>00202     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.offset_max"</span>,
-<a name="l00203"></a>00203                                 CPL_TYPE_INT,
-<a name="l00204"></a>00204                                 <span class="stringliteral">"Maximum offset allowed"</span>,
-<a name="l00205"></a>00205                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,
-<a name="l00206"></a>00206                                 1500) ;
-<a name="l00207"></a>00207     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"offset_max"</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">/* --comb_meth */</span>
-<a name="l00212"></a>00212     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.comb_meth"</span>,
-<a name="l00213"></a>00213                                 CPL_TYPE_STRING,
-<a name="l00214"></a>00214                                 <span class="stringliteral">"Final size of combination (union / inter / first)"</span>,
-<a name="l00215"></a>00215                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,
-<a name="l00216"></a>00216                                 <span class="stringliteral">"union"</span>) ;
-<a name="l00217"></a>00217     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"comb_meth"</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">/* --rej */</span>
-<a name="l00222"></a>00222     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.rej"</span>,
-<a name="l00223"></a>00223                                 CPL_TYPE_STRING,
-<a name="l00224"></a>00224                                 <span class="stringliteral">"Low and high number of rejected values"</span>,
-<a name="l00225"></a>00225                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,
-<a name="l00226"></a>00226                                 <span class="stringliteral">"1,1"</span>) ;
-<a name="l00227"></a>00227     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"rej"</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">/* --borders */</span>
-<a name="l00232"></a>00232     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.borders"</span>,
-<a name="l00233"></a>00233                                 CPL_TYPE_INT,
-<a name="l00234"></a>00234                                 <span class="stringliteral">"Border pixels trimmed"</span>,
-<a name="l00235"></a>00235                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,
-<a name="l00236"></a>00236                                 4) ;
-<a name="l00237"></a>00237     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"borders"</span>) ;
-<a name="l00238"></a>00238     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00239"></a>00239     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="comment">/* --resamp_kernel */</span>
-<a name="l00242"></a>00242     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.resamp_kernel"</span>,
-<a name="l00243"></a>00243                                 CPL_TYPE_STRING,
-<a name="l00244"></a>00244                                 <span class="stringliteral">"Resampling kernel (default/tanh/sinc/sinc2/lanczos/hamming/hann)"</span>,
-<a name="l00245"></a>00245                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"default"</span>) ;
-<a name="l00247"></a>00247     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"resamp_kernel"</span>) ;
-<a name="l00248"></a>00248     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00249"></a>00249     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     <span class="comment">/* Return */</span>
-<a name="l00252"></a>00252     <span class="keywordflow">return</span> 0;
-<a name="l00253"></a>00253 }
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00261"></a>00261 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00262"></a>00262 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_exec(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="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00267"></a>00267     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00268"></a>00268         recipe = (cpl_recipe *)plugin ;
-<a name="l00269"></a>00269     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     <span class="comment">/* Issue a banner */</span>
-<a name="l00272"></a>00272     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274     <span class="keywordflow">return</span> hawki_step_combine(recipe->parameters, recipe->frames) ;
-<a name="l00275"></a>00275 }
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00283"></a>00283 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00284"></a>00284 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_destroy(cpl_plugin * plugin)
-<a name="l00285"></a>00285 {
-<a name="l00286"></a>00286     cpl_recipe  *   recipe ;
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00289"></a>00289     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00290"></a>00290         recipe = (cpl_recipe *)plugin ;
-<a name="l00291"></a>00291     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00294"></a>00294     <span class="keywordflow">return</span> 0 ;
-<a name="l00295"></a>00295 }
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00304"></a>00304 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00305"></a>00305 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine(
-<a name="l00306"></a>00306         cpl_parameterlist   *   parlist, 
-<a name="l00307"></a>00307         cpl_frameset        *   framelist)
-<a name="l00308"></a>00308 {
-<a name="l00309"></a>00309     cpl_frameset    *  objframes ;
-<a name="l00310"></a>00310     cpl_frameset    *  offsets;
-<a name="l00311"></a>00311     cpl_frameset    *  bpm;
-<a name="l00312"></a>00312     cpl_frameset    *  bpmbkg;
-<a name="l00313"></a>00313     cpl_frameset    *  used_frames;
-<a name="l00314"></a>00314     cpl_image       ** combined_contrib;
-<a name="l00315"></a>00315     cpl_image       ** combined;
-<a name="l00316"></a>00316     cpl_image       ** contrib_map;
-<a name="l00317"></a>00317     <span class="keywordtype">int</span>                idet;
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00320"></a>00320     <span class="keywordflow">if</span>(hawki_step_combine_retrieve_input_param(parlist))
-<a name="l00321"></a>00321     {
-<a name="l00322"></a>00322         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00323"></a>00323         <span class="keywordflow">return</span> -1;
-<a name="l00324"></a>00324     }
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00327"></a>00327     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00328"></a>00328         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00329"></a>00329         <span class="keywordflow">return</span> -1 ;
-<a name="l00330"></a>00330     }
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00333"></a>00333     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_DIST_CORRECTED);
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (objframes == NULL) 
-<a name="l00335"></a>00335     {
-<a name="l00336"></a>00336         objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00337"></a>00337             (framelist, HAWKI_CALPRO_BKG_SUBTRACTED);
-<a name="l00338"></a>00338         <span class="keywordflow">if</span> (objframes == NULL) 
-<a name="l00339"></a>00339         {
-<a name="l00340"></a>00340             cpl_msg_error(__func__,<span class="stringliteral">"Cannot find objs frames in the input list (%s or %s)"</span>,
-<a name="l00341"></a>00341                     HAWKI_CALPRO_DIST_CORRECTED, HAWKI_CALPRO_BKG_SUBTRACTED);
-<a name="l00342"></a>00342             <span class="keywordflow">return</span> -1 ;
-<a name="l00343"></a>00343         }
-<a name="l00344"></a>00344     }
-<a name="l00345"></a>00345     used_frames = cpl_frameset_duplicate(objframes);
-<a name="l00346"></a>00346     
-<a name="l00347"></a>00347     <span class="comment">/* Retrieve the refined offsets, if provided */</span>
-<a name="l00348"></a>00348     offsets = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_OFFSETS);
-<a name="l00349"></a>00349     <span class="keywordflow">if</span>(offsets)
-<a name="l00350"></a>00350         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-<a name="l00351"></a>00351                 cpl_frameset_get_first(offsets)));
-<a name="l00352"></a>00352     
-<a name="l00353"></a>00353     <span class="comment">/* Retrieve the general bad pixel mask, if provided */</span>
-<a name="l00354"></a>00354     bpm = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BPM);
-<a name="l00355"></a>00355     <span class="keywordflow">if</span>(bpm)
-<a name="l00356"></a>00356         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-<a name="l00357"></a>00357                 cpl_frameset_get_first(bpm)));
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="comment">/* Retrieve the background bad pixel masks, if provided */</span>
-<a name="l00360"></a>00360     bpmbkg = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKGBPM);
-<a name="l00361"></a>00361     <span class="keywordflow">if</span>(bpmbkg)
-<a name="l00362"></a>00362     {
-<a name="l00363"></a>00363         <span class="keywordtype">int</span> iframe;
-<a name="l00364"></a>00364         <span class="keywordflow">for</span>(iframe=0; iframe < cpl_frameset_get_size(bpmbkg); iframe++)
-<a name="l00365"></a>00365             cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-<a name="l00366"></a>00366                     cpl_frameset_get_frame(bpmbkg,iframe)));
-<a name="l00367"></a>00367         <span class="keywordflow">if</span>(cpl_frameset_get_size(bpmbkg) != cpl_frameset_get_size(objframes))
-<a name="l00368"></a>00368         {
-<a name="l00369"></a>00369             cpl_msg_error(__func__,<span class="stringliteral">"Incompatible number of science and bad bkg"</span>
-<a name="l00370"></a>00370                                    <span class="stringliteral">" images."</span>);
-<a name="l00371"></a>00371             cpl_msg_error(__func__,<span class="stringliteral">"Supply as many bad bkg images as objects"</span>);
-<a name="l00372"></a>00372             cpl_frameset_delete(objframes);
-<a name="l00373"></a>00373             cpl_frameset_delete(used_frames);
-<a name="l00374"></a>00374             cpl_frameset_delete(offsets);
-<a name="l00375"></a>00375             cpl_frameset_delete(bpm);
-<a name="l00376"></a>00376             cpl_frameset_delete(bpmbkg);
-<a name="l00377"></a>00377             <span class="keywordflow">return</span> -1;
-<a name="l00378"></a>00378         }
-<a name="l00379"></a>00379     }
-<a name="l00380"></a>00380     
-<a name="l00381"></a>00381     <span class="comment">/* Apply the combination */</span>
-<a name="l00382"></a>00382     cpl_msg_info(__func__, <span class="stringliteral">"Apply the data recombination"</span>);
-<a name="l00383"></a>00383     cpl_msg_indent_more() ;
-<a name="l00384"></a>00384     <span class="keywordflow">if</span> ((combined_contrib = hawki_step_combine_apply_comb
-<a name="l00385"></a>00385              (objframes, offsets, bpm, bpmbkg)) == NULL)
-<a name="l00386"></a>00386     {
-<a name="l00387"></a>00387         cpl_msg_error(__func__, <span class="stringliteral">"Cannot combine the data"</span>);
-<a name="l00388"></a>00388         cpl_frameset_delete(objframes);
-<a name="l00389"></a>00389         cpl_frameset_delete(used_frames);
-<a name="l00390"></a>00390         <span class="keywordflow">if</span>(offsets != NULL)
-<a name="l00391"></a>00391             cpl_frameset_delete(offsets);
-<a name="l00392"></a>00392         <span class="keywordflow">if</span>(bpm != NULL)
-<a name="l00393"></a>00393             cpl_frameset_delete(bpm);
-<a name="l00394"></a>00394         cpl_msg_indent_less() ;
-<a name="l00395"></a>00395         <span class="keywordflow">return</span> -1 ;
-<a name="l00396"></a>00396     }
-<a name="l00397"></a>00397     
-<a name="l00398"></a>00398     <span class="comment">/* Get both the combination and the contribution map */</span>
-<a name="l00399"></a>00399     combined   = combined_contrib;
-<a name="l00400"></a>00400     contrib_map = combined_contrib + HAWKI_NB_DETECTORS;
-<a name="l00401"></a>00401     cpl_msg_indent_less() ;
-<a name="l00402"></a>00402     cpl_frameset_delete(objframes);
-<a name="l00403"></a>00403     <span class="keywordflow">if</span>(offsets != NULL)
-<a name="l00404"></a>00404         cpl_frameset_delete(offsets);
-<a name="l00405"></a>00405     <span class="keywordflow">if</span>(bpm != NULL)
-<a name="l00406"></a>00406         cpl_frameset_delete(bpm);
-<a name="l00407"></a>00407     <span class="keywordflow">if</span>(bpmbkg != NULL)
-<a name="l00408"></a>00408         cpl_frameset_delete(bpmbkg);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     <span class="comment">/* Save the products */</span>
-<a name="l00411"></a>00411     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00412"></a>00412     cpl_msg_indent_more() ;
-<a name="l00413"></a>00413     <span class="keywordflow">if</span> (hawki_step_combine_save(combined, contrib_map, 
-<a name="l00414"></a>00414                                 used_frames, parlist, framelist) != 0)
-<a name="l00415"></a>00415     {
-<a name="l00416"></a>00416         cpl_msg_warning(__func__, <span class="stringliteral">"Some error happened saving the data. "</span>
-<a name="l00417"></a>00417                         <span class="stringliteral">"Check permisions or disk space"</span>) ;
-<a name="l00418"></a>00418         <span class="keywordflow">for</span>(idet=0; idet< 2 * HAWKI_NB_DETECTORS; ++idet)
-<a name="l00419"></a>00419             cpl_image_delete(combined_contrib[idet]);
-<a name="l00420"></a>00420         cpl_frameset_delete(used_frames);
-<a name="l00421"></a>00421         cpl_free(combined_contrib);
-<a name="l00422"></a>00422         cpl_msg_indent_less() ;
-<a name="l00423"></a>00423         <span class="keywordflow">return</span> -1 ;
-<a name="l00424"></a>00424     }
-<a name="l00425"></a>00425     cpl_msg_indent_less() ;
-<a name="l00426"></a>00426     
-<a name="l00427"></a>00427     <span class="comment">/* Return */</span>
-<a name="l00428"></a>00428     <span class="keywordflow">for</span>(idet=0; idet< 2 * HAWKI_NB_DETECTORS; ++idet)
-<a name="l00429"></a>00429         cpl_image_delete(combined_contrib[idet]);
-<a name="l00430"></a>00430     cpl_free(combined_contrib);
-<a name="l00431"></a>00431     cpl_frameset_delete(used_frames);
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="comment">/* Return */</span>
-<a name="l00434"></a>00434     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00435"></a>00435     {
-<a name="l00436"></a>00436         cpl_msg_error(__func__,
-<a name="l00437"></a>00437                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00438"></a>00438         <span class="keywordflow">return</span> -1 ;
-<a name="l00439"></a>00439     }
-<a name="l00440"></a>00440     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00441"></a>00441 }
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443 <span class="keywordtype">int</span> hawki_step_combine_retrieve_input_param
-<a name="l00444"></a>00444 (cpl_parameterlist  *  parlist)
-<a name="l00445"></a>00445 {
-<a name="l00446"></a>00446     cpl_parameter   *   par ;
-<a name="l00447"></a>00447     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;
-<a name="l00448"></a>00448     par = NULL ;
-<a name="l00449"></a>00449     par = cpl_parameterlist_find(parlist,
-<a name="l00450"></a>00450             <span class="stringliteral">"hawki.hawki_step_combine.offset_max"</span>);
-<a name="l00451"></a>00451     hawki_step_combine_config.offset_max = cpl_parameter_get_int(par);
-<a name="l00452"></a>00452     par = cpl_parameterlist_find(parlist,
-<a name="l00453"></a>00453             <span class="stringliteral">"hawki.hawki_step_combine.comb_meth"</span>);
-<a name="l00454"></a>00454     sval = cpl_parameter_get_string(par);
-<a name="l00455"></a>00455     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"union"</span>))
-<a name="l00456"></a>00456         hawki_step_combine_config.comb_meth = CPL_GEOM_UNION;
-<a name="l00457"></a>00457     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"inter"</span>))
-<a name="l00458"></a>00458         hawki_step_combine_config.comb_meth = CPL_GEOM_INTERSECT;
-<a name="l00459"></a>00459     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"first"</span>))
-<a name="l00460"></a>00460         hawki_step_combine_config.comb_meth = CPL_GEOM_FIRST;
-<a name="l00461"></a>00461     <span class="keywordflow">else</span>
-<a name="l00462"></a>00462     {
-<a name="l00463"></a>00463         cpl_msg_error(__func__, <span class="stringliteral">"Invalid combine method specified"</span>);
-<a name="l00464"></a>00464         <span class="keywordflow">return</span> -1;
-<a name="l00465"></a>00465     }
-<a name="l00466"></a>00466     par = cpl_parameterlist_find(parlist,
-<a name="l00467"></a>00467             <span class="stringliteral">"hawki.hawki_step_combine.borders"</span>);
-<a name="l00468"></a>00468     hawki_step_combine_config.borders = cpl_parameter_get_int(par);
-<a name="l00469"></a>00469     <span class="keywordflow">if</span>(hawki_step_combine_config.borders < 0 )
-<a name="l00470"></a>00470     {
-<a name="l00471"></a>00471         cpl_msg_error(__func__, <span class="stringliteral">"Borders cannot be less than zero"</span>);
-<a name="l00472"></a>00472         <span class="keywordflow">return</span> -1;
-<a name="l00473"></a>00473     }
-<a name="l00474"></a>00474     par = cpl_parameterlist_find(parlist, 
-<a name="l00475"></a>00475             <span class="stringliteral">"hawki.hawki_step_combine.rej"</span>);
-<a name="l00476"></a>00476     sval = cpl_parameter_get_string(par);
-<a name="l00477"></a>00477     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d"</span>,
-<a name="l00478"></a>00478                &hawki_step_combine_config.rej_low,
-<a name="l00479"></a>00479                &hawki_step_combine_config.rej_high)!=2)
-<a name="l00480"></a>00480     {
-<a name="l00481"></a>00481         <span class="keywordflow">return</span> -1;
-<a name="l00482"></a>00482     }
-<a name="l00483"></a>00483     par = cpl_parameterlist_find(parlist, 
-<a name="l00484"></a>00484             <span class="stringliteral">"hawki.hawki_step_combine.resamp_kernel"</span>);
-<a name="l00485"></a>00485     sval = cpl_parameter_get_string(par);
-<a name="l00486"></a>00486     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"tanh"</span>))
-<a name="l00487"></a>00487         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_TANH;
-<a name="l00488"></a>00488     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"sinc"</span>))
-<a name="l00489"></a>00489         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_SINC;
-<a name="l00490"></a>00490     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"sinc2"</span>))
-<a name="l00491"></a>00491         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_SINC2;
-<a name="l00492"></a>00492     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"lanczos"</span>))
-<a name="l00493"></a>00493         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_LANCZOS;
-<a name="l00494"></a>00494     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"hamming"</span>))
-<a name="l00495"></a>00495         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_HAMMING;
-<a name="l00496"></a>00496     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"hann"</span>))
-<a name="l00497"></a>00497         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_HANN;
-<a name="l00498"></a>00498     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"default"</span>))
-<a name="l00499"></a>00499         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_DEFAULT;
-<a name="l00500"></a>00500     <span class="keywordflow">else</span>
-<a name="l00501"></a>00501     {
-<a name="l00502"></a>00502         cpl_msg_error(__func__, <span class="stringliteral">"Invalid resampling kernel specified"</span>);
-<a name="l00503"></a>00503         <span class="keywordflow">return</span> -1;
-<a name="l00504"></a>00504     }
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506     <span class="keywordflow">return</span> 0;
-<a name="l00507"></a>00507 }
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00517"></a>00517 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00518"></a>00518 <span class="keyword">static</span> cpl_image ** hawki_step_combine_apply_comb
-<a name="l00519"></a>00519 (cpl_frameset    * obj,
-<a name="l00520"></a>00520  cpl_frameset    * offsets_frames,
-<a name="l00521"></a>00521  cpl_frameset    * bpm_frame,
-<a name="l00522"></a>00522  cpl_frameset    * bkg_bpm_frames)
-<a name="l00523"></a>00523 {
-<a name="l00524"></a>00524     cpl_image           **  combined_contrib;
-<a name="l00525"></a>00525     cpl_bivector        **  offsets;
-<a name="l00526"></a>00526     cpl_mask             *  bpm_masks[HAWKI_NB_DETECTORS];
-<a name="l00527"></a>00527     <span class="keywordtype">int</span>                     idet;
-<a name="l00528"></a>00528     <span class="keywordtype">int</span>                     ioff;
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     <span class="keywordflow">if</span>(offsets_frames == NULL)
-<a name="l00531"></a>00531     {
-<a name="l00532"></a>00532         cpl_bivector        *   offsets_single_chip;
-<a name="l00533"></a>00533         <span class="keywordflow">if</span> ((offsets_single_chip = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(obj)) == NULL) 
-<a name="l00534"></a>00534         {
-<a name="l00535"></a>00535             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>);
-<a name="l00536"></a>00536             <span class="keywordflow">return</span> NULL;
-<a name="l00537"></a>00537         }
-<a name="l00538"></a>00538         offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));
-<a name="l00539"></a>00539         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00540"></a>00540             offsets[idet] =  cpl_bivector_duplicate(offsets_single_chip);
-<a name="l00541"></a>00541         cpl_bivector_delete(offsets_single_chip);
-<a name="l00542"></a>00542     }
-<a name="l00543"></a>00543     <span class="keywordflow">else</span>
-<a name="l00544"></a>00544     {
-<a name="l00545"></a>00545         offsets = <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a>
-<a name="l00546"></a>00546             (cpl_frameset_get_first(offsets_frames));
-<a name="l00547"></a>00547         <span class="keywordflow">if</span>(offsets == NULL)
-<a name="l00548"></a>00548         {
-<a name="l00549"></a>00549             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the refined offsets"</span>);
-<a name="l00550"></a>00550             <span class="keywordflow">return</span> NULL;
-<a name="l00551"></a>00551         }
-<a name="l00552"></a>00552     }
-<a name="l00553"></a>00553     <span class="comment">/* Get the oposite offsets. This is to change from </span>
-<a name="l00554"></a>00554 <span class="comment">     * telescope convention to cpl convention </span>
-<a name="l00555"></a>00555 <span class="comment">     * WARNING: It may appear that the img_jitter function </span>
-<a name="l00556"></a>00556 <span class="comment">     * does not apply the multiplication by -1, but it really does it in </span>
-<a name="l00557"></a>00557 <span class="comment">     * hawki_img_jitter_saa instead of when it reads the offsets */</span>
-<a name="l00558"></a>00558     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00559"></a>00559     {
-<a name="l00560"></a>00560         cpl_vector_multiply_scalar(cpl_bivector_get_x(offsets[idet]), -1.0);
-<a name="l00561"></a>00561         cpl_vector_multiply_scalar(cpl_bivector_get_y(offsets[idet]), -1.0);
-<a name="l00562"></a>00562     }
-<a name="l00563"></a>00563     
-<a name="l00564"></a>00564     <span class="comment">/* Load the bpm */</span>
-<a name="l00565"></a>00565     <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00566"></a>00566     {
-<a name="l00567"></a>00567         cpl_imagelist *  bpm_images = NULL;
-<a name="l00568"></a>00568         bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>
-<a name="l00569"></a>00569             (cpl_frameset_get_first(bpm_frame), CPL_TYPE_INT);
-<a name="l00570"></a>00570         <span class="keywordflow">if</span>(bpm_images == NULL)
-<a name="l00571"></a>00571         {
-<a name="l00572"></a>00572             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the bad pixel mask"</span>);
-<a name="l00573"></a>00573             <span class="keywordflow">return</span> NULL;
-<a name="l00574"></a>00574         }
-<a name="l00575"></a>00575         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00576"></a>00576         {
-<a name="l00577"></a>00577             bpm_masks[idet] = cpl_mask_threshold_image_create
-<a name="l00578"></a>00578                 (cpl_imagelist_get(bpm_images, idet), 0.5, 1.5);
-<a name="l00579"></a>00579         }
-<a name="l00580"></a>00580         cpl_imagelist_delete(bpm_images);
-<a name="l00581"></a>00581     }
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     <span class="comment">/* Create output object */</span>
-<a name="l00584"></a>00584     combined_contrib = cpl_malloc(2 * HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l00585"></a>00585  
-<a name="l00586"></a>00586     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00587"></a>00587     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00588"></a>00588     {
-<a name="l00589"></a>00589         cpl_imagelist   * in ;
-<a name="l00590"></a>00590         cpl_imagelist   * bpm_bkg_im = NULL;
-<a name="l00591"></a>00591         cpl_image      ** comb_contrib_chip ;
-<a name="l00592"></a>00592         <span class="keywordtype">double</span>          * offs_est_x ;
-<a name="l00593"></a>00593         <span class="keywordtype">double</span>          * offs_est_y ;
-<a name="l00594"></a>00594         <span class="keywordtype">double</span>            max_x, max_y ;
-<a name="l00595"></a>00595         <span class="keywordtype">double</span>            off_0_x;
-<a name="l00596"></a>00596         <span class="keywordtype">double</span>            off_0_y;
-<a name="l00597"></a>00597         <span class="keywordtype">int</span>               jdet;
-<a name="l00598"></a>00598         <span class="keywordtype">int</span>               iframe;
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600         cpl_msg_info(__func__, <span class="stringliteral">"Combine chip number %d"</span>, idet+1) ;
-<a name="l00601"></a>00601         cpl_msg_indent_more() ;
-<a name="l00602"></a>00602         
-<a name="l00603"></a>00603         <span class="comment">/* Print the offsets */</span>
-<a name="l00604"></a>00604         offs_est_x = cpl_bivector_get_x_data(offsets[idet]) ;
-<a name="l00605"></a>00605         offs_est_y = cpl_bivector_get_y_data(offsets[idet]) ;
-<a name="l00606"></a>00606         <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets[idet]) ; ioff++) {
-<a name="l00607"></a>00607             cpl_msg_info(__func__,<span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,
-<a name="l00608"></a>00608                     -offs_est_x[ioff], -offs_est_y[ioff]) ;
-<a name="l00609"></a>00609         }
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611         <span class="comment">/* Subtract the first offset to all offsets */</span>
-<a name="l00612"></a>00612         max_x = max_y = 0.0 ;
-<a name="l00613"></a>00613         off_0_x = offs_est_x[0];
-<a name="l00614"></a>00614         off_0_y = offs_est_y[0];
-<a name="l00615"></a>00615         <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(offsets[idet]) ; ioff++) 
-<a name="l00616"></a>00616         {
-<a name="l00617"></a>00617             offs_est_x[ioff] -= offs_est_x[0] ;
-<a name="l00618"></a>00618             offs_est_y[ioff] -= offs_est_y[0] ;
-<a name="l00619"></a>00619             <span class="keywordflow">if</span> (fabs(offs_est_x[ioff]) > max_x) max_x = fabs(offs_est_x[ioff]);
-<a name="l00620"></a>00620             <span class="keywordflow">if</span> (fabs(offs_est_y[ioff]) > max_y) max_y = fabs(offs_est_y[ioff]);
-<a name="l00621"></a>00621         }
-<a name="l00622"></a>00622         offs_est_x[0] = offs_est_y[0] = 0.00 ;
-<a name="l00623"></a>00623 
-<a name="l00624"></a>00624         <span class="comment">/* Check if the max offset is not too big */</span>
-<a name="l00625"></a>00625         <span class="keywordflow">if</span> (max_x > hawki_step_combine_config.offset_max || 
-<a name="l00626"></a>00626                 max_y > hawki_step_combine_config.offset_max) 
-<a name="l00627"></a>00627         {
-<a name="l00628"></a>00628             cpl_msg_error(__func__,<span class="stringliteral">"Sorry, no support for offsets larger than %d"</span>,
-<a name="l00629"></a>00629                           hawki_step_combine_config.offset_max);
-<a name="l00630"></a>00630             <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00631"></a>00631             {
-<a name="l00632"></a>00632                 cpl_bivector_delete(offsets[idet]);
-<a name="l00633"></a>00633                 <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00634"></a>00634                     cpl_mask_delete(bpm_masks[idet]);
-<a name="l00635"></a>00635             }
-<a name="l00636"></a>00636             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00637"></a>00637             {
-<a name="l00638"></a>00638                 cpl_image_delete(combined_contrib[idet]);
-<a name="l00639"></a>00639                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);
-<a name="l00640"></a>00640             }
-<a name="l00641"></a>00641             cpl_free(combined_contrib);
-<a name="l00642"></a>00642             <span class="keywordflow">return</span> NULL ;
-<a name="l00643"></a>00643         }
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645         <span class="comment">/* Load the input data */</span>
-<a name="l00646"></a>00646         cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;
-<a name="l00647"></a>00647         cpl_msg_indent_more();
-<a name="l00648"></a>00648         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(obj, idet+1, CPL_TYPE_FLOAT)) == NULL) {
-<a name="l00649"></a>00649             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>,idet+1);
-<a name="l00650"></a>00650             <span class="comment">//TODO: there is probably a memory leak here. It should be checked.</span>
-<a name="l00651"></a>00651             <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00652"></a>00652             {
-<a name="l00653"></a>00653                 cpl_bivector_delete(offsets[idet]);
-<a name="l00654"></a>00654                 <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00655"></a>00655                     cpl_mask_delete(bpm_masks[idet]);
-<a name="l00656"></a>00656             }
-<a name="l00657"></a>00657             <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00658"></a>00658             {
-<a name="l00659"></a>00659                 cpl_image_delete(combined_contrib[idet]);
-<a name="l00660"></a>00660                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);
-<a name="l00661"></a>00661             }
-<a name="l00662"></a>00662             cpl_free(combined_contrib);
-<a name="l00663"></a>00663             cpl_free(offsets);
-<a name="l00664"></a>00664             cpl_msg_indent_less() ;
-<a name="l00665"></a>00665             cpl_msg_indent_less() ;
-<a name="l00666"></a>00666             <span class="keywordflow">return</span> NULL ;
-<a name="l00667"></a>00667         }
-<a name="l00668"></a>00668 
-<a name="l00669"></a>00669         <span class="comment">/* Load the bad bkg images */</span>
-<a name="l00670"></a>00670         <span class="keywordflow">if</span>(bkg_bpm_frames != NULL)
-<a name="l00671"></a>00671         {
-<a name="l00672"></a>00672             cpl_msg_info(__func__, <span class="stringliteral">"Load the bad bkg images"</span>);
-<a name="l00673"></a>00673             cpl_msg_indent_more() ;
-<a name="l00674"></a>00674             <span class="keywordflow">if</span> ((bpm_bkg_im = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(bkg_bpm_frames, idet+1,
-<a name="l00675"></a>00675                               CPL_TYPE_FLOAT)) == NULL)
-<a name="l00676"></a>00676             {
-<a name="l00677"></a>00677                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>,idet+1);
-<a name="l00678"></a>00678                 <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00679"></a>00679                 {
-<a name="l00680"></a>00680                     cpl_bivector_delete(offsets[idet]);
-<a name="l00681"></a>00681                     <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00682"></a>00682                         cpl_mask_delete(bpm_masks[idet]);
-<a name="l00683"></a>00683                 }
-<a name="l00684"></a>00684                 <span class="keywordflow">for</span>(jdet = 0; jdet < idet; ++jdet)
-<a name="l00685"></a>00685                 {
-<a name="l00686"></a>00686                     cpl_image_delete(combined_contrib[idet]);
-<a name="l00687"></a>00687                     cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);
-<a name="l00688"></a>00688                 }
-<a name="l00689"></a>00689                 cpl_free(combined_contrib);
-<a name="l00690"></a>00690                 cpl_imagelist_delete(in);
-<a name="l00691"></a>00691                 cpl_free(offsets);
-<a name="l00692"></a>00692                 cpl_msg_indent_less() ;
-<a name="l00693"></a>00693                 cpl_msg_indent_less() ;
-<a name="l00694"></a>00694                 <span class="keywordflow">return</span> NULL ;
-<a name="l00695"></a>00695             }
-<a name="l00696"></a>00696             cpl_msg_indent_less() ;
-<a name="l00697"></a>00697         }
-<a name="l00698"></a>00698         cpl_msg_indent_less() ;
-<a name="l00699"></a>00699         
-<a name="l00700"></a>00700         <span class="comment">/* Add the general bpm or background bpms in case they were specified */</span>
-<a name="l00701"></a>00701         <span class="keywordflow">if</span>(bpm_frame != NULL || bkg_bpm_frames != NULL)
-<a name="l00702"></a>00702         {
-<a name="l00703"></a>00703             <span class="keywordflow">for</span>(iframe = 0 ; iframe <cpl_imagelist_get_size(in) ; ++iframe)
-<a name="l00704"></a>00704             {
-<a name="l00705"></a>00705                 cpl_mask  * final_mask;
-<a name="l00706"></a>00706                 cpl_image * target_image =  cpl_imagelist_get(in, iframe);
-<a name="l00707"></a>00707                 final_mask = cpl_mask_new(cpl_image_get_size_x(target_image),
-<a name="l00708"></a>00708                                           cpl_image_get_size_y(target_image));
-<a name="l00709"></a>00709                 <span class="comment">//Add the common bpm</span>
-<a name="l00710"></a>00710                 <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00711"></a>00711                     cpl_mask_or(final_mask, bpm_masks[idet]);
-<a name="l00712"></a>00712                 <span class="comment">//Add the background mask if provided</span>
-<a name="l00713"></a>00713                 <span class="keywordflow">if</span>(bkg_bpm_frames != NULL)
-<a name="l00714"></a>00714                 {
-<a name="l00715"></a>00715                     cpl_mask * bpm_bkg_mask = 
-<a name="l00716"></a>00716                         cpl_mask_threshold_image_create
-<a name="l00717"></a>00717                           (cpl_imagelist_get(bpm_bkg_im, iframe), 0.5, FLT_MAX);
-<a name="l00718"></a>00718                     cpl_mask_or(final_mask, bpm_bkg_mask);
-<a name="l00719"></a>00719                     cpl_mask_delete(bpm_bkg_mask);
-<a name="l00720"></a>00720                 }
-<a name="l00721"></a>00721                 cpl_image_reject_from_mask(target_image, final_mask);
-<a name="l00722"></a>00722                 cpl_mask_delete(final_mask);
-<a name="l00723"></a>00723             }
-<a name="l00724"></a>00724         }
-<a name="l00725"></a>00725         
-<a name="l00726"></a>00726         <span class="keywordflow">if</span>(bkg_bpm_frames != NULL)
-<a name="l00727"></a>00727             cpl_imagelist_delete(bpm_bkg_im);
-<a name="l00728"></a>00728 
-<a name="l00729"></a>00729         <span class="comment">/* Apply the shift and add */</span>
-<a name="l00730"></a>00730         cpl_msg_info(__func__, <span class="stringliteral">"Shift and add"</span>) ;
-<a name="l00731"></a>00731         cpl_msg_indent_more() ;
-<a name="l00732"></a>00732         comb_contrib_chip = hawki_step_combine_chip(in, offsets[idet], 
-<a name="l00733"></a>00733                 &(hawki_step_combine_output.combined_pos_x[idet]),
-<a name="l00734"></a>00734                 &(hawki_step_combine_output.combined_pos_y[idet])) ;
-<a name="l00735"></a>00735         <span class="keywordflow">if</span> (comb_contrib_chip == NULL) 
-<a name="l00736"></a>00736         {
-<a name="l00737"></a>00737             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;
-<a name="l00738"></a>00738             cpl_imagelist_delete(in) ;
-<a name="l00739"></a>00739             <span class="keywordflow">for</span>(jdet = 0; jdet < HAWKI_NB_DETECTORS; ++jdet)
-<a name="l00740"></a>00740                 cpl_bivector_delete(offsets[jdet]);
-<a name="l00741"></a>00741             {
-<a name="l00742"></a>00742                 cpl_image_delete(combined_contrib[idet]);
-<a name="l00743"></a>00743                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);
-<a name="l00744"></a>00744             }
-<a name="l00745"></a>00745             cpl_free(combined_contrib);
-<a name="l00746"></a>00746             cpl_free(offsets);
-<a name="l00747"></a>00747             cpl_msg_indent_less() ;
-<a name="l00748"></a>00748             cpl_msg_indent_less() ;
-<a name="l00749"></a>00749             <span class="keywordflow">return</span> NULL ;
-<a name="l00750"></a>00750         }
-<a name="l00751"></a>00751         
-<a name="l00752"></a>00752         <span class="comment">/* The cumoffset have the opposite criteria as cpl */</span>
-<a name="l00753"></a>00753         hawki_step_combine_output.combined_cumoffset_x[idet] = 
-<a name="l00754"></a>00754             hawki_step_combine_output.combined_pos_x[idet] - off_0_x;
-<a name="l00755"></a>00755         hawki_step_combine_output.combined_cumoffset_y[idet] = 
-<a name="l00756"></a>00756             hawki_step_combine_output.combined_pos_y[idet] - off_0_y;
-<a name="l00757"></a>00757         cpl_imagelist_delete(in) ;
-<a name="l00758"></a>00758         cpl_msg_indent_less() ;
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760         <span class="comment">/* Interpolate bad pixels */</span>
-<a name="l00761"></a>00761         hawki_step_combine_interpolate_badpix(comb_contrib_chip[0]);        
-<a name="l00762"></a>00762 
-<a name="l00763"></a>00763         <span class="comment">/* Put the results in the image list */</span>
-<a name="l00764"></a>00764         combined_contrib[idet] = comb_contrib_chip[0];
-<a name="l00765"></a>00765         combined_contrib[idet+HAWKI_NB_DETECTORS] = comb_contrib_chip[1];
-<a name="l00766"></a>00766         cpl_free(comb_contrib_chip);
-<a name="l00767"></a>00767         cpl_msg_indent_less() ;
-<a name="l00768"></a>00768     }
-<a name="l00769"></a>00769     
-<a name="l00770"></a>00770     <span class="comment">/* Compute the mean airmass */</span>
-<a name="l00771"></a>00771     hawki_step_combine_output.mean_airmass = <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(obj);
-<a name="l00772"></a>00772     
-<a name="l00773"></a>00773     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00774"></a>00774     {
-<a name="l00775"></a>00775         cpl_bivector_delete(offsets[idet]);
-<a name="l00776"></a>00776         <span class="keywordflow">if</span>(bpm_frame != NULL)
-<a name="l00777"></a>00777             cpl_mask_delete(bpm_masks[idet]);
-<a name="l00778"></a>00778     }
-<a name="l00779"></a>00779     cpl_free(offsets);
-<a name="l00780"></a>00780     <span class="keywordflow">return</span> combined_contrib;
-<a name="l00781"></a>00781 }
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00792"></a>00792 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00793"></a>00793 <span class="keyword">static</span> cpl_image ** hawki_step_combine_chip(
-<a name="l00794"></a>00794         cpl_imagelist   *  in,
-<a name="l00795"></a>00795         cpl_bivector    *  offsets,
-<a name="l00796"></a>00796         <span class="keywordtype">double</span>          *  pos_x,
-<a name="l00797"></a>00797         <span class="keywordtype">double</span>          *  pos_y)
-<a name="l00798"></a>00798 {
-<a name="l00799"></a>00799     cpl_image        **  combined_contrib;
-<a name="l00800"></a>00800     cpl_imagelist    *   in_ext ;
-<a name="l00801"></a>00801     cpl_image        *   tmp1 ;
-<a name="l00802"></a>00802     cpl_image        *   tmp2 ;
-<a name="l00803"></a>00803     <span class="keywordtype">int</span>                  nfiles, nx, ny ;
-<a name="l00804"></a>00804     <span class="keywordtype">int</span>                  i;
-<a name="l00805"></a>00805 
-<a name="l00806"></a>00806     <span class="comment">/* Check entries */</span>
-<a name="l00807"></a>00807     <span class="keywordflow">if</span> (pos_x == NULL || pos_y == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00808"></a>00808     <span class="keywordflow">if</span> (offsets == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810     <span class="comment">/* Get the number of images */</span>
-<a name="l00811"></a>00811     nfiles = cpl_imagelist_get_size(in) ;
-<a name="l00812"></a>00812     <span class="keywordflow">if</span> (cpl_bivector_get_size(offsets) != nfiles) {
-<a name="l00813"></a>00813         cpl_msg_error(__func__, <span class="stringliteral">"Number of refined offsets in table "</span><span class="stringliteral">""</span>
-<a name="l00814"></a>00814                       <span class="stringliteral">"is different than number of frames to combine"</span>); 
-<a name="l00815"></a>00815         <span class="keywordflow">return</span> NULL ;
-<a name="l00816"></a>00816     }
-<a name="l00817"></a>00817     
-<a name="l00818"></a>00818     <span class="comment">/* Discard the pixels on the sides */</span>
-<a name="l00819"></a>00819     <span class="keywordflow">if</span> (hawki_step_combine_config.borders > 0) {
-<a name="l00820"></a>00820         nx = cpl_image_get_size_x(cpl_imagelist_get(in, 0)) ;
-<a name="l00821"></a>00821         ny = cpl_image_get_size_y(cpl_imagelist_get(in, 0)) ;
-<a name="l00822"></a>00822         in_ext = cpl_imagelist_new() ;
-<a name="l00823"></a>00823         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(in) ; i++) {
-<a name="l00824"></a>00824             tmp1 = cpl_imagelist_get(in, i) ;
-<a name="l00825"></a>00825             tmp2 = cpl_image_extract(tmp1, 
-<a name="l00826"></a>00826                     hawki_step_combine_config.borders+1, 
-<a name="l00827"></a>00827                     hawki_step_combine_config.borders+1, 
-<a name="l00828"></a>00828                     nx-hawki_step_combine_config.borders, 
-<a name="l00829"></a>00829                     ny-hawki_step_combine_config.borders) ;
-<a name="l00830"></a>00830             cpl_imagelist_set(in_ext, tmp2, i) ;
-<a name="l00831"></a>00831         }
-<a name="l00832"></a>00832     }
-<a name="l00833"></a>00833     <span class="keywordflow">else</span>
-<a name="l00834"></a>00834     {
-<a name="l00835"></a>00835         in_ext = cpl_imagelist_duplicate(in);
-<a name="l00836"></a>00836     }
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     <span class="comment">/* Apply the shift & add */</span>
-<a name="l00839"></a>00839     cpl_msg_info(__func__, <span class="stringliteral">"Recombine the images set"</span>) ;
-<a name="l00840"></a>00840     cpl_msg_indent_more() ;
-<a name="l00841"></a>00841     <span class="keywordflow">if</span> ((combined_contrib=cpl_geom_img_offset_saa(in_ext, offsets,
-<a name="l00842"></a>00842             hawki_step_combine_config.resamp_kernel, 
-<a name="l00843"></a>00843             hawki_step_combine_config.rej_low,
-<a name="l00844"></a>00844             hawki_step_combine_config.rej_high,
-<a name="l00845"></a>00845             hawki_step_combine_config.comb_meth,
-<a name="l00846"></a>00846             pos_x, pos_y)) == NULL) {
-<a name="l00847"></a>00847         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;
-<a name="l00848"></a>00848         cpl_msg_indent_less();
-<a name="l00849"></a>00849         <span class="keywordflow">return</span> NULL;
-<a name="l00850"></a>00850     }
-<a name="l00851"></a>00851     cpl_msg_indent_less();
-<a name="l00852"></a>00852     *pos_x -= hawki_step_combine_config.borders;
-<a name="l00853"></a>00853     *pos_y -= hawki_step_combine_config.borders;
-<a name="l00854"></a>00854 
-<a name="l00855"></a>00855     <span class="comment">/* Free and return */</span>
-<a name="l00856"></a>00856     cpl_imagelist_delete(in_ext);
-<a name="l00857"></a>00857     <span class="keywordflow">return</span> combined_contrib;
-<a name="l00858"></a>00858 }
-<a name="l00859"></a>00859 
-<a name="l00860"></a>00860 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00866"></a>00866 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00867"></a>00867 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_interpolate_badpix
-<a name="l00868"></a>00868 (cpl_image           *  image)
-<a name="l00869"></a>00869 {
-<a name="l00870"></a>00870     <span class="keywordtype">int</span> nbadpixels = cpl_image_count_rejected(image); 
-<a name="l00871"></a>00871     <span class="keywordflow">if</span>(nbadpixels !=0)
-<a name="l00872"></a>00872         cpl_msg_info(__func__,<span class="stringliteral">"Number of pixels with no combined value available: %d "</span>,
-<a name="l00873"></a>00873                      nbadpixels);
-<a name="l00874"></a>00874     <span class="keywordflow">if</span>(cpl_image_count_rejected(image) > 0)
-<a name="l00875"></a>00875     {
-<a name="l00876"></a>00876         <span class="comment">//I use this even if DFS08929 is still not solved</span>
-<a name="l00877"></a>00877         cpl_detector_interpolate_rejected(image);
-<a name="l00878"></a>00878     }
-<a name="l00879"></a>00879     <span class="keywordflow">return</span> 0;
-<a name="l00880"></a>00880 }
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00891"></a>00891 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00892"></a>00892 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_save
-<a name="l00893"></a>00893 (cpl_image           ** combined,
-<a name="l00894"></a>00894  cpl_image           ** contrib_map,
-<a name="l00895"></a>00895  cpl_frameset        *  used_frames,
-<a name="l00896"></a>00896  cpl_parameterlist   *  parlist,
-<a name="l00897"></a>00897  cpl_frameset        *  recipe_frameset)
-<a name="l00898"></a>00898 {
-<a name="l00899"></a>00899     cpl_propertylist    **  extproplists ;
-<a name="l00900"></a>00900     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l00901"></a>00901     cpl_propertylist    *   wcslist ;
-<a name="l00902"></a>00902     cpl_propertylist    *   inputlist ;
-<a name="l00903"></a>00903     <span class="keywordtype">double</span>                  crpix1, crpix2 ;
-<a name="l00904"></a>00904     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00905"></a>00905     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_combine"</span> ;
-<a name="l00906"></a>00906     <span class="keywordtype">int</span>                     idet;
-<a name="l00907"></a>00907     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     <span class="comment">/* Get a reference frame for the WCS keys */</span>
-<a name="l00910"></a>00910     ref_frame = irplib_frameset_get_first_from_group
-<a name="l00911"></a>00911         (recipe_frameset, CPL_FRAME_GROUP_RAW) ;
-<a name="l00912"></a>00912     
-<a name="l00913"></a>00913     <span class="keywordflow">if</span>(ref_frame == NULL)
-<a name="l00914"></a>00914     {
-<a name="l00915"></a>00915         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get a reference frame"</span>);
-<a name="l00916"></a>00916         <span class="keywordflow">return</span> -1;
-<a name="l00917"></a>00917     }
-<a name="l00918"></a>00918 
-<a name="l00919"></a>00919     <span class="comment">/* Create the QC lists */</span>
-<a name="l00920"></a>00920     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00921"></a>00921     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00922"></a>00922     {
-<a name="l00923"></a>00923 
-<a name="l00924"></a>00924         <span class="comment">/* Initialize qclists */</span>
-<a name="l00925"></a>00925         extproplists[idet] = cpl_propertylist_new() ;
-<a name="l00926"></a>00926 
-<a name="l00927"></a>00927         <span class="comment">/* Get the extension number */</span>
-<a name="l00928"></a>00928         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+1);
-<a name="l00929"></a>00929 
-<a name="l00930"></a>00930         <span class="comment">/* Handle WCS keys */</span>
-<a name="l00931"></a>00931         wcslist = cpl_propertylist_load_regexp(
-<a name="l00932"></a>00932                 cpl_frame_get_filename(ref_frame), ext_nb, HAWKI_HEADER_WCS, 0);
-<a name="l00933"></a>00933 
-<a name="l00934"></a>00934         <span class="comment">/* Update WCS and write them */</span>
-<a name="l00935"></a>00935         crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); 
-<a name="l00936"></a>00936         crpix1 += hawki_step_combine_output.combined_pos_x[idet];
-<a name="l00937"></a>00937         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;
-<a name="l00938"></a>00938         crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); 
-<a name="l00939"></a>00939         crpix2 += hawki_step_combine_output.combined_pos_y[idet] ;
-<a name="l00940"></a>00940         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;
-<a name="l00941"></a>00941         cpl_propertylist_copy_property_regexp
-<a name="l00942"></a>00942             (extproplists[idet], wcslist, HAWKI_HEADER_WCS, 0);
-<a name="l00943"></a>00943         cpl_propertylist_delete(wcslist) ;
-<a name="l00944"></a>00944         
-<a name="l00945"></a>00945         <span class="comment">/* Keywords for the relative position of the combined image */</span>
-<a name="l00946"></a>00946         cpl_propertylist_append_double
-<a name="l00947"></a>00947             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</span>,
-<a name="l00948"></a>00948              hawki_step_combine_output.combined_cumoffset_x[idet]);
-<a name="l00949"></a>00949         cpl_propertylist_append_double
-<a name="l00950"></a>00950             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</span>,
-<a name="l00951"></a>00951              hawki_step_combine_output.combined_cumoffset_y[idet]);
-<a name="l00952"></a>00952         cpl_propertylist_append_double
-<a name="l00953"></a>00953             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,
-<a name="l00954"></a>00954              hawki_step_combine_output.combined_pos_x[idet]);
-<a name="l00955"></a>00955         cpl_propertylist_append_double
-<a name="l00956"></a>00956             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,
-<a name="l00957"></a>00957              hawki_step_combine_output.combined_pos_y[idet]);
-<a name="l00958"></a>00958         cpl_propertylist_append_double
-<a name="l00959"></a>00959             (extproplists[idet], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,
-<a name="l00960"></a>00960              hawki_step_combine_output.mean_airmass);
-<a name="l00961"></a>00961 
-<a name="l00962"></a>00962         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00963"></a>00963         inputlist = cpl_propertylist_load_regexp(
-<a name="l00964"></a>00964                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00965"></a>00965                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l00966"></a>00966         cpl_propertylist_append(extproplists[idet], inputlist);
-<a name="l00967"></a>00967         cpl_propertylist_delete(inputlist) ;
-<a name="l00968"></a>00968     }
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970     <span class="comment">/* Write the combined image */</span>
-<a name="l00971"></a>00971     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(recipe_frameset,
-<a name="l00972"></a>00972                          parlist,
-<a name="l00973"></a>00973                          used_frames,
-<a name="l00974"></a>00974                          (<span class="keyword">const</span> cpl_image **)combined,
-<a name="l00975"></a>00975                          recipe_name,
-<a name="l00976"></a>00976                          HAWKI_CALPRO_COMBINED,
-<a name="l00977"></a>00977                          HAWKI_PROTYPE_COMBINED, 
-<a name="l00978"></a>00978                          NULL,
-<a name="l00979"></a>00979                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,
-<a name="l00980"></a>00980                          <span class="stringliteral">"hawki_step_combine.fits"</span>)  != 0)
-<a name="l00981"></a>00981     {
-<a name="l00982"></a>00982         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l00983"></a>00983             cpl_propertylist_delete(extproplists[idet]) ;
-<a name="l00984"></a>00984         }
-<a name="l00985"></a>00985         cpl_free(extproplists) ;
-<a name="l00986"></a>00986         <span class="keywordflow">return</span> -1;
-<a name="l00987"></a>00987     }
-<a name="l00988"></a>00988 
-<a name="l00989"></a>00989     <span class="comment">/* Write the contrib map */</span>
-<a name="l00990"></a>00990     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(recipe_frameset,
-<a name="l00991"></a>00991                          parlist,
-<a name="l00992"></a>00992                          used_frames,
-<a name="l00993"></a>00993                          (<span class="keyword">const</span> cpl_image **)contrib_map,
-<a name="l00994"></a>00994                          recipe_name,
-<a name="l00995"></a>00995                          HAWKI_CALPRO_COMB_CONTRIB_MAP,
-<a name="l00996"></a>00996                          HAWKI_PROTYPE_COMB_CONTRIB_MAP,
-<a name="l00997"></a>00997                          NULL,
-<a name="l00998"></a>00998                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,
-<a name="l00999"></a>00999                          <span class="stringliteral">"hawki_step_combine_contrib_map.fits"</span>)  != 0)
-<a name="l01000"></a>01000     {
-<a name="l01001"></a>01001         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01002"></a>01002             cpl_propertylist_delete(extproplists[idet]);
-<a name="l01003"></a>01003         }
-<a name="l01004"></a>01004         cpl_free(extproplists) ;
-<a name="l01005"></a>01005         <span class="keywordflow">return</span> -1;
-<a name="l01006"></a>01006     }
-<a name="l01007"></a>01007 
-<a name="l01008"></a>01008     <span class="comment">/* Free and return */</span>
-<a name="l01009"></a>01009     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l01010"></a>01010         cpl_propertylist_delete(extproplists[idet]) ;
-<a name="l01011"></a>01011     }
-<a name="l01012"></a>01012     cpl_free(extproplists) ;
-<a name="l01013"></a>01013 
-<a name="l01014"></a>01014     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l01015"></a>01015     {
-<a name="l01016"></a>01016         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l01017"></a>01017         <span class="keywordflow">return</span> 1;
-<a name="l01018"></a>01018     }
-<a name="l01019"></a>01019 
-<a name="l01020"></a>01020     <span class="keywordflow">return</span>  0;
-<a name="l01021"></a>01021 }
-<a name="l01022"></a>01022  
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_combine.c,v 1.26 2013/01/14 15:18: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/01/14 15:18:44 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_calib.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_saa.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_bkg.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "hawki_properties_tel.h"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">#include "hawki_image_stats.h"</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</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><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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="keywordtype">int</span> hawki_step_combine_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine(cpl_parameterlist *, cpl_frameset *) ;</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_retrieve_input_param</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keyword">static</span> cpl_image ** hawki_step_combine_apply_comb</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (cpl_frameset    * obj,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  cpl_frameset    * offsets,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_frameset    * bpm,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_frameset    * bkg_bpm_frames);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="keyword">static</span> cpl_image **  hawki_step_combine_chip</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> (cpl_imagelist   * in,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_bivector    * offsets,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  <span class="keywordtype">double</span>          * pos_x,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keywordtype">double</span>          * pos_y);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_interpolate_badpix</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> (cpl_image           *  image);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_save</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> (cpl_image           ** combined,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_image           ** contrib_map,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>  cpl_frameset        *  used_frames,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>  cpl_parameterlist   *  parlist,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  cpl_frameset        *  recipe_frameset);</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">                            Static variables</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keyword">struct </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="comment">/* Inputs */</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="keywordtype">int</span>                 offset_max ;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="keywordtype">int</span>                 borders ;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cpl_geom_combine    comb_meth ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordtype">int</span>                 rej_low;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">int</span>                 rej_high;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_kernel          resamp_kernel;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> } hawki_step_combine_config;</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> <span class="keyword">struct </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">/* Outputs */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordtype">double</span>  mean_airmass;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordtype">double</span>  combined_pos_x[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="keywordtype">double</span>  combined_pos_y[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordtype">double</span>  combined_cumoffset_x[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="keywordtype">double</span>  combined_cumoffset_y[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> } hawki_step_combine_output;</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">static</span> <span class="keywordtype">char</span> hawki_step_combine_description[] =</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"hawki_step_combine -- hawki combine jitter images.\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="stringliteral">"science-file.fits "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="stringliteral">"science-file.fits "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="stringliteral">"bpm-file.fits "</span>HAWKI_CALPRO_BPM<span class="stringliteral">" (optional) \n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="stringliteral">"bkg_bpm-file.fits "</span>HAWKI_CALPRO_BKGBPM<span class="stringliteral">" (optional) \n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="stringliteral">"offsets-file.fits "</span>HAWKI_CALPRO_OFFSETS<span class="stringliteral">" (optional) \n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="stringliteral">"hawki_step_combine.fits ("</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"): \n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="stringliteral">"The recipe does the following steps:\n"</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="stringliteral">"-Allocate an image with the proper combined size \n"</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="stringliteral">"   (depends on parameters --comb_meth and --borders)\n"</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="stringliteral">"-Retrieve the offsets either from the offsets-file.fits or from the header\n"</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="stringliteral">"-For each combined pixel, the contribution of each individual frame \n"</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="stringliteral">"   is added using a resampling kernel. If any of the pixels involved in\n"</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="stringliteral">"   the resampling is a bad pixel (defined in bpm-file.fits), it is not\n"</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="stringliteral">"   taken into account.\n"</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="stringliteral">"   With the remaining pixels a minmax rejection is performed\n"</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="stringliteral">"or 1 otherwise"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">                                Functions code</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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 = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                     <span class="stringliteral">"hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                     <span class="stringliteral">"Jitter image combination recipe"</span>,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                     hawki_step_combine_description,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                     hawki_step_combine_create,</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                     hawki_step_combine_exec,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                     hawki_step_combine_destroy) ;</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_pluginlist_append(list, plugin) ;</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> 0;</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">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_create(cpl_plugin * plugin)</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>     cpl_recipe      * recipe ;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_parameter   * 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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">else</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">/* Create the parameters list in the cpl_recipe object */</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>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="comment">/* --offset_max */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.offset_max"</span>,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 <span class="stringliteral">"Maximum offset allowed"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 1500) ;</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">"offset_max"</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">/* --comb_meth */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.comb_meth"</span>,</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                                 <span class="stringliteral">"Final size of combination (union / inter / first)"</span>,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                 <span class="stringliteral">"union"</span>) ;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"comb_meth"</span>) ;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --rej */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.rej"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 <span class="stringliteral">"Low and high number of rejected values"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                                 <span class="stringliteral">"1,1"</span>) ;</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">"rej"</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">/* --borders */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.borders"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 <span class="stringliteral">"Border pixels trimmed"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 4) ;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"borders"</span>) ;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --resamp_kernel */</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_combine.resamp_kernel"</span>,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                 <span class="stringliteral">"Resampling kernel (default/tanh/sinc/sinc2/lanczos/hamming/hann)"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 <span class="stringliteral">"hawki.hawki_step_combine"</span>,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"default"</span>) ;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"resamp_kernel"</span>) ;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_exec(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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">else</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>     <span class="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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="keywordflow">return</span> hawki_step_combine(recipe->parameters, recipe->frames) ;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine(</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         cpl_frameset        *   framelist)</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_frameset    *  objframes ;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_frameset    *  offsets;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_frameset    *  bpm;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_frameset    *  bpmbkg;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_frameset    *  used_frames;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_image       ** combined_contrib;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_image       ** combined;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_image       ** contrib_map;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordtype">int</span>                idet;</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="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keywordflow">if</span>(hawki_step_combine_retrieve_input_param(parlist))</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_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         <span class="keywordflow">return</span> -1;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_DIST_CORRECTED);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (objframes == 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>         objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>             (framelist, HAWKI_CALPRO_BKG_SUBTRACTED);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>         <span class="keywordflow">if</span> (objframes == 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>             cpl_msg_error(__func__,<span class="stringliteral">"Cannot find objs frames in the input list (%s or %s)"</span>,</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                     HAWKI_CALPRO_DIST_CORRECTED, HAWKI_CALPRO_BKG_SUBTRACTED);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             <span class="keywordflow">return</span> -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="comment">/* Check that pointing is the same for all the frames */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">if</span>(!<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(objframes, &<a class="code" href="group__hawki__pfits.html#ga36892dc77006059ba553e9a98c9b55fc" title="find out the target RA">hawki_pfits_get_targ_alpha</a>) ||</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>        !<a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>(objframes, &<a class="code" href="group__hawki__pfits.html#ga0330c53376304376257417ea4edbee5c" title="find out the target DEC">hawki_pfits_get_targ_delta</a>))</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_error(__func__, <span class="stringliteral">"Not all input science frames belong to the "</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                 <span class="stringliteral">"same pointing/target. Check keywords TEL TARG ALPHA/DELTA"</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         <span class="keywordflow">return</span> -1;        </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>     used_frames = cpl_frameset_duplicate(objframes);</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">/* Retrieve the refined offsets, if provided */</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     offsets = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_OFFSETS);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">if</span>(offsets)</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         cpl_frameset_insert(used_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                 cpl_frameset_get_position(offsets, 0)));</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">/* Retrieve the general bad pixel mask, if provided */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     bpm = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BPM);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">if</span>(bpm)</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         cpl_frameset_insert(used_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                 cpl_frameset_get_position(bpm, 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>     <span class="comment">/* Retrieve the background bad pixel masks, if provided */</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     bpmbkg = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKGBPM);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">if</span>(bpmbkg)</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="keywordtype">int</span> iframe;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>         <span class="keywordflow">for</span>(iframe=0; iframe < cpl_frameset_get_size(bpmbkg); iframe++)</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>             cpl_frameset_insert(used_frames, cpl_frame_duplicate(</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                     cpl_frameset_get_frame(bpmbkg,iframe)));</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>         <span class="keywordflow">if</span>(cpl_frameset_get_size(bpmbkg) != cpl_frameset_get_size(objframes))</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_error(__func__,<span class="stringliteral">"Incompatible number of science and bad bkg"</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                    <span class="stringliteral">" images."</span>);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>             cpl_msg_error(__func__,<span class="stringliteral">"Supply as many bad bkg images as objects"</span>);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>             cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>             cpl_frameset_delete(used_frames);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>             cpl_frameset_delete(offsets);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>             cpl_frameset_delete(bpm);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>             cpl_frameset_delete(bpmbkg);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>             <span class="keywordflow">return</span> -1;</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="comment">/* Apply the combination */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_msg_info(__func__, <span class="stringliteral">"Apply the data recombination"</span>);</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>     <span class="keywordflow">if</span> ((combined_contrib = hawki_step_combine_apply_comb</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>              (objframes, offsets, bpm, bpmbkg)) == 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_msg_error(__func__, <span class="stringliteral">"Cannot combine the data"</span>);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         cpl_frameset_delete(used_frames);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         <span class="keywordflow">if</span>(offsets != NULL)</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>             cpl_frameset_delete(offsets);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>         <span class="keywordflow">if</span>(bpm != NULL)</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             cpl_frameset_delete(bpm);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Get both the combination and the contribution map */</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     combined   = combined_contrib;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     contrib_map = combined_contrib + HAWKI_NB_DETECTORS;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordflow">if</span>(offsets != NULL)</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         cpl_frameset_delete(offsets);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordflow">if</span>(bpm != NULL)</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         cpl_frameset_delete(bpm);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordflow">if</span>(bpmbkg != NULL)</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         cpl_frameset_delete(bpmbkg);</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">/* Save the products */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keywordflow">if</span> (hawki_step_combine_save(combined, contrib_map, </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                 used_frames, parlist, framelist) != 0)</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_warning(__func__, <span class="stringliteral">"Some error happened saving the data. "</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                         <span class="stringliteral">"Check permisions or disk space"</span>) ;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         <span class="keywordflow">for</span>(idet=0; idet< 2 * HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>             cpl_image_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         cpl_frameset_delete(used_frames);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         cpl_free(combined_contrib);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         <span class="keywordflow">return</span> -1 ;</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_msg_indent_less() ;</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">/* Return */</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordflow">for</span>(idet=0; idet< 2 * HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         cpl_image_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_free(combined_contrib);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_frameset_delete(used_frames);</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">/* Return */</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         <span class="keywordflow">return</span> -1 ;</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">else</span> <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="keywordtype">int</span> hawki_step_combine_retrieve_input_param</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> (cpl_parameterlist  *  parlist)</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_parameter   *   par ;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     par = NULL ;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     par = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>             <span class="stringliteral">"hawki.hawki_step_combine.offset_max"</span>);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     hawki_step_combine_config.offset_max = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     par = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>             <span class="stringliteral">"hawki.hawki_step_combine.comb_meth"</span>);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"union"</span>))</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         hawki_step_combine_config.comb_meth = CPL_GEOM_UNION;</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"inter"</span>))</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         hawki_step_combine_config.comb_meth = CPL_GEOM_INTERSECT;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"first"</span>))</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         hawki_step_combine_config.comb_meth = CPL_GEOM_FIRST;</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>     {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         cpl_msg_error(__func__, <span class="stringliteral">"Invalid combine method specified"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         <span class="keywordflow">return</span> -1;</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>     par = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>             <span class="stringliteral">"hawki.hawki_step_combine.borders"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     hawki_step_combine_config.borders = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="keywordflow">if</span>(hawki_step_combine_config.borders < 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>         cpl_msg_error(__func__, <span class="stringliteral">"Borders cannot be less than zero"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         <span class="keywordflow">return</span> -1;</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>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>             <span class="stringliteral">"hawki.hawki_step_combine.rej"</span>);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d"</span>,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                &hawki_step_combine_config.rej_low,</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                &hawki_step_combine_config.rej_high)!=2)</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> -1;</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>     par = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>             <span class="stringliteral">"hawki.hawki_step_combine.resamp_kernel"</span>);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"tanh"</span>))</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_TANH;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"sinc"</span>))</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_SINC;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"sinc2"</span>))</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_SINC2;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"lanczos"</span>))</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_LANCZOS;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"hamming"</span>))</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_HAMMING;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"hann"</span>))</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_HANN;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(sval, <span class="stringliteral">"default"</span>))</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         hawki_step_combine_config.resamp_kernel = CPL_KERNEL_DEFAULT;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <span class="keywordflow">else</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_msg_error(__func__, <span class="stringliteral">"Invalid resampling kernel specified"</span>);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         <span class="keywordflow">return</span> -1;</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>     <span class="keywordflow">return</span> 0;</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> </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> <span class="keyword">static</span> cpl_image ** hawki_step_combine_apply_comb</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> (cpl_frameset    * obj,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>  cpl_frameset    * offsets_frames,</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>  cpl_frameset    * bpm_frame,</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>  cpl_frameset    * bkg_bpm_frames)</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_image           **  combined_contrib;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     cpl_bivector        **  offsets;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     cpl_mask             *  bpm_masks[HAWKI_NB_DETECTORS];</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordtype">int</span>                     ioff;</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>(offsets_frames == 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>         cpl_bivector        *   offsets_single_chip;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         <span class="keywordflow">if</span> ((offsets_single_chip = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(obj)) == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             <span class="keywordflow">return</span> 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>         offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>             offsets[idet] =  cpl_bivector_duplicate(offsets_single_chip);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         cpl_bivector_delete(offsets_single_chip);</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">else</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>         offsets = <a class="code" href="group__hawki__load.html#gaf91b09d357b426f387123767e4a4fec1" title="Load a table containing refined offsets.">hawki_load_refined_offsets</a></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>             (cpl_frameset_get_first(offsets_frames));</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         <span class="keywordflow">if</span>(offsets == NULL)</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the refined offsets"</span>);</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>     }</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="comment">/* Get the oposite offsets. This is to change from </span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> <span class="comment">     * telescope convention to cpl convention </span></div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> <span class="comment">     * WARNING: It may appear that the img_jitter function </span></div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> <span class="comment">     * does not apply the multiplication by -1, but it really does it in </span></div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> <span class="comment">     * hawki_img_jitter_saa instead of when it reads the offsets */</span></div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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_vector_multiply_scalar(cpl_bivector_get_x(offsets[idet]), -1.0);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         cpl_vector_multiply_scalar(cpl_bivector_get_y(offsets[idet]), -1.0);</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="comment">/* Load the bpm */</span></div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <span class="keywordflow">if</span>(bpm_frame != 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>         cpl_imagelist *  bpm_images = NULL;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         bpm_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>             (cpl_frameset_get_first(bpm_frame), CPL_TYPE_INT);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <span class="keywordflow">if</span>(bpm_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the bad pixel mask"</span>);</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>             <span class="keywordflow">return</span> 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">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>             bpm_masks[idet] = cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                 (cpl_imagelist_get(bpm_images, idet), 0.5, 1.5);</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>         cpl_imagelist_delete(bpm_images);</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="comment">/* Create output object */</span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     combined_contrib = cpl_malloc(2 * HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));</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">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_imagelist   * in ;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         cpl_imagelist   * bpm_bkg_im = NULL;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>         cpl_image      ** comb_contrib_chip ;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         <span class="keywordtype">double</span>          * offs_est_x ;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         <span class="keywordtype">double</span>          * offs_est_y ;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         <span class="keywordtype">double</span>            max_x, max_y ;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         <span class="keywordtype">double</span>            off_0_x;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         <span class="keywordtype">double</span>            off_0_y;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         <span class="keywordtype">int</span>               jdet;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         <span class="keywordtype">int</span>               iframe;</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>         cpl_msg_info(__func__, <span class="stringliteral">"Combine chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         cpl_msg_indent_more() ;</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">/* Print the offsets */</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         offs_est_x = cpl_bivector_get_x_data(offsets[idet]) ;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         offs_est_y = cpl_bivector_get_y_data(offsets[idet]) ;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(offsets[idet]) ; ioff++) {</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>             cpl_msg_info(__func__,<span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>                     -offs_est_x[ioff], -offs_est_y[ioff]) ;</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> </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         <span class="comment">/* Subtract the first offset to all offsets */</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         max_x = max_y = 0.0 ;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         off_0_x = offs_est_x[0];</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         off_0_y = offs_est_y[0];</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(offsets[idet]) ; ioff++) </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>             offs_est_x[ioff] -= offs_est_x[0] ;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             offs_est_y[ioff] -= offs_est_y[0] ;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>             <span class="keywordflow">if</span> (fabs(offs_est_x[ioff]) > max_x) max_x = fabs(offs_est_x[ioff]);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>             <span class="keywordflow">if</span> (fabs(offs_est_y[ioff]) > max_y) max_y = fabs(offs_est_y[ioff]);</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>         offs_est_x[0] = offs_est_y[0] = 0.00 ;</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="comment">/* Check if the max offset is not too big */</span></div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         <span class="keywordflow">if</span> (max_x > hawki_step_combine_config.offset_max || </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                 max_y > hawki_step_combine_config.offset_max) </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_error(__func__,<span class="stringliteral">"Sorry, no support for offsets larger than %d"</span>,</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                           hawki_step_combine_config.offset_max);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>             <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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_bivector_delete(offsets[idet]);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>                 <span class="keywordflow">if</span>(bpm_frame != NULL)</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                     cpl_mask_delete(bpm_masks[idet]);</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">for</span>(jdet = 0; jdet < idet; ++jdet)</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_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);</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_free(combined_contrib);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>             <span class="keywordflow">return</span> 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>         <span class="comment">/* Load the input data */</span></div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(obj, idet+1, CPL_TYPE_FLOAT)) == NULL) {</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>,idet+1);</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>             <span class="comment">//TODO: there is probably a memory leak here. It should be checked.</span></div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>                 cpl_bivector_delete(offsets[idet]);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                 <span class="keywordflow">if</span>(bpm_frame != NULL)</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                     cpl_mask_delete(bpm_masks[idet]);</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">for</span>(jdet = 0; jdet < idet; ++jdet)</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>                 cpl_image_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);</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>             cpl_free(combined_contrib);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>             cpl_free(offsets);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>             <span class="keywordflow">return</span> NULL ;</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>         <span class="comment">/* Load the bad bkg images */</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         <span class="keywordflow">if</span>(bkg_bpm_frames != 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>             cpl_msg_info(__func__, <span class="stringliteral">"Load the bad bkg images"</span>);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>             cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>             <span class="keywordflow">if</span> ((bpm_bkg_im = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(bkg_bpm_frames, idet+1,</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                               CPL_TYPE_FLOAT)) == 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>                 cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>,idet+1);</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                 <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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_bivector_delete(offsets[idet]);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                     <span class="keywordflow">if</span>(bpm_frame != NULL)</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                         cpl_mask_delete(bpm_masks[idet]);</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>(jdet = 0; jdet < idet; ++jdet)</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_image_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                     cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);</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_free(combined_contrib);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>                 cpl_imagelist_delete(in);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>                 cpl_free(offsets);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>                 cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                 <span class="keywordflow">return</span> NULL ;</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>             cpl_msg_indent_less() ;</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>         cpl_msg_indent_less() ;</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">/* Add the general bpm or background bpms in case they were specified */</span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>         <span class="keywordflow">if</span>(bpm_frame != NULL || bkg_bpm_frames != NULL)</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">for</span>(iframe = 0 ; iframe <cpl_imagelist_get_size(in) ; ++iframe)</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>                 cpl_mask  * final_mask;</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                 cpl_image * target_image =  cpl_imagelist_get(in, iframe);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                 final_mask = cpl_mask_new(cpl_image_get_size_x(target_image),</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                                           cpl_image_get_size_y(target_image));</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                 <span class="comment">//Add the common bpm</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>                 <span class="keywordflow">if</span>(bpm_frame != NULL)</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                     cpl_mask_or(final_mask, bpm_masks[idet]);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>                 <span class="comment">//Add the background mask if provided</span></div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                 <span class="keywordflow">if</span>(bkg_bpm_frames != 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>                     cpl_mask * bpm_bkg_mask = </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                         cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                           (cpl_imagelist_get(bpm_bkg_im, iframe), 0.5, FLT_MAX);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>                     cpl_mask_or(final_mask, bpm_bkg_mask);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                     cpl_mask_delete(bpm_bkg_mask);</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_image_reject_from_mask(target_image, final_mask);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                 cpl_mask_delete(final_mask);</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>         </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>         <span class="keywordflow">if</span>(bkg_bpm_frames != NULL)</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>             cpl_imagelist_delete(bpm_bkg_im);</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">/* Apply the shift and add */</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>         cpl_msg_info(__func__, <span class="stringliteral">"Shift and add"</span>) ;</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         comb_contrib_chip = hawki_step_combine_chip(in, offsets[idet], </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>                 &(hawki_step_combine_output.combined_pos_x[idet]),</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                 &(hawki_step_combine_output.combined_pos_y[idet])) ;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         <span class="keywordflow">if</span> (comb_contrib_chip == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>             cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>             <span class="keywordflow">for</span>(jdet = 0; jdet < HAWKI_NB_DETECTORS; ++jdet)</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                 cpl_bivector_delete(offsets[jdet]);</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_image_delete(combined_contrib[idet]);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                 cpl_image_delete(combined_contrib[idet+HAWKI_NB_DETECTORS]);</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>             cpl_free(combined_contrib);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>             cpl_free(offsets);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>             <span class="keywordflow">return</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>         </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         <span class="comment">/* The cumoffset have the opposite criteria as cpl */</span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         hawki_step_combine_output.combined_cumoffset_x[idet] = </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>             hawki_step_combine_output.combined_pos_x[idet] - off_0_x;</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>         hawki_step_combine_output.combined_cumoffset_y[idet] = </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>             hawki_step_combine_output.combined_pos_y[idet] - off_0_y;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>         cpl_msg_indent_less() ;</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">/* Interpolate bad pixels */</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         hawki_step_combine_interpolate_badpix(comb_contrib_chip[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>         <span class="comment">/* Put the results in the image list */</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         combined_contrib[idet] = comb_contrib_chip[0];</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         combined_contrib[idet+HAWKI_NB_DETECTORS] = comb_contrib_chip[1];</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         cpl_free(comb_contrib_chip);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         cpl_msg_indent_less() ;</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>     <span class="comment">/* Compute the mean airmass */</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     hawki_step_combine_output.mean_airmass = <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(obj);</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">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>         cpl_bivector_delete(offsets[idet]);</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         <span class="keywordflow">if</span>(bpm_frame != NULL)</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>             cpl_mask_delete(bpm_masks[idet]);</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>     cpl_free(offsets);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     <span class="keywordflow">return</span> combined_contrib;</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> </div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span> <span class="keyword">static</span> cpl_image ** hawki_step_combine_chip(</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>         cpl_imagelist   *  in,</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         cpl_bivector    *  offsets,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>         <span class="keywordtype">double</span>          *  pos_x,</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         <span class="keywordtype">double</span>          *  pos_y)</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_image        **  combined_contrib;</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     cpl_imagelist    *   in_ext ;</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_image        *   tmp1 ;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cpl_image        *   tmp2 ;</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="keywordtype">int</span>                  nfiles, nx, ny ;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     <span class="keywordtype">int</span>                  i;</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 entries */</span></div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     <span class="keywordflow">if</span> (pos_x == NULL || pos_y == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     <span class="keywordflow">if</span> (offsets == NULL) <span class="keywordflow">return</span> 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>     <span class="comment">/* Get the number of images */</span></div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     nfiles = cpl_imagelist_get_size(in) ;</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     <span class="keywordflow">if</span> (cpl_bivector_get_size(offsets) != nfiles) {</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         cpl_msg_error(__func__, <span class="stringliteral">"Number of refined offsets in table "</span><span class="stringliteral">""</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                       <span class="stringliteral">"is different than number of frames to combine"</span>); </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         <span class="keywordflow">return</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>     </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>     <span class="comment">/* Discard the pixels on the sides */</span></div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     <span class="keywordflow">if</span> (hawki_step_combine_config.borders > 0) {</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         nx = cpl_image_get_size_x(cpl_imagelist_get(in, 0)) ;</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         ny = cpl_image_get_size_y(cpl_imagelist_get(in, 0)) ;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         in_ext = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         <span class="keywordflow">for</span> (i=0 ; i<cpl_imagelist_get_size(in) ; i++) {</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             tmp1 = cpl_imagelist_get(in, i) ;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             tmp2 = cpl_image_extract(tmp1, </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                     hawki_step_combine_config.borders+1, </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                     hawki_step_combine_config.borders+1, </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>                     nx-hawki_step_combine_config.borders, </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                     ny-hawki_step_combine_config.borders) ;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             cpl_imagelist_set(in_ext, tmp2, 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">else</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>         in_ext = cpl_imagelist_duplicate(in);</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>     <span class="comment">/* Apply the shift & add */</span></div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>     cpl_msg_info(__func__, <span class="stringliteral">"Recombine the images set"</span>) ;</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>     <span class="keywordflow">if</span> ((combined_contrib=cpl_geom_img_offset_saa(in_ext, offsets,</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>             hawki_step_combine_config.resamp_kernel, </div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             hawki_step_combine_config.rej_low,</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             hawki_step_combine_config.rej_high,</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             hawki_step_combine_config.comb_meth,</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             pos_x, pos_y)) == NULL) {</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>         <span class="keywordflow">return</span> NULL;</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_msg_indent_less();</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     *pos_x -= hawki_step_combine_config.borders;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     *pos_y -= hawki_step_combine_config.borders;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     cpl_imagelist_delete(in_ext);</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     <span class="keywordflow">return</span> combined_contrib;</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="l00875"></a><span class="lineno">  875</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_interpolate_badpix</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> (cpl_image           *  image)</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="keywordtype">int</span> nbadpixels = cpl_image_count_rejected(image); </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     <span class="keywordflow">if</span>(nbadpixels !=0)</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>         cpl_msg_info(__func__,<span class="stringliteral">"Number of pixels with no combined value available: %d "</span>,</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                      nbadpixels);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     <span class="keywordflow">if</span>(cpl_image_count_rejected(image) > 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="comment">//I use this even if DFS08929 is still not solved</span></div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         cpl_detector_interpolate_rejected(image);</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">return</span> 0;</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> </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_combine_save</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span> (cpl_image           ** combined,</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>  cpl_image           ** contrib_map,</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>  cpl_frameset        *  used_frames,</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>  cpl_parameterlist   *  parlist,</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>  cpl_frameset        *  recipe_frameset)</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>     cpl_propertylist    **  extproplists ;</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     <span class="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     cpl_propertylist    *   wcslist ;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>     <span class="keywordtype">double</span>                  crpix1, crpix2 ;</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_combine"</span> ;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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="comment">/* Get a reference frame for the WCS keys */</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>     ref_frame = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         (recipe_frameset, CPL_FRAME_GROUP_RAW) ;</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>(ref_frame == NULL)</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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get a reference frame"</span>);</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>         <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     <span class="comment">/* Create the QC lists */</span></div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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="comment">/* Initialize qclists */</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>         extproplists[idet] = cpl_propertylist_new() ;</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+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>         <span class="comment">/* Handle WCS keys */</span></div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>         wcslist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>                 cpl_frame_get_filename(ref_frame), ext_nb, HAWKI_HEADER_WCS, 0);</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">/* Update WCS and write them */</span></div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>         crpix1 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX1"</span>); </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>         crpix1 += hawki_step_combine_output.combined_pos_x[idet];</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX1"</span>, crpix1) ;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>         crpix2 = cpl_propertylist_get_double(wcslist, <span class="stringliteral">"CRPIX2"</span>); </div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>         crpix2 += hawki_step_combine_output.combined_pos_y[idet] ;</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         cpl_propertylist_update_double(wcslist, <span class="stringliteral">"CRPIX2"</span>, crpix2) ;</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         cpl_propertylist_copy_property_regexp</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>             (extproplists[idet], wcslist, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>         cpl_propertylist_delete(wcslist) ;</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="comment">/* Keywords for the relative position of the combined image */</span></div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX"</span>,</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>              hawki_step_combine_output.combined_cumoffset_x[idet]);</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED CUMOFFSETY"</span>,</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>              hawki_step_combine_output.combined_cumoffset_y[idet]);</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED POSX"</span>,</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>              hawki_step_combine_output.combined_pos_x[idet]);</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>             (extproplists[idet], <span class="stringliteral">"ESO QC COMBINED POSY"</span>,</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>              hawki_step_combine_output.combined_pos_y[idet]);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             (extproplists[idet], <span class="stringliteral">"ESO QC AIRMASS MEAN"</span>,</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>              hawki_step_combine_output.mean_airmass);</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="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         cpl_propertylist_append(extproplists[idet], inputlist);</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>         cpl_propertylist_delete(inputlist) ;</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="comment">/* Write the combined image */</span></div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(recipe_frameset,</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>                          parlist,</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>                          used_frames,</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>                          (<span class="keyword">const</span> cpl_image **)combined,</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>                          recipe_name,</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                          HAWKI_CALPRO_COMBINED,</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>                          HAWKI_PROTYPE_COMBINED, </div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                          NULL,</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>                          <span class="stringliteral">"hawki_step_combine.fits"</span>)  != 0)</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">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>             cpl_propertylist_delete(extproplists[idet]) ;</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>         cpl_free(extproplists) ;</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>         <span class="keywordflow">return</span> -1;</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> </div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>     <span class="comment">/* Write the contrib map */</span></div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>     <span class="keywordflow">if</span>(<a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(recipe_frameset,</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>                          parlist,</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>                          used_frames,</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                          (<span class="keyword">const</span> cpl_image **)contrib_map,</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                          recipe_name,</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                          HAWKI_CALPRO_COMB_CONTRIB_MAP,</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>                          HAWKI_PROTYPE_COMB_CONTRIB_MAP,</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>                          NULL,</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>                          <span class="stringliteral">"hawki_step_combine_contrib_map.fits"</span>)  != 0)</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">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>             cpl_propertylist_delete(extproplists[idet]);</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_free(extproplists) ;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         cpl_propertylist_delete(extproplists[idet]) ;</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>     cpl_free(extproplists) ;</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">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>         <span class="keywordflow">return</span> 1;</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">return</span>  0;</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><!-- 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/hawki__step__detect__obj_8c_source.html b/html/hawki__step__detect__obj_8c_source.html
index 72336a8..3be3062 100644
--- a/html/hawki__step__detect__obj_8c_source.html
+++ b/html/hawki__step__detect__obj_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_detect_obj.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,942 +40,943 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_detect_obj.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_detect_obj.c,v 1.27 2012/11/30 14:50: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/30 14:50:51 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.27 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_calib.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_obj_det.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_mask.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00054"></a>00054 <span class="comment">                            Functions prototypes</span>
-<a name="l00055"></a>00055 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00059"></a>00059 <span class="preprocessor">#endif</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_create(cpl_plugin *) ;
-<a name="l00063"></a>00063 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_exec(cpl_plugin *) ;
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_destroy(cpl_plugin *) ;
-<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_init_output(<span class="keywordtype">void</span>);
-<a name="l00068"></a>00068 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_get_pscale
-<a name="l00069"></a>00069 (cpl_frameset * combframes);
-<a name="l00070"></a>00070 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_retrieve_input_param
-<a name="l00071"></a>00071 (cpl_parameterlist  *  parlist);
-<a name="l00072"></a>00072 <span class="keyword">static</span> cpl_apertures  ** hawki_step_detect_obj_mask_and_apertures
-<a name="l00073"></a>00073 (cpl_frameset    *  combframes,
-<a name="l00074"></a>00074  cpl_image       ** mask_image,
-<a name="l00075"></a>00075  cpl_image       ** comb_image);
-<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_aper_params
-<a name="l00077"></a>00077 (cpl_image      **  combined_images, 
-<a name="l00078"></a>00078  cpl_apertures  **  apertures,
-<a name="l00079"></a>00079  cpl_table      **  obj_charac);
-<a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_save
-<a name="l00081"></a>00081 (cpl_image           **  mask_images,
-<a name="l00082"></a>00082  cpl_table           **  obj_charac,
-<a name="l00083"></a>00083  cpl_propertylist    **  obj_stats,
-<a name="l00084"></a>00084  cpl_parameterlist   *   parlist,
-<a name="l00085"></a>00085  cpl_frameset        *   framelist);
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00088"></a>00088 <span class="comment">                            Static variables</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="keyword">struct </span>
-<a name="l00092"></a>00092 {
-<a name="l00093"></a>00093     <span class="comment">/* Inputs */</span>
-<a name="l00094"></a>00094     <span class="keywordtype">double</span> sigma_det;
-<a name="l00095"></a>00095     <span class="keywordtype">int</span>    growing_radius;
-<a name="l00096"></a>00096 } hawki_step_detect_obj_config;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00099"></a>00099 {
-<a name="l00100"></a>00100     <span class="comment">/* Outputs */</span>
-<a name="l00101"></a>00101     <span class="keywordtype">double</span>          pixscale;
-<a name="l00102"></a>00102     <span class="keywordtype">double</span>          iq[HAWKI_NB_DETECTORS] ;
-<a name="l00103"></a>00103     <span class="keywordtype">int</span>             nbobjs[HAWKI_NB_DETECTORS] ;
-<a name="l00104"></a>00104     <span class="keywordtype">double</span>          fwhm_pix[HAWKI_NB_DETECTORS] ;
-<a name="l00105"></a>00105     <span class="keywordtype">double</span>          fwhm_arcsec[HAWKI_NB_DETECTORS] ;
-<a name="l00106"></a>00106     <span class="keywordtype">double</span>          fwhm_mode[HAWKI_NB_DETECTORS] ;
-<a name="l00107"></a>00107     <span class="keywordtype">double</span>          pos_x[HAWKI_NB_DETECTORS] ;
-<a name="l00108"></a>00108     <span class="keywordtype">double</span>          pos_y[HAWKI_NB_DETECTORS] ;
-<a name="l00109"></a>00109 } hawki_step_detect_obj_output;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_detect_obj_description[] =
-<a name="l00112"></a>00112 <span class="stringliteral">"hawki_step_detect_obj -- hawki detect objects recipe.\n"</span>
-<a name="l00113"></a>00113 <span class="stringliteral">"This recipe detects objects from the combined image creating a mask\n"</span>
-<a name="l00114"></a>00114 <span class="stringliteral">"and a list of object properties\n"</span>
-<a name="l00115"></a>00115 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00116"></a>00116 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"combined.fits "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"\n"</span>
-<a name="l00118"></a>00118 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00119"></a>00119 <span class="stringliteral">"hawki_step_detect_obj_mask.fits ("</span>HAWKI_CALPRO_OBJ_MASK<span class="stringliteral">"): A mask with 1 where the objects are present and 0 elsewhere\n"</span>
-<a name="l00120"></a>00120 <span class="stringliteral">"hawki_step_detect_obj_stars.fits ("</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"): A table with the detected objects characteristics\n"</span>
-<a name="l00121"></a>00121 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00122"></a>00122 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00123"></a>00123 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00128"></a>00128 <span class="comment">                                Functions code</span>
-<a name="l00129"></a>00129 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00139"></a>00139 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00140"></a>00140 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00141"></a>00141 {
-<a name="l00142"></a>00142     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00143"></a>00143     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     cpl_plugin_init(plugin,
-<a name="l00146"></a>00146                     CPL_PLUGIN_API,
-<a name="l00147"></a>00147                     HAWKI_BINARY_VERSION,
-<a name="l00148"></a>00148                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00149"></a>00149                     <span class="stringliteral">"hawki_step_detect_obj"</span>,
-<a name="l00150"></a>00150                     <span class="stringliteral">"Object detection recipe"</span>,
-<a name="l00151"></a>00151                     hawki_step_detect_obj_description,
-<a name="l00152"></a>00152                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00153"></a>00153                     PACKAGE_BUGREPORT,  
-<a name="l00154"></a>00154                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00155"></a>00155                     hawki_step_detect_obj_create,
-<a name="l00156"></a>00156                     hawki_step_detect_obj_exec,
-<a name="l00157"></a>00157                     hawki_step_detect_obj_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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00173"></a>00173 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00174"></a>00174 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_create(cpl_plugin * plugin)
-<a name="l00175"></a>00175 {
-<a name="l00176"></a>00176     cpl_recipe      * recipe ;
-<a name="l00177"></a>00177     cpl_parameter   * p ;
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00185"></a>00185     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00186"></a>00186     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00190"></a>00190     <span class="comment">/* --sigma_det */</span>
-<a name="l00191"></a>00191     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_detect_obj.sigma_det"</span>, 
-<a name="l00192"></a>00192                                 CPL_TYPE_DOUBLE, <span class="stringliteral">"detection level"</span>,
-<a name="l00193"></a>00193                                 <span class="stringliteral">"hawki.hawki_step_detect_obj"</span>, 6.);
-<a name="l00194"></a>00194     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_det"</span>);
-<a name="l00195"></a>00195     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00196"></a>00196     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/* --growing_radius */</span>
-<a name="l00199"></a>00199     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_detect_obj.growing_radius"</span>, 
-<a name="l00200"></a>00200                                 CPL_TYPE_INT,
-<a name="l00201"></a>00201                                 <span class="stringliteral">"radius of convolution kernel to apply to objects"</span>,
-<a name="l00202"></a>00202                                 <span class="stringliteral">"hawki.hawki_step_detect_obj"</span>, 5);
-<a name="l00203"></a>00203     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"growing_radius"</span>);
-<a name="l00204"></a>00204     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00205"></a>00205     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     <span class="comment">/* Return */</span>
-<a name="l00208"></a>00208     <span class="keywordflow">return</span> 0;
-<a name="l00209"></a>00209 }
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00217"></a>00217 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00218"></a>00218 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_exec(cpl_plugin * plugin)
-<a name="l00219"></a>00219 {
-<a name="l00220"></a>00220     cpl_recipe  *   recipe ;
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00223"></a>00223     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00224"></a>00224         recipe = (cpl_recipe *)plugin ;
-<a name="l00225"></a>00225     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/* Issue a banner */</span>
-<a name="l00228"></a>00228     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="keywordflow">return</span> hawki_step_detect_obj(recipe->parameters, recipe->frames) ;
-<a name="l00231"></a>00231 }
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00239"></a>00239 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00240"></a>00240 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_destroy(cpl_plugin * plugin)
-<a name="l00241"></a>00241 {
-<a name="l00242"></a>00242     cpl_recipe  *   recipe ;
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00250"></a>00250     <span class="keywordflow">return</span> 0 ;
-<a name="l00251"></a>00251 }
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00260"></a>00260 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00261"></a>00261 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj(
-<a name="l00262"></a>00262         cpl_parameterlist   *   parlist, 
-<a name="l00263"></a>00263         cpl_frameset        *   framelist)
-<a name="l00264"></a>00264 {
-<a name="l00265"></a>00265     cpl_frameset     *   combframes;
-<a name="l00266"></a>00266     cpl_image        **  mask_image;
-<a name="l00267"></a>00267     cpl_image        **  comb_image;
-<a name="l00268"></a>00268     cpl_apertures    **  apertures;
-<a name="l00269"></a>00269     cpl_table        **  obj_charac;
-<a name="l00270"></a>00270     cpl_propertylist **  obj_stats;
-<a name="l00271"></a>00271     <span class="keywordtype">int</span>                  idet;
-<a name="l00272"></a>00272     
-<a name="l00273"></a>00273     <span class="comment">/* Initialise */</span>
-<a name="l00274"></a>00274     hawki_step_detect_obj_init_output();
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00277"></a>00277     <span class="keywordflow">if</span>(hawki_step_detect_obj_retrieve_input_param(parlist))
-<a name="l00278"></a>00278     {
-<a name="l00279"></a>00279         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00280"></a>00280         <span class="keywordflow">return</span> -1;
-<a name="l00281"></a>00281     }
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00284"></a>00284     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00285"></a>00285         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00286"></a>00286         <span class="keywordflow">return</span> -1 ;
-<a name="l00287"></a>00287     }
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00290"></a>00290     combframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_COMBINED) ;
-<a name="l00291"></a>00291     <span class="keywordflow">if</span> (combframes == NULL) 
-<a name="l00292"></a>00292     {
-<a name="l00293"></a>00293         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find combined images in the input (%s)"</span>,
-<a name="l00294"></a>00294                 HAWKI_CALPRO_COMBINED);
-<a name="l00295"></a>00295         <span class="keywordflow">return</span> -1 ;
-<a name="l00296"></a>00296     }
-<a name="l00297"></a>00297     <span class="keywordflow">if</span> (cpl_frameset_get_size(combframes) != 1)
-<a name="l00298"></a>00298     {
-<a name="l00299"></a>00299         cpl_msg_error(__func__, <span class="stringliteral">"Only one combined image must be provided"</span>);
-<a name="l00300"></a>00300         <span class="keywordflow">return</span> -1 ;
-<a name="l00301"></a>00301     }
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     <span class="comment">/* Get info from the headers */</span>
-<a name="l00304"></a>00304     hawki_step_detect_obj_get_pscale(combframes);
-<a name="l00305"></a>00305     
-<a name="l00306"></a>00306     <span class="comment">/* Get the mask with the points above the background </span>
-<a name="l00307"></a>00307 <span class="comment">     * and the associated apertures*/</span>
-<a name="l00308"></a>00308     cpl_msg_info(__func__, <span class="stringliteral">"Getting the object masks"</span>) ;
-<a name="l00309"></a>00309     mask_image = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l00310"></a>00310     comb_image = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l00311"></a>00311     apertures =  hawki_step_detect_obj_mask_and_apertures
-<a name="l00312"></a>00312         (combframes, mask_image, comb_image);
-<a name="l00313"></a>00313     <span class="keywordflow">if</span>(apertures == NULL)
-<a name="l00314"></a>00314     {
-<a name="l00315"></a>00315         cpl_msg_error(__func__,<span class="stringliteral">"Could not detect objects in image"</span>);
-<a name="l00316"></a>00316         cpl_frameset_delete(combframes);
-<a name="l00317"></a>00317         cpl_free(mask_image);
-<a name="l00318"></a>00318         cpl_free(comb_image);
-<a name="l00319"></a>00319         <span class="keywordflow">return</span> -1;
-<a name="l00320"></a>00320     }
-<a name="l00321"></a>00321     
-<a name="l00322"></a>00322     <span class="comment">/* Get object characterizations and statistics */</span>
-<a name="l00323"></a>00323     cpl_msg_info(__func__, <span class="stringliteral">"Getting object parameters"</span>) ;
-<a name="l00324"></a>00324     obj_charac = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *)) ;
-<a name="l00325"></a>00325     obj_stats  = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));
-<a name="l00326"></a>00326     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00327"></a>00327     {
-<a name="l00328"></a>00328         obj_charac[idet] = cpl_table_new
-<a name="l00329"></a>00329             (cpl_apertures_get_size(apertures[idet]));
-<a name="l00330"></a>00330         obj_stats[idet] = cpl_propertylist_new();
-<a name="l00331"></a>00331     }
-<a name="l00332"></a>00332     hawki_step_detect_obj_aper_params(comb_image, apertures, obj_charac);
-<a name="l00333"></a>00333  
-<a name="l00334"></a>00334     <span class="comment">/* Statistics of the detected objects in the QC */</span>
-<a name="l00335"></a>00335     <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>(obj_charac, obj_stats);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="comment">/* Save the products */</span>
-<a name="l00338"></a>00338     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00339"></a>00339     <span class="keywordflow">if</span> (hawki_step_detect_obj_save(mask_image, obj_charac, obj_stats,
-<a name="l00340"></a>00340                                    parlist, framelist) == -1)
-<a name="l00341"></a>00341     {
-<a name="l00342"></a>00342         cpl_msg_warning(__func__, <span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00343"></a>00343                         <span class="stringliteral">"Check permisions or disk space"</span>) ;
-<a name="l00344"></a>00344         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00345"></a>00345         {
-<a name="l00346"></a>00346             cpl_table_delete(obj_charac[idet]);
-<a name="l00347"></a>00347             cpl_propertylist_delete(obj_stats[idet]);
-<a name="l00348"></a>00348             cpl_apertures_delete(apertures[idet]);
-<a name="l00349"></a>00349         }
-<a name="l00350"></a>00350         cpl_free(apertures);
-<a name="l00351"></a>00351         cpl_free(obj_charac);
-<a name="l00352"></a>00352         cpl_free(obj_stats);
-<a name="l00353"></a>00353         cpl_frameset_delete(combframes);
-<a name="l00354"></a>00354         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00355"></a>00355         {
-<a name="l00356"></a>00356             cpl_image_delete(mask_image[idet]);
-<a name="l00357"></a>00357             cpl_image_delete(comb_image[idet]);
-<a name="l00358"></a>00358         }
-<a name="l00359"></a>00359         cpl_free(mask_image);
-<a name="l00360"></a>00360         cpl_free(comb_image);
-<a name="l00361"></a>00361         <span class="keywordflow">return</span> -1 ;
-<a name="l00362"></a>00362     }
-<a name="l00363"></a>00363     
-<a name="l00364"></a>00364     <span class="comment">/* Return */</span>
-<a name="l00365"></a>00365     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00366"></a>00366     {
-<a name="l00367"></a>00367         cpl_table_delete(obj_charac[idet]);
-<a name="l00368"></a>00368         cpl_propertylist_delete(obj_stats[idet]);
-<a name="l00369"></a>00369         cpl_apertures_delete(apertures[idet]);
-<a name="l00370"></a>00370         cpl_image_delete(mask_image[idet]);
-<a name="l00371"></a>00371         cpl_image_delete(comb_image[idet]);
-<a name="l00372"></a>00372     }
-<a name="l00373"></a>00373     cpl_free(apertures);
-<a name="l00374"></a>00374     cpl_free(obj_charac);
-<a name="l00375"></a>00375     cpl_free(obj_stats);
-<a name="l00376"></a>00376     cpl_frameset_delete(combframes);
-<a name="l00377"></a>00377     cpl_free(mask_image);
-<a name="l00378"></a>00378     cpl_free(comb_image);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="comment">/* Return */</span>
-<a name="l00381"></a>00381     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00382"></a>00382     {
-<a name="l00383"></a>00383         cpl_msg_error(__func__,
-<a name="l00384"></a>00384                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00385"></a>00385         <span class="keywordflow">return</span> -1 ;
-<a name="l00386"></a>00386     }
-<a name="l00387"></a>00387     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00388"></a>00388 }
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390 <span class="keywordtype">int</span> hawki_step_detect_obj_retrieve_input_param
-<a name="l00391"></a>00391 (cpl_parameterlist  *  parlist)
-<a name="l00392"></a>00392 {
-<a name="l00393"></a>00393     cpl_parameter   *   par ;
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     par = NULL ;
-<a name="l00396"></a>00396     par = cpl_parameterlist_find
-<a name="l00397"></a>00397         (parlist, <span class="stringliteral">"hawki.hawki_step_detect_obj.sigma_det"</span>);
-<a name="l00398"></a>00398     hawki_step_detect_obj_config.sigma_det = cpl_parameter_get_double(par);
-<a name="l00399"></a>00399     par = cpl_parameterlist_find
-<a name="l00400"></a>00400         (parlist, <span class="stringliteral">"hawki.hawki_step_detect_obj.growing_radius"</span>);
-<a name="l00401"></a>00401     hawki_step_detect_obj_config.growing_radius = cpl_parameter_get_int(par);
-<a name="l00402"></a>00402     <span class="keywordflow">if</span>(hawki_step_detect_obj_config.growing_radius > 100)
-<a name="l00403"></a>00403     {
-<a name="l00404"></a>00404         cpl_msg_error(__func__,<span class="stringliteral">"The maximum radius allowed is 100"</span>);
-<a name="l00405"></a>00405         <span class="keywordflow">return</span> -1;
-<a name="l00406"></a>00406     }
-<a name="l00407"></a>00407     <span class="keywordflow">if</span>(hawki_step_detect_obj_config.sigma_det <= 0 )
-<a name="l00408"></a>00408     {
-<a name="l00409"></a>00409         cpl_msg_error(__func__,<span class="stringliteral">"Detection sigma has to be greater than 0"</span>);
-<a name="l00410"></a>00410         <span class="keywordflow">return</span> -1;
-<a name="l00411"></a>00411     }
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     <span class="keywordflow">return</span> 0;
-<a name="l00414"></a>00414 }
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00428"></a>00428 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00429"></a>00429 <span class="keyword">static</span> cpl_apertures  ** hawki_step_detect_obj_mask_and_apertures
-<a name="l00430"></a>00430 (cpl_frameset    *  combframes,
-<a name="l00431"></a>00431  cpl_image       ** mask_image,
-<a name="l00432"></a>00432  cpl_image       ** comb_image)
-<a name="l00433"></a>00433 {
-<a name="l00434"></a>00434     cpl_apertures   **  apertures;
-<a name="l00435"></a>00435     <span class="keywordtype">int</span>                 idet;
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     <span class="comment">/* Create output object */</span>
-<a name="l00438"></a>00438     apertures = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_apertures *));
-<a name="l00439"></a>00439   
-<a name="l00440"></a>00440     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00441"></a>00441     cpl_msg_indent_more();
-<a name="l00442"></a>00442     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00443"></a>00443     {
-<a name="l00444"></a>00444         cpl_image  * chip_image;
-<a name="l00445"></a>00445         cpl_image  * chip_image_sort;
-<a name="l00446"></a>00446         cpl_mask   * object_mask;
-<a name="l00447"></a>00447         cpl_mask   * kernel_op;
-<a name="l00448"></a>00448         cpl_matrix * kernel;
-<a name="l00449"></a>00449         cpl_image  * labels;
-<a name="l00450"></a>00450         cpl_size     nobj;
-<a name="l00451"></a>00451         <span class="keywordtype">double</span>       bkg_level;
-<a name="l00452"></a>00452         <span class="keywordtype">double</span>       bkg_noise;
-<a name="l00453"></a>00453         <span class="keywordtype">double</span>       threshold;
-<a name="l00454"></a>00454         <span class="keywordtype">int</span>          kernel_size;
-<a name="l00455"></a>00455         <span class="keywordtype">int</span>          ix;
-<a name="l00456"></a>00456         <span class="keywordtype">int</span>          iy;
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458         cpl_msg_info(__func__, <span class="stringliteral">"Detecting objects on chip number %d"</span>, idet+1) ;
-<a name="l00459"></a>00459         cpl_msg_indent_more();
-<a name="l00460"></a>00460         
-<a name="l00461"></a>00461         <span class="comment">/* Load the input data */</span>
-<a name="l00462"></a>00462         cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;
-<a name="l00463"></a>00463         chip_image = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(combframes, 0, idet+1, CPL_TYPE_FLOAT);
-<a name="l00464"></a>00464         <span class="keywordflow">if</span> (chip_image == NULL) 
-<a name="l00465"></a>00465         {
-<a name="l00466"></a>00466             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;
-<a name="l00467"></a>00467             cpl_msg_indent_less() ;
-<a name="l00468"></a>00468             cpl_free(apertures);
-<a name="l00469"></a>00469             <span class="keywordflow">return</span> NULL ;
-<a name="l00470"></a>00470         }
-<a name="l00471"></a>00471         
-<a name="l00472"></a>00472         <span class="comment">/* Subtract the median of the frame first */</span>
-<a name="l00473"></a>00473         chip_image_sort = cpl_image_duplicate(chip_image);
-<a name="l00474"></a>00474         bkg_level = cpl_image_get_median(chip_image);
-<a name="l00475"></a>00475         bkg_noise = <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(chip_image_sort); 
-<a name="l00476"></a>00476         cpl_image_delete(chip_image_sort);
-<a name="l00477"></a>00477         threshold = bkg_level + hawki_step_detect_obj_config.sigma_det * bkg_noise;        
-<a name="l00478"></a>00478         cpl_msg_info(__func__, <span class="stringliteral">"Background:       %f"</span>,bkg_level);
-<a name="l00479"></a>00479         cpl_msg_info(__func__, <span class="stringliteral">"Background noise: %f"</span>,bkg_noise);
-<a name="l00480"></a>00480         
-<a name="l00481"></a>00481         <span class="comment">/* Create the mask */</span>
-<a name="l00482"></a>00482         cpl_msg_info(__func__, <span class="stringliteral">"Mask creation with threshold: %f"</span>,threshold);
-<a name="l00483"></a>00483         object_mask = cpl_mask_threshold_image_create
-<a name="l00484"></a>00484             (chip_image, threshold, DBL_MAX);
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486         <span class="comment">/* Apply a morphological opening to remove single pixel detections */</span>
-<a name="l00487"></a>00487         cpl_msg_info(__func__, <span class="stringliteral">"Removing single pixel detections"</span>);
-<a name="l00488"></a>00488         kernel_op = cpl_mask_new(3, 3); 
-<a name="l00489"></a>00489         cpl_mask_not(kernel_op);
-<a name="l00490"></a>00490         <span class="keywordflow">if</span> (cpl_mask_filter(object_mask, object_mask, kernel_op, 
-<a name="l00491"></a>00491                             CPL_FILTER_OPENING, 
-<a name="l00492"></a>00492                             CPL_BORDER_ZERO) != CPL_ERROR_NONE)
-<a name="l00493"></a>00493         {
-<a name="l00494"></a>00494             cpl_mask_delete(object_mask);
-<a name="l00495"></a>00495             cpl_mask_delete(kernel_op);
-<a name="l00496"></a>00496             <span class="keywordflow">return</span> NULL;
-<a name="l00497"></a>00497         }
-<a name="l00498"></a>00498         cpl_mask_delete(kernel_op);
-<a name="l00499"></a>00499         
-<a name="l00500"></a>00500         <span class="comment">/* Apply dilation to the mask */</span>
-<a name="l00501"></a>00501         <span class="keywordflow">if</span>(hawki_step_detect_obj_config.growing_radius>0)
-<a name="l00502"></a>00502         {
-<a name="l00503"></a>00503             cpl_msg_info(__func__, <span class="stringliteral">"Growing the mask with radius %d"</span>,
-<a name="l00504"></a>00504                     hawki_step_detect_obj_config.growing_radius);
-<a name="l00505"></a>00505             kernel_size = hawki_step_detect_obj_config.growing_radius*2+1;
-<a name="l00506"></a>00506             kernel = cpl_matrix_new(kernel_size, kernel_size);
-<a name="l00507"></a>00507             <span class="keywordflow">for</span>(ix=0;ix<kernel_size;++ix)
-<a name="l00508"></a>00508                 <span class="keywordflow">for</span>(iy=0;iy<kernel_size;++iy)
-<a name="l00509"></a>00509                 {
-<a name="l00510"></a>00510                     <span class="keywordtype">double</span> xpos = ix+0.5-kernel_size/2.;
-<a name="l00511"></a>00511                     <span class="keywordtype">double</span> ypos = iy+0.5-kernel_size/2.;
-<a name="l00512"></a>00512                     <span class="keywordtype">double</span> kernel_func = 1-sqrt(xpos*xpos+ypos*ypos)/
-<a name="l00513"></a>00513                     hawki_step_detect_obj_config.growing_radius;
-<a name="l00514"></a>00514                     <span class="keywordflow">if</span>(kernel_func<0)
-<a name="l00515"></a>00515                         kernel_func = 0;
-<a name="l00516"></a>00516                     cpl_matrix_set(kernel, ix, iy, kernel_func);
-<a name="l00517"></a>00517                 }
-<a name="l00518"></a>00518             <span class="keywordflow">if</span> (<a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(object_mask, kernel) != CPL_ERROR_NONE) {
-<a name="l00519"></a>00519                 cpl_mask_delete(object_mask) ;
-<a name="l00520"></a>00520                 cpl_matrix_delete(kernel) ;
-<a name="l00521"></a>00521                 <span class="keywordflow">return</span> NULL;
-<a name="l00522"></a>00522             }
-<a name="l00523"></a>00523             cpl_matrix_delete(kernel);
-<a name="l00524"></a>00524         }
-<a name="l00525"></a>00525     
-<a name="l00526"></a>00526         <span class="comment">/* Put the mask and the chip image in the imagelist */</span>
-<a name="l00527"></a>00527         mask_image[idet] =  cpl_image_new_from_mask(object_mask);
-<a name="l00528"></a>00528         comb_image[idet] =  chip_image;
-<a name="l00529"></a>00529         
-<a name="l00530"></a>00530         <span class="comment">/* Labelise the different detected apertures */</span>
-<a name="l00531"></a>00531         cpl_msg_info(__func__, <span class="stringliteral">"Labelise mask"</span>) ;
-<a name="l00532"></a>00532         labels = cpl_image_labelise_mask_create(object_mask, &nobj);
-<a name="l00533"></a>00533         <span class="keywordflow">if</span> (labels == NULL) 
-<a name="l00534"></a>00534         {
-<a name="l00535"></a>00535             <span class="keywordtype">int</span> jdet;
-<a name="l00536"></a>00536             cpl_free(apertures);
-<a name="l00537"></a>00537             cpl_mask_delete(object_mask);
-<a name="l00538"></a>00538             <span class="keywordflow">for</span> (jdet=0 ; jdet<idet + 1 ; jdet++)
-<a name="l00539"></a>00539             {
-<a name="l00540"></a>00540                 cpl_image_delete(mask_image[jdet]);
-<a name="l00541"></a>00541                 cpl_image_delete(comb_image[jdet]);
-<a name="l00542"></a>00542             }
-<a name="l00543"></a>00543         }
-<a name="l00544"></a>00544         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects detected: %"</span>CPL_SIZE_FORMAT,
-<a name="l00545"></a>00545                      nobj) ;
-<a name="l00546"></a>00546 
-<a name="l00547"></a>00547         <span class="comment">/* Create the detected apertures list */</span>
-<a name="l00548"></a>00548         cpl_msg_info(__func__, <span class="stringliteral">"Create apertures"</span>) ;
-<a name="l00549"></a>00549         apertures[idet] = cpl_apertures_new_from_image(chip_image, labels);
-<a name="l00550"></a>00550         <span class="keywordflow">if</span> (apertures[idet] == NULL)
-<a name="l00551"></a>00551         {
-<a name="l00552"></a>00552             <span class="keywordtype">int</span> jdet;
-<a name="l00553"></a>00553             cpl_free(apertures);
-<a name="l00554"></a>00554             cpl_mask_delete(object_mask);
-<a name="l00555"></a>00555             <span class="keywordflow">for</span> (jdet=0 ; jdet<idet + 1 ; jdet++)
-<a name="l00556"></a>00556             {
-<a name="l00557"></a>00557                 cpl_image_delete(mask_image[jdet]);
-<a name="l00558"></a>00558                 cpl_image_delete(comb_image[jdet]);
-<a name="l00559"></a>00559             }
-<a name="l00560"></a>00560             <span class="keywordflow">return</span> NULL;
-<a name="l00561"></a>00561         }
-<a name="l00562"></a>00562         
-<a name="l00563"></a>00563         <span class="comment">/* Free */</span>
-<a name="l00564"></a>00564         cpl_mask_delete(object_mask);
-<a name="l00565"></a>00565         cpl_image_delete(labels);
-<a name="l00566"></a>00566         cpl_msg_indent_less();
-<a name="l00567"></a>00567     }
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569     <span class="comment">/* Free and return */</span>
-<a name="l00570"></a>00570     cpl_msg_indent_less();
-<a name="l00571"></a>00571     <span class="keywordflow">return</span> apertures;
-<a name="l00572"></a>00572 }
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00581"></a>00581 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00582"></a>00582 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_aper_params
-<a name="l00583"></a>00583 (cpl_image      **  combined_images, 
-<a name="l00584"></a>00584  cpl_apertures  **  apertures,
-<a name="l00585"></a>00585  cpl_table      **  obj_charac)
-<a name="l00586"></a>00586 {
-<a name="l00587"></a>00587     <span class="keywordtype">int</span>                 nb_objs ;
-<a name="l00588"></a>00588     <span class="keywordtype">double</span>              angle ;
-<a name="l00589"></a>00589     <span class="keywordtype">double</span>          *   fwhms_x ;
-<a name="l00590"></a>00590     <span class="keywordtype">double</span>          *   fwhms_y ;
-<a name="l00591"></a>00591     cpl_bivector    *   iqe ;
-<a name="l00592"></a>00592     <span class="keywordtype">int</span>                 nb_good ;
-<a name="l00593"></a>00593     cpl_vector      *   fwhms_good ;
-<a name="l00594"></a>00594     <span class="keywordtype">double</span>          *   fwhms_good_data ;
-<a name="l00595"></a>00595     <span class="keywordtype">double</span>              f_min, f_max, fr, fx, fy ;
-<a name="l00596"></a>00596     <span class="keywordtype">int</span>                 chip;
-<a name="l00597"></a>00597     <span class="keywordtype">int</span>                 iobj;
-<a name="l00598"></a>00598     <span class="keywordtype">int</span>                 j;
-<a name="l00599"></a>00599     
-<a name="l00600"></a>00600     <span class="comment">/* Initialise */</span>
-<a name="l00601"></a>00601     <span class="keywordtype">double</span>              seeing_min_arcsec = 0.1 ;
-<a name="l00602"></a>00602     <span class="keywordtype">double</span>              seeing_max_arcsec = 5.0 ;
-<a name="l00603"></a>00603     <span class="keywordtype">double</span>              seeing_fwhm_var   = 0.2 ;
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     <span class="comment">/* Check entries */</span>
-<a name="l00606"></a>00606     <span class="keywordflow">if</span> (combined_images  == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00607"></a>00607     <span class="keywordflow">if</span> (obj_charac       == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609     <span class="comment">/* Loop on the HAWK-I detectors */</span>
-<a name="l00610"></a>00610     cpl_msg_indent_more();
-<a name="l00611"></a>00611     <span class="keywordflow">for</span> (chip=0 ; chip<HAWKI_NB_DETECTORS ; chip++) 
-<a name="l00612"></a>00612     {
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614         <span class="comment">/* Number of detected objects */</span>
-<a name="l00615"></a>00615         nb_objs = cpl_apertures_get_size(apertures[chip]);
-<a name="l00616"></a>00616         cpl_msg_info(__func__, <span class="stringliteral">"%d objects detected on chip %d"</span>,nb_objs,chip+1);
-<a name="l00617"></a>00617         hawki_step_detect_obj_output.nbobjs[chip] = nb_objs ;
-<a name="l00618"></a>00618         fwhms_x = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;
-<a name="l00619"></a>00619         fwhms_y = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;
-<a name="l00620"></a>00620         
-<a name="l00621"></a>00621         <span class="comment">/* Initialize the output table */</span>
-<a name="l00622"></a>00622         cpl_table_set_size(obj_charac[chip], nb_objs);
-<a name="l00623"></a>00623         cpl_table_new_column
-<a name="l00624"></a>00624             (obj_charac[chip], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);
-<a name="l00625"></a>00625         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSX,<span class="stringliteral">"pix"</span>);
-<a name="l00626"></a>00626         cpl_table_new_column
-<a name="l00627"></a>00627             (obj_charac[chip], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);
-<a name="l00628"></a>00628         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSY,<span class="stringliteral">"pix"</span>);
-<a name="l00629"></a>00629         cpl_table_new_column
-<a name="l00630"></a>00630             (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, CPL_TYPE_DOUBLE);
-<a name="l00631"></a>00631         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_ANGLE,<span class="stringliteral">"grad"</span>);
-<a name="l00632"></a>00632         cpl_table_new_column
-<a name="l00633"></a>00633             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, CPL_TYPE_DOUBLE);
-<a name="l00634"></a>00634         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MAJAX,<span class="stringliteral">"pix"</span>);
-<a name="l00635"></a>00635         cpl_table_new_column
-<a name="l00636"></a>00636             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, CPL_TYPE_DOUBLE);
-<a name="l00637"></a>00637         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MINAX,<span class="stringliteral">"pix"</span>);
-<a name="l00638"></a>00638         cpl_table_new_column
-<a name="l00639"></a>00639             (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, CPL_TYPE_DOUBLE);
-<a name="l00640"></a>00640         cpl_table_new_column
-<a name="l00641"></a>00641             (obj_charac[chip], HAWKI_COL_OBJ_FLUX, CPL_TYPE_DOUBLE);
-<a name="l00642"></a>00642         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FLUX,<span class="stringliteral">"ADU"</span>);
-<a name="l00643"></a>00643         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++)
-<a name="l00644"></a>00644         {
-<a name="l00645"></a>00645             <span class="comment">/* Fill with the already known information */</span>
-<a name="l00646"></a>00646             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSX, iobj, 
-<a name="l00647"></a>00647                                  cpl_apertures_get_centroid_x(apertures[chip],
-<a name="l00648"></a>00648                                                               iobj+1));
-<a name="l00649"></a>00649             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSY, iobj, 
-<a name="l00650"></a>00650                                  cpl_apertures_get_centroid_y(apertures[chip],
-<a name="l00651"></a>00651                                                               iobj+1));
-<a name="l00652"></a>00652             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_FLUX, iobj, 
-<a name="l00653"></a>00653                                  cpl_apertures_get_flux(apertures[chip],
-<a name="l00654"></a>00654                                                         iobj+1));
-<a name="l00655"></a>00655             <span class="comment">/* Compute the FWHM informations */</span>
-<a name="l00656"></a>00656             iqe = cpl_image_iqe(combined_images[chip], 
-<a name="l00657"></a>00657                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(apertures[chip], iobj+1)- 10,
-<a name="l00658"></a>00658                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(apertures[chip], iobj+1)- 10,
-<a name="l00659"></a>00659                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(apertures[chip], iobj+1)+ 10,
-<a name="l00660"></a>00660                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(apertures[chip], iobj+1)+ 10);
-<a name="l00661"></a>00661             <span class="keywordflow">if</span> (iqe == NULL)
-<a name="l00662"></a>00662             {
-<a name="l00663"></a>00663                 cpl_error_reset() ;
-<a name="l00664"></a>00664                 cpl_msg_debug(__func__, <span class="stringliteral">"Cannot get FWHM for obj at pos %g %g"</span>,
-<a name="l00665"></a>00665                               cpl_apertures_get_centroid_x(apertures[chip],
-<a name="l00666"></a>00666                                                            iobj+1),
-<a name="l00667"></a>00667                               cpl_apertures_get_centroid_y(apertures[chip],
-<a name="l00668"></a>00668                                                            iobj+1)) ;
-<a name="l00669"></a>00669                 fwhms_x[iobj] = -1.0 ;
-<a name="l00670"></a>00670                 fwhms_y[iobj] = -1.0 ;
-<a name="l00671"></a>00671                 angle = 0.0 ;
-<a name="l00672"></a>00672             }
-<a name="l00673"></a>00673             <span class="keywordflow">else</span> 
-<a name="l00674"></a>00674             {
-<a name="l00675"></a>00675                 fwhms_x[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 2) ;
-<a name="l00676"></a>00676                 fwhms_y[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 3) ;
-<a name="l00677"></a>00677                 angle = cpl_vector_get(cpl_bivector_get_x(iqe), 4) ;
-<a name="l00678"></a>00678                 cpl_bivector_delete(iqe) ;
-<a name="l00679"></a>00679                 cpl_msg_debug(__func__,
-<a name="l00680"></a>00680                               <span class="stringliteral">"FWHM for obj at pos %g %g: %g x %g (%g)"</span>,
-<a name="l00681"></a>00681                               cpl_apertures_get_centroid_x(apertures[chip],
-<a name="l00682"></a>00682                                                            iobj+1),
-<a name="l00683"></a>00683                               cpl_apertures_get_centroid_y(apertures[chip],
-<a name="l00684"></a>00684                                                            iobj+1),
-<a name="l00685"></a>00685                               fwhms_x[iobj], fwhms_y[iobj], angle) ;
-<a name="l00686"></a>00686             }
-<a name="l00687"></a>00687             cpl_table_set_double
-<a name="l00688"></a>00688                 (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, iobj, angle) ;
-<a name="l00689"></a>00689             cpl_table_set_double
-<a name="l00690"></a>00690                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, iobj,
-<a name="l00691"></a>00691                  fwhms_x[iobj]);
-<a name="l00692"></a>00692             cpl_table_set_double
-<a name="l00693"></a>00693                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, iobj,
-<a name="l00694"></a>00694                  fwhms_y[iobj]);
-<a name="l00695"></a>00695             cpl_table_set_double
-<a name="l00696"></a>00696                 (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, iobj,
-<a name="l00697"></a>00697                  1 - fwhms_y[iobj] / fwhms_x[iobj]);
-<a name="l00698"></a>00698         }
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700         <span class="comment">/* Get the number of good values */</span>
-<a name="l00701"></a>00701         nb_good = 0 ;
-<a name="l00702"></a>00702         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l00703"></a>00703         {
-<a name="l00704"></a>00704             <span class="keywordflow">if</span> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) nb_good++ ;
-<a name="l00705"></a>00705         }
-<a name="l00706"></a>00706         <span class="keywordflow">if</span> (nb_good == 0) 
-<a name="l00707"></a>00707         {
-<a name="l00708"></a>00708             cpl_msg_warning
-<a name="l00709"></a>00709                 (__func__, <span class="stringliteral">"No objects to compute mean FWHM on chip %d"</span>,chip+1);
-<a name="l00710"></a>00710             cpl_free(fwhms_x) ;
-<a name="l00711"></a>00711             cpl_free(fwhms_y) ;
-<a name="l00712"></a>00712             <span class="keywordflow">continue</span>;
-<a name="l00713"></a>00713         }
-<a name="l00714"></a>00714     
-<a name="l00715"></a>00715         <span class="comment">/* Get the good values */</span>
-<a name="l00716"></a>00716         fwhms_good = cpl_vector_new(nb_good) ;
-<a name="l00717"></a>00717         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;
-<a name="l00718"></a>00718         j=0 ;
-<a name="l00719"></a>00719         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l00720"></a>00720         {
-<a name="l00721"></a>00721             <span class="keywordflow">if</span> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) 
-<a name="l00722"></a>00722             {
-<a name="l00723"></a>00723                 fwhms_good_data[j] = (fwhms_x[iobj]+fwhms_y[iobj])/2.0 ;
-<a name="l00724"></a>00724                 j++ ;
-<a name="l00725"></a>00725             }
-<a name="l00726"></a>00726         }
-<a name="l00727"></a>00727    
-<a name="l00728"></a>00728         <span class="comment">/* Compute the fwhm */</span>
-<a name="l00729"></a>00729         <span class="keywordflow">if</span> (nb_good < 3) 
-<a name="l00730"></a>00730         {
-<a name="l00731"></a>00731             <span class="comment">/* Too few values to compute the median */</span>
-<a name="l00732"></a>00732             hawki_step_detect_obj_output.fwhm_pix[chip] = fwhms_good_data[0] ;
-<a name="l00733"></a>00733             cpl_msg_warning
-<a name="l00734"></a>00734                 (__func__, <span class="stringliteral">"Fewer than 3 objects, using the first object FWHM"</span>);
-<a name="l00735"></a>00735         } 
-<a name="l00736"></a>00736         <span class="keywordflow">else</span> 
-<a name="l00737"></a>00737         {
-<a name="l00738"></a>00738             <span class="comment">/* Compute the median */</span>
-<a name="l00739"></a>00739             hawki_step_detect_obj_output.fwhm_pix[chip] =
-<a name="l00740"></a>00740                 cpl_vector_get_median_const(fwhms_good);
-<a name="l00741"></a>00741         }
-<a name="l00742"></a>00742         hawki_step_detect_obj_output.fwhm_arcsec[chip] = 
-<a name="l00743"></a>00743             hawki_step_detect_obj_output.fwhm_pix[chip] *
-<a name="l00744"></a>00744                 hawki_step_detect_obj_output.pixscale ;
-<a name="l00745"></a>00745 
-<a name="l00746"></a>00746         <span class="comment">/* Compute the mode of the FWHMs */</span>
-<a name="l00747"></a>00747         <span class="keywordflow">if</span> (nb_good > 5)
-<a name="l00748"></a>00748         {
-<a name="l00749"></a>00749             hawki_step_detect_obj_output.fwhm_mode[chip] =
-<a name="l00750"></a>00750                 <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(fwhms_good);
-<a name="l00751"></a>00751             hawki_step_detect_obj_output.fwhm_mode[chip] *= 
-<a name="l00752"></a>00752                 hawki_step_detect_obj_output.pixscale;
-<a name="l00753"></a>00753         }
-<a name="l00754"></a>00754         cpl_vector_delete(fwhms_good);
-<a name="l00755"></a>00755     
-<a name="l00756"></a>00756         <span class="comment">/* IQ is the median of the (fwhm_x+fwhm_y/2) of the good stars */</span>
-<a name="l00757"></a>00757         <span class="comment">/* Compute f_min and f_max */</span>
-<a name="l00758"></a>00758         f_min = seeing_min_arcsec / hawki_step_detect_obj_output.pixscale;
-<a name="l00759"></a>00759         f_max = seeing_max_arcsec / hawki_step_detect_obj_output.pixscale; 
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761         <span class="comment">/* Get the number of good values */</span>
-<a name="l00762"></a>00762         nb_good = 0 ;
-<a name="l00763"></a>00763         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l00764"></a>00764         {
-<a name="l00765"></a>00765             fx = fwhms_x[iobj] ;
-<a name="l00766"></a>00766             fy = fwhms_y[iobj] ;
-<a name="l00767"></a>00767             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;
-<a name="l00768"></a>00768             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&
-<a name="l00769"></a>00769                     (fr < seeing_fwhm_var)) nb_good++ ;
-<a name="l00770"></a>00770         }
-<a name="l00771"></a>00771         <span class="keywordflow">if</span> (nb_good == 0) 
-<a name="l00772"></a>00772         {
-<a name="l00773"></a>00773             cpl_msg_warning(__func__, <span class="stringliteral">"No objects to compute IQ on chip %d"</span>,
-<a name="l00774"></a>00774                             chip+1);
-<a name="l00775"></a>00775             cpl_free(fwhms_x) ;
-<a name="l00776"></a>00776             cpl_free(fwhms_y) ;
-<a name="l00777"></a>00777             <span class="keywordflow">continue</span>;
-<a name="l00778"></a>00778         }
-<a name="l00779"></a>00779 
-<a name="l00780"></a>00780         <span class="comment">/* Get the good values */</span>
-<a name="l00781"></a>00781         fwhms_good = cpl_vector_new(nb_good) ;
-<a name="l00782"></a>00782         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;
-<a name="l00783"></a>00783         j=0 ;
-<a name="l00784"></a>00784         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) 
-<a name="l00785"></a>00785         {
-<a name="l00786"></a>00786             fx = fwhms_x[iobj] ;
-<a name="l00787"></a>00787             fy = fwhms_y[iobj] ;
-<a name="l00788"></a>00788             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;
-<a name="l00789"></a>00789             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&
-<a name="l00790"></a>00790                     (fr < seeing_fwhm_var)) 
-<a name="l00791"></a>00791             {
-<a name="l00792"></a>00792                 fwhms_good_data[j] = (fx + fy)/2.0 ;
-<a name="l00793"></a>00793                 j++ ;
-<a name="l00794"></a>00794             }
-<a name="l00795"></a>00795         }
-<a name="l00796"></a>00796         cpl_free(fwhms_x) ;
-<a name="l00797"></a>00797         cpl_free(fwhms_y) ;
-<a name="l00798"></a>00798     
-<a name="l00799"></a>00799         <span class="comment">/* Compute the fwhm */</span>
-<a name="l00800"></a>00800         <span class="keywordflow">if</span> (nb_good < 3) 
-<a name="l00801"></a>00801         {
-<a name="l00802"></a>00802             <span class="comment">/* Too few values to compute the median */</span>
-<a name="l00803"></a>00803             hawki_step_detect_obj_output.iq[chip] = fwhms_good_data[0] ;
-<a name="l00804"></a>00804         }
-<a name="l00805"></a>00805         <span class="keywordflow">else</span> 
-<a name="l00806"></a>00806         {
-<a name="l00807"></a>00807             <span class="comment">/* Compute the median */</span>
-<a name="l00808"></a>00808             hawki_step_detect_obj_output.iq[chip] = 
-<a name="l00809"></a>00809                 cpl_vector_get_median_const(fwhms_good) ;
-<a name="l00810"></a>00810         }
-<a name="l00811"></a>00811         cpl_vector_delete(fwhms_good);
-<a name="l00812"></a>00812         hawki_step_detect_obj_output.iq[chip] *= 
-<a name="l00813"></a>00813             hawki_step_detect_obj_output.pixscale;
-<a name="l00814"></a>00814     }
-<a name="l00815"></a>00815     cpl_msg_indent_less();
-<a name="l00816"></a>00816     
-<a name="l00817"></a>00817     <span class="keywordflow">return</span> 0;
-<a name="l00818"></a>00818 }
-<a name="l00819"></a>00819         
-<a name="l00820"></a>00820         
-<a name="l00821"></a>00821 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00830"></a>00830 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00831"></a>00831 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_save
-<a name="l00832"></a>00832 (cpl_image           **  mask_images,
-<a name="l00833"></a>00833  cpl_table           **  obj_charac,
-<a name="l00834"></a>00834  cpl_propertylist    **  obj_stats,
-<a name="l00835"></a>00835  cpl_parameterlist   *   parlist,
-<a name="l00836"></a>00836  cpl_frameset        *   framelist)
-<a name="l00837"></a>00837 {
-<a name="l00838"></a>00838     <span class="keyword">const</span> cpl_frame     *   ref_frame ;
-<a name="l00839"></a>00839     cpl_propertylist    **  qclists;
-<a name="l00840"></a>00840     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00841"></a>00841     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_detect_obj"</span> ;
-<a name="l00842"></a>00842     <span class="keywordtype">int</span>                     i;
-<a name="l00843"></a>00843     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00844"></a>00844     
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846 
-<a name="l00847"></a>00847     <span class="comment">/* Load the WCS keys */</span>
-<a name="l00848"></a>00848     ref_frame = irplib_frameset_get_first_from_group
-<a name="l00849"></a>00849         (framelist, CPL_FRAME_GROUP_RAW);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     <span class="comment">/* Create the QC lists */</span>
-<a name="l00852"></a>00852     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00853"></a>00853     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++)
-<a name="l00854"></a>00854     {
-<a name="l00855"></a>00855         cpl_propertylist    *   inputlist;
-<a name="l00856"></a>00856         cpl_propertylist    *   offsetlist;
-<a name="l00857"></a>00857         cpl_propertylist    *   wcslist;
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859         <span class="comment">/* Get the extension number */</span>
-<a name="l00860"></a>00860         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);
-<a name="l00861"></a>00861         qclists[i] = cpl_propertylist_new() ;
-<a name="l00862"></a>00862 
-<a name="l00863"></a>00863         <span class="comment">/* Fill the QC */</span>
-<a name="l00864"></a>00864         cpl_propertylist_append_int
-<a name="l00865"></a>00865             (qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>, 
-<a name="l00866"></a>00866              hawki_step_detect_obj_output.nbobjs[i]);
-<a name="l00867"></a>00867         cpl_propertylist_append_double
-<a name="l00868"></a>00868             (qclists[i], <span class="stringliteral">"ESO QC IQ"</span>, hawki_step_detect_obj_output.iq[i]);
-<a name="l00869"></a>00869         cpl_propertylist_append_double
-<a name="l00870"></a>00870             (qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,
-<a name="l00871"></a>00871              hawki_step_detect_obj_output.fwhm_pix[i]);
-<a name="l00872"></a>00872         cpl_propertylist_append_double
-<a name="l00873"></a>00873             (qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,
-<a name="l00874"></a>00874              hawki_step_detect_obj_output.fwhm_arcsec[i]);
-<a name="l00875"></a>00875         cpl_propertylist_append_double
-<a name="l00876"></a>00876             (qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,
-<a name="l00877"></a>00877              hawki_step_detect_obj_output.fwhm_mode[i]);
-<a name="l00878"></a>00878 
-<a name="l00879"></a>00879         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00880"></a>00880         inputlist = cpl_propertylist_load_regexp(
-<a name="l00881"></a>00881                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00882"></a>00882                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00883"></a>00883         offsetlist = cpl_propertylist_load_regexp(
-<a name="l00884"></a>00884                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00885"></a>00885                 HAWKI_HEADER_COMB_OFFSETS, 0);
-<a name="l00886"></a>00886         wcslist = cpl_propertylist_load_regexp(
-<a name="l00887"></a>00887                 cpl_frame_get_filename(ref_frame), ext_nb,
-<a name="l00888"></a>00888                 HAWKI_HEADER_WCS, 0);
-<a name="l00889"></a>00889         cpl_propertylist_append(qclists[i], inputlist);
-<a name="l00890"></a>00890         cpl_propertylist_append(qclists[i], offsetlist);
-<a name="l00891"></a>00891         cpl_propertylist_append(qclists[i], wcslist);
-<a name="l00892"></a>00892         cpl_propertylist_delete(inputlist);
-<a name="l00893"></a>00893         cpl_propertylist_delete(offsetlist);
-<a name="l00894"></a>00894         cpl_propertylist_delete(wcslist);
-<a name="l00895"></a>00895         
-<a name="l00896"></a>00896         <span class="comment">/* Add the object statistics keywords */</span>
-<a name="l00897"></a>00897         cpl_propertylist_append(qclists[i], obj_stats[i]);
-<a name="l00898"></a>00898     }
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900 
-<a name="l00901"></a>00901     <span class="comment">/* Write the object mask */</span>
-<a name="l00902"></a>00902     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(framelist,
-<a name="l00903"></a>00903                       parlist,
-<a name="l00904"></a>00904                       framelist, 
-<a name="l00905"></a>00905                       (<span class="keyword">const</span> cpl_image**)mask_images, 
-<a name="l00906"></a>00906                       recipe_name,
-<a name="l00907"></a>00907                       HAWKI_CALPRO_OBJ_MASK, 
-<a name="l00908"></a>00908                       HAWKI_PROTYPE_OBJ_MASK,
-<a name="l00909"></a>00909                       NULL,
-<a name="l00910"></a>00910                       (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l00911"></a>00911                       <span class="stringliteral">"hawki_step_detect_obj_mask.fits"</span>) ;
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913     <span class="comment">/* Write the FITS table with the objects statistics */</span>
-<a name="l00914"></a>00914     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(framelist,
-<a name="l00915"></a>00915                       parlist,
-<a name="l00916"></a>00916                       framelist,    
-<a name="l00917"></a>00917                       (<span class="keyword">const</span> cpl_table **)obj_charac,
-<a name="l00918"></a>00918                       recipe_name,
-<a name="l00919"></a>00919                       HAWKI_CALPRO_OBJ_PARAM,
-<a name="l00920"></a>00920                       HAWKI_PROTYPE_OBJ_PARAM,
-<a name="l00921"></a>00921                       NULL,
-<a name="l00922"></a>00922                       (<span class="keyword">const</span> cpl_propertylist**)qclists,
-<a name="l00923"></a>00923                       <span class="stringliteral">"hawki_step_detect_obj_stars.fits"</span>) ;
-<a name="l00924"></a>00924 
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926     <span class="comment">/* Free and return */</span>
-<a name="l00927"></a>00927     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00928"></a>00928         cpl_propertylist_delete(qclists[i]) ;
-<a name="l00929"></a>00929     }
-<a name="l00930"></a>00930     cpl_free(qclists) ;
-<a name="l00931"></a>00931     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00932"></a>00932     {
-<a name="l00933"></a>00933         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00934"></a>00934         <span class="keywordflow">return</span> -1;
-<a name="l00935"></a>00935     }
-<a name="l00936"></a>00936     <span class="keywordflow">return</span>  0;
-<a name="l00937"></a>00937 }
-<a name="l00938"></a>00938 
-<a name="l00939"></a>00939 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_init_output(<span class="keywordtype">void</span>)
-<a name="l00940"></a>00940 {
-<a name="l00941"></a>00941     <span class="keywordtype">int</span>    idet;
-<a name="l00942"></a>00942     
-<a name="l00943"></a>00943     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00944"></a>00944     {
-<a name="l00945"></a>00945         hawki_step_detect_obj_output.iq[idet] = -1.0 ;
-<a name="l00946"></a>00946         hawki_step_detect_obj_output.nbobjs[idet] = -1 ;
-<a name="l00947"></a>00947         hawki_step_detect_obj_output.fwhm_pix[idet] = -1.0 ;
-<a name="l00948"></a>00948         hawki_step_detect_obj_output.fwhm_arcsec[idet] = -1.0 ;
-<a name="l00949"></a>00949         hawki_step_detect_obj_output.fwhm_mode[idet] = -1.0 ;
-<a name="l00950"></a>00950         hawki_step_detect_obj_output.pos_x[idet] = -1.0 ;
-<a name="l00951"></a>00951         hawki_step_detect_obj_output.pos_y[idet] = -1.0 ;
-<a name="l00952"></a>00952     }
-<a name="l00953"></a>00953     hawki_step_detect_obj_output.pixscale = -1.0;
-<a name="l00954"></a>00954 }
-<a name="l00955"></a>00955 
-<a name="l00956"></a>00956 <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_get_pscale
-<a name="l00957"></a>00957 (cpl_frameset * combframes)
-<a name="l00958"></a>00958 {
-<a name="l00959"></a>00959     cpl_propertylist  * plist;
-<a name="l00960"></a>00960     cpl_frame         * firstframe;
-<a name="l00961"></a>00961     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l00962"></a>00962     
-<a name="l00963"></a>00963     <span class="comment">/* Get the header infos */</span>
-<a name="l00964"></a>00964     firstframe = cpl_frameset_get_frame(combframes, 0) ;
-<a name="l00965"></a>00965     plist=cpl_propertylist_load(cpl_frame_get_filename(firstframe), 0) ;
-<a name="l00966"></a>00966     hawki_step_detect_obj_output.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist);
-<a name="l00967"></a>00967     cpl_propertylist_delete(plist) ;
-<a name="l00968"></a>00968     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00969"></a>00969     {
-<a name="l00970"></a>00970         cpl_msg_error(__func__, <span class="stringliteral">"Missing PIXSCALE keyword in FITS header"</span>) ;
-<a name="l00971"></a>00971         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00972"></a>00972         <span class="keywordflow">return</span>;
-<a name="l00973"></a>00973     }
-<a name="l00974"></a>00974 }
-<a name="l00975"></a>00975 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_detect_obj.c,v 1.27 2012/11/30 14:50: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/11/30 14:50:51 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.27 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_calib.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_obj_det.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_mask.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_dfs.h"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">                            Functions prototypes</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="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">int</span> hawki_step_detect_obj_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj(cpl_parameterlist *, cpl_frameset *) ;</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> hawki_step_detect_obj_init_output(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_get_pscale</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> (cpl_frameset * combframes);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_retrieve_input_param</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keyword">static</span> cpl_apertures  ** hawki_step_detect_obj_mask_and_apertures</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> (cpl_frameset    *  combframes,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_image       ** mask_image,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_image       ** comb_image);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_aper_params</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> (cpl_image      **  combined_images, </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_apertures  **  apertures,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  cpl_table      **  obj_charac);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_save</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> (cpl_image           **  mask_images,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_table           **  obj_charac,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_propertylist    **  obj_stats,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  cpl_frameset        *   framelist);</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="comment">                            Static variables</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="keyword">struct </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">/* Inputs */</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordtype">double</span> sigma_det;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordtype">int</span>    growing_radius;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> } hawki_step_detect_obj_config;</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">static</span> <span class="keyword">struct </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">/* Outputs */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">double</span>          pixscale;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordtype">double</span>          iq[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="keywordtype">int</span>             nbobjs[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordtype">double</span>          fwhm_pix[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="keywordtype">double</span>          fwhm_arcsec[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keywordtype">double</span>          fwhm_mode[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keywordtype">double</span>          pos_x[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordtype">double</span>          pos_y[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> } hawki_step_detect_obj_output;</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">static</span> <span class="keywordtype">char</span> hawki_step_detect_obj_description[] =</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"hawki_step_detect_obj -- hawki detect objects recipe.\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"This recipe detects objects from the combined image creating a mask\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"and a list of object properties\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"combined.fits "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="stringliteral">"hawki_step_detect_obj_mask.fits ("</span>HAWKI_CALPRO_OBJ_MASK<span class="stringliteral">"): A mask with 1 where the objects are present and 0 elsewhere\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="stringliteral">"hawki_step_detect_obj_stars.fits ("</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"): A table with the detected objects characteristics\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="stringliteral">"or 1 otherwise"</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> </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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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 = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     <span class="stringliteral">"hawki_step_detect_obj"</span>,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                     <span class="stringliteral">"Object detection recipe"</span>,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                     hawki_step_detect_obj_description,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                     hawki_step_detect_obj_create,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                     hawki_step_detect_obj_exec,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     hawki_step_detect_obj_destroy) ;</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_pluginlist_append(list, plugin) ;</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">return</span> 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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_create(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>     cpl_parameter   * 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>     <span class="comment">/* Get the recipe out of the plugin */</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> <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="comment">/* Create the parameters list in the cpl_recipe object */</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>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</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="comment">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="comment">/* --sigma_det */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_detect_obj.sigma_det"</span>, </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                 CPL_TYPE_DOUBLE, <span class="stringliteral">"detection level"</span>,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                 <span class="stringliteral">"hawki.hawki_step_detect_obj"</span>, 6.);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma_det"</span>);</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(recipe->parameters, 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">/* --growing_radius */</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_detect_obj.growing_radius"</span>, </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                                 <span class="stringliteral">"radius of convolution kernel to apply to objects"</span>,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                 <span class="stringliteral">"hawki.hawki_step_detect_obj"</span>, 5);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"growing_radius"</span>);</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     cpl_parameterlist_append(recipe->parameters, p);</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">/* Return */</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="keywordflow">return</span> 0;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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="keywordflow">return</span> hawki_step_detect_obj(recipe->parameters, recipe->frames) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_destroy(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> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="comment">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -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>     cpl_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj(</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         cpl_frameset        *   framelist)</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_frameset     *   combframes;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_image        **  mask_image;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_image        **  comb_image;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_apertures    **  apertures;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cpl_table        **  obj_charac;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     cpl_propertylist **  obj_stats;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordtype">int</span>                  idet;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     hawki_step_detect_obj_init_output();</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="comment">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">if</span>(hawki_step_detect_obj_retrieve_input_param(parlist))</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_error(__func__, <span class="stringliteral">"Wrong parameters"</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> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     combframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_COMBINED) ;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">if</span> (combframes == NULL) </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_error(__func__, <span class="stringliteral">"Cannot find combined images in the input (%s)"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                 HAWKI_CALPRO_COMBINED);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         <span class="keywordflow">return</span> -1 ;</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> (cpl_frameset_get_size(combframes) != 1)</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_msg_error(__func__, <span class="stringliteral">"Only one combined image must be provided"</span>);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         <span class="keywordflow">return</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> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="comment">/* Get info from the headers */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     hawki_step_detect_obj_get_pscale(combframes);</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">/* Get the mask with the points above the background </span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">     * and the associated apertures*/</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_msg_info(__func__, <span class="stringliteral">"Getting the object masks"</span>) ;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     mask_image = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     comb_image = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     apertures =  hawki_step_detect_obj_mask_and_apertures</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         (combframes, mask_image, comb_image);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">if</span>(apertures == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not detect objects in image"</span>);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         cpl_free(mask_image);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         cpl_free(comb_image);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         <span class="keywordflow">return</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>     </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="comment">/* Get object characterizations and statistics */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_msg_info(__func__, <span class="stringliteral">"Getting object parameters"</span>) ;</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     obj_charac = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *)) ;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     obj_stats  = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         obj_charac[idet] = cpl_table_new</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             (cpl_apertures_get_size(apertures[idet]));</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         obj_stats[idet] = 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>     hawki_step_detect_obj_aper_params(comb_image, apertures, obj_charac);</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">/* Statistics of the detected objects in the QC */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <a class="code" href="group__hawki__obj__det.html#ga0968e63931fcc72c55c4bc0e34f71dbb" title="Compute statistics on the object properties.">hawki_obj_prop_stats</a>(obj_charac, obj_stats);</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">/* Save the products */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordflow">if</span> (hawki_step_detect_obj_save(mask_image, obj_charac, obj_stats,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                                    parlist, framelist) == -1)</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_msg_warning(__func__, <span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                         <span class="stringliteral">"Check permisions or disk space"</span>) ;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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>             cpl_table_delete(obj_charac[idet]);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>             cpl_propertylist_delete(obj_stats[idet]);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>             cpl_apertures_delete(apertures[idet]);</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_free(apertures);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         cpl_free(obj_charac);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         cpl_free(obj_stats);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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_image_delete(mask_image[idet]);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>             cpl_image_delete(comb_image[idet]);</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>         cpl_free(mask_image);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         cpl_free(comb_image);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>         <span class="keywordflow">return</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>     </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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_table_delete(obj_charac[idet]);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         cpl_propertylist_delete(obj_stats[idet]);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         cpl_apertures_delete(apertures[idet]);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         cpl_image_delete(mask_image[idet]);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         cpl_image_delete(comb_image[idet]);</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_free(apertures);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cpl_free(obj_charac);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_free(obj_stats);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     cpl_free(mask_image);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     cpl_free(comb_image);</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         <span class="keywordflow">return</span> -1 ;</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="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;</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="keywordtype">int</span> hawki_step_detect_obj_retrieve_input_param</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> (cpl_parameterlist  *  parlist)</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_parameter   *   par ;</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>     par = NULL ;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         (parlist, <span class="stringliteral">"hawki.hawki_step_detect_obj.sigma_det"</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     hawki_step_detect_obj_config.sigma_det = cpl_parameter_get_double(par);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         (parlist, <span class="stringliteral">"hawki.hawki_step_detect_obj.growing_radius"</span>);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     hawki_step_detect_obj_config.growing_radius = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="keywordflow">if</span>(hawki_step_detect_obj_config.growing_radius > 100)</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_msg_error(__func__,<span class="stringliteral">"The maximum radius allowed is 100"</span>);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         <span class="keywordflow">return</span> -1;</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>(hawki_step_detect_obj_config.sigma_det <= 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>         cpl_msg_error(__func__,<span class="stringliteral">"Detection sigma has to be greater than 0"</span>);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         <span class="keywordflow">return</span> -1;</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="keywordflow">return</span> 0;</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> </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="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="keyword">static</span> cpl_apertures  ** hawki_step_detect_obj_mask_and_apertures</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> (cpl_frameset    *  combframes,</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>  cpl_image       ** mask_image,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>  cpl_image       ** comb_image)</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_apertures   **  apertures;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">int</span>                 idet;</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>     <span class="comment">/* Create output object */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     apertures = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_apertures *));</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="comment">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_image  * chip_image;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         cpl_image  * chip_image_sort;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         cpl_mask   * object_mask;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         cpl_mask   * kernel_op;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         cpl_matrix * kernel;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         cpl_image  * labels;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         cpl_size     nobj;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <span class="keywordtype">double</span>       bkg_level;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         <span class="keywordtype">double</span>       bkg_noise;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         <span class="keywordtype">double</span>       threshold;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         <span class="keywordtype">int</span>          kernel_size;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>         <span class="keywordtype">int</span>          ix;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         <span class="keywordtype">int</span>          iy;</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_info(__func__, <span class="stringliteral">"Detecting objects on chip number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_msg_indent_more();</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">/* Load the input data */</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         cpl_msg_info(__func__, <span class="stringliteral">"Load the input data"</span>) ;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         chip_image = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(combframes, 0, idet+1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         <span class="keywordflow">if</span> (chip_image == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>             cpl_free(apertures);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>             <span class="keywordflow">return</span> 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>         </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         <span class="comment">/* Subtract the median of the frame first */</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         chip_image_sort = cpl_image_duplicate(chip_image);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         bkg_level = cpl_image_get_median(chip_image);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         bkg_noise = <a class="code" href="group__hawki__image__stats.html#gade5ca3e76e59c9ab510cb85bc02dd651" title="Get a robust estimation of the sigma based on the quartiles.">hawki_image_float_get_sigma_from_quartile</a>(chip_image_sort); </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cpl_image_delete(chip_image_sort);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         threshold = bkg_level + hawki_step_detect_obj_config.sigma_det * bkg_noise;        </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         cpl_msg_info(__func__, <span class="stringliteral">"Background:       %f"</span>,bkg_level);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_msg_info(__func__, <span class="stringliteral">"Background noise: %f"</span>,bkg_noise);</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">/* Create the mask */</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         cpl_msg_info(__func__, <span class="stringliteral">"Mask creation with threshold: %f"</span>,threshold);</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         object_mask = cpl_mask_threshold_image_create</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>             (chip_image, threshold, DBL_MAX);</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">/* Apply a morphological opening to remove single pixel detections */</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         cpl_msg_info(__func__, <span class="stringliteral">"Removing single pixel detections"</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         kernel_op = cpl_mask_new(3, 3); </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         cpl_mask_not(kernel_op);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         <span class="keywordflow">if</span> (cpl_mask_filter(object_mask, object_mask, kernel_op, </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                             CPL_FILTER_OPENING, </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                             CPL_BORDER_ZERO) != CPL_ERROR_NONE)</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_mask_delete(object_mask);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             cpl_mask_delete(kernel_op);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             <span class="keywordflow">return</span> 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>         cpl_mask_delete(kernel_op);</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">/* Apply dilation to the mask */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         <span class="keywordflow">if</span>(hawki_step_detect_obj_config.growing_radius>0)</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(__func__, <span class="stringliteral">"Growing the mask with radius %d"</span>,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                     hawki_step_detect_obj_config.growing_radius);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>             kernel_size = hawki_step_detect_obj_config.growing_radius*2+1;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>             kernel = cpl_matrix_new(kernel_size, kernel_size);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             <span class="keywordflow">for</span>(ix=0;ix<kernel_size;++ix)</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                 <span class="keywordflow">for</span>(iy=0;iy<kernel_size;++iy)</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="keywordtype">double</span> xpos = ix+0.5-kernel_size/2.;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                     <span class="keywordtype">double</span> ypos = iy+0.5-kernel_size/2.;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                     <span class="keywordtype">double</span> kernel_func = 1-sqrt(xpos*xpos+ypos*ypos)/</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                     hawki_step_detect_obj_config.growing_radius;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                     <span class="keywordflow">if</span>(kernel_func<0)</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>                         kernel_func = 0;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>                     cpl_matrix_set(kernel, ix, iy, kernel_func);</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> (<a class="code" href="group__hawki__mask.html#ga6154878d3444c3d4204a2a6132719e69">hawki_mask_convolve</a>(object_mask, kernel) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                 cpl_mask_delete(object_mask) ;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                 cpl_matrix_delete(kernel) ;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                 <span class="keywordflow">return</span> 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_matrix_delete(kernel);</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="comment">/* Put the mask and the chip image in the imagelist */</span></div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         mask_image[idet] =  cpl_image_new_from_mask(object_mask);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         comb_image[idet] =  chip_image;</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">/* Labelise the different detected apertures */</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         cpl_msg_info(__func__, <span class="stringliteral">"Labelise mask"</span>) ;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         labels = cpl_image_labelise_mask_create(object_mask, &nobj);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         <span class="keywordflow">if</span> (labels == NULL) </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="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>             cpl_free(apertures);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             cpl_mask_delete(object_mask);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             <span class="keywordflow">for</span> (jdet=0 ; jdet<idet + 1 ; jdet++)</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_image_delete(mask_image[jdet]);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                 cpl_image_delete(comb_image[jdet]);</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="l00544"></a><span class="lineno">  544</span>         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects detected: %"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                      nobj) ;</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">/* Create the detected apertures list */</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         cpl_msg_info(__func__, <span class="stringliteral">"Create apertures"</span>) ;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         apertures[idet] = cpl_apertures_new_from_image(chip_image, labels);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         <span class="keywordflow">if</span> (apertures[idet] == NULL)</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="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             cpl_free(apertures);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             cpl_mask_delete(object_mask);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>             <span class="keywordflow">for</span> (jdet=0 ; jdet<idet + 1 ; jdet++)</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_image_delete(mask_image[jdet]);</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                 cpl_image_delete(comb_image[jdet]);</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="keywordflow">return</span> 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="comment">/* Free */</span></div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         cpl_mask_delete(object_mask);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         cpl_image_delete(labels);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         cpl_msg_indent_less();</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">return</span> apertures;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_aper_params</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> (cpl_image      **  combined_images, </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>  cpl_apertures  **  apertures,</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>  cpl_table      **  obj_charac)</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="keywordtype">int</span>                 nb_objs ;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordtype">double</span>              angle ;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordtype">double</span>          *   fwhms_x ;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keywordtype">double</span>          *   fwhms_y ;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     cpl_bivector    *   iqe ;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordtype">int</span>                 nb_good ;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_vector      *   fwhms_good ;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordtype">double</span>          *   fwhms_good_data ;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">double</span>              f_min, f_max, fr, fx, fy ;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordtype">int</span>                 chip;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordtype">int</span>                 iobj;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="keywordtype">int</span>                 j;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordtype">double</span>              seeing_min_arcsec = 0.1 ;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordtype">double</span>              seeing_max_arcsec = 5.0 ;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     <span class="keywordtype">double</span>              seeing_fwhm_var   = 0.2 ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     <span class="keywordflow">if</span> (combined_images  == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordflow">if</span> (obj_charac       == NULL) <span class="keywordflow">return</span> -1 ;</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">/* Loop on the HAWK-I detectors */</span></div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     <span class="keywordflow">for</span> (chip=0 ; chip<HAWKI_NB_DETECTORS ; chip++) </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>         <span class="comment">/* Number of detected objects */</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         nb_objs = cpl_apertures_get_size(apertures[chip]);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_msg_info(__func__, <span class="stringliteral">"%d objects detected on chip %d"</span>,nb_objs,chip+1);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         hawki_step_detect_obj_output.nbobjs[chip] = nb_objs ;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         fwhms_x = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>)) ;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         fwhms_y = cpl_malloc(nb_objs * <span class="keyword">sizeof</span>(<span class="keywordtype">double</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="comment">/* Initialize the output table */</span></div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         cpl_table_set_size(obj_charac[chip], nb_objs);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             (obj_charac[chip], HAWKI_COL_OBJ_POSX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             (obj_charac[chip], HAWKI_COL_OBJ_POSY, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_POSY,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>             (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_ANGLE,<span class="stringliteral">"grad"</span>);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MAJAX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>             (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FWHM_MINAX,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>             (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         cpl_table_new_column</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>             (obj_charac[chip], HAWKI_COL_OBJ_FLUX, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         cpl_table_set_column_unit(obj_charac[chip],HAWKI_COL_OBJ_FLUX,<span class="stringliteral">"ADU"</span>);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++)</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">/* Fill with the already known information */</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSX, iobj, </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                                  cpl_apertures_get_centroid_x(apertures[chip],</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                                                               iobj+1));</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_POSY, iobj, </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                                  cpl_apertures_get_centroid_y(apertures[chip],</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                                                               iobj+1));</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>             cpl_table_set_double(obj_charac[chip], HAWKI_COL_OBJ_FLUX, iobj, </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                                  cpl_apertures_get_flux(apertures[chip],</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                                                         iobj+1));</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>             <span class="comment">/* Compute the FWHM informations */</span></div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>             iqe = cpl_image_iqe(combined_images[chip], </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(apertures[chip], iobj+1)- 10,</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(apertures[chip], iobj+1)- 10,</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_x(apertures[chip], iobj+1)+ 10,</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                 (<span class="keywordtype">int</span>)cpl_apertures_get_centroid_y(apertures[chip], iobj+1)+ 10);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>             <span class="keywordflow">if</span> (iqe == 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_error_reset() ;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                 cpl_msg_debug(__func__, <span class="stringliteral">"Cannot get FWHM for obj at pos %g %g"</span>,</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>                               cpl_apertures_get_centroid_x(apertures[chip],</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>                                                            iobj+1),</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>                               cpl_apertures_get_centroid_y(apertures[chip],</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                                                            iobj+1)) ;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                 fwhms_x[iobj] = -1.0 ;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                 fwhms_y[iobj] = -1.0 ;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>                 angle = 0.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>             <span class="keywordflow">else</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>                 fwhms_x[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 2) ;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>                 fwhms_y[iobj] = cpl_vector_get(cpl_bivector_get_x(iqe), 3) ;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>                 angle = cpl_vector_get(cpl_bivector_get_x(iqe), 4) ;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>                 cpl_bivector_delete(iqe) ;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                 cpl_msg_debug(__func__,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                               <span class="stringliteral">"FWHM for obj at pos %g %g: %g x %g (%g)"</span>,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                               cpl_apertures_get_centroid_x(apertures[chip],</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                                                            iobj+1),</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                               cpl_apertures_get_centroid_y(apertures[chip],</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                                                            iobj+1),</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                               fwhms_x[iobj], fwhms_y[iobj], angle) ;</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_table_set_double</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                 (obj_charac[chip], HAWKI_COL_OBJ_ANGLE, iobj, angle) ;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>             cpl_table_set_double</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MAJAX, iobj,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                  fwhms_x[iobj]);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>             cpl_table_set_double</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                 (obj_charac[chip], HAWKI_COL_OBJ_FWHM_MINAX, iobj,</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                  fwhms_y[iobj]);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>             cpl_table_set_double</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                 (obj_charac[chip], HAWKI_COL_OBJ_ELLIP, iobj,</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                  1 - fwhms_y[iobj] / fwhms_x[iobj]);</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>         <span class="comment">/* Get the number of good values */</span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         nb_good = 0 ;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) nb_good++ ;</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">if</span> (nb_good == 0) </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_warning</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                 (__func__, <span class="stringliteral">"No objects to compute mean FWHM on chip %d"</span>,chip+1);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>             cpl_free(fwhms_x) ;</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>             cpl_free(fwhms_y) ;</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>             <span class="keywordflow">continue</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>         <span class="comment">/* Get the good values */</span></div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>         fwhms_good = cpl_vector_new(nb_good) ;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>         j=0 ;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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> ((fwhms_x[iobj] > 0.0) && (fwhms_y[iobj] > 0.0)) </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>                 fwhms_good_data[j] = (fwhms_x[iobj]+fwhms_y[iobj])/2.0 ;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                 j++ ;</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>         }</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="comment">/* Compute the fwhm */</span></div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>         <span class="keywordflow">if</span> (nb_good < 3) </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="comment">/* Too few values to compute the median */</span></div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>             hawki_step_detect_obj_output.fwhm_pix[chip] = fwhms_good_data[0] ;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>             cpl_msg_warning</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>                 (__func__, <span class="stringliteral">"Fewer than 3 objects, using the first object FWHM"</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>         <span class="keywordflow">else</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="comment">/* Compute the median */</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>             hawki_step_detect_obj_output.fwhm_pix[chip] =</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                 cpl_vector_get_median_const(fwhms_good);</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>         hawki_step_detect_obj_output.fwhm_arcsec[chip] = </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>             hawki_step_detect_obj_output.fwhm_pix[chip] *</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>                 hawki_step_detect_obj_output.pixscale ;</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="comment">/* Compute the mode of the FWHMs */</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>         <span class="keywordflow">if</span> (nb_good > 5)</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>             hawki_step_detect_obj_output.fwhm_mode[chip] =</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>                 <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(fwhms_good);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>             hawki_step_detect_obj_output.fwhm_mode[chip] *= </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                 hawki_step_detect_obj_output.pixscale;</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>         cpl_vector_delete(fwhms_good);</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="comment">/* IQ is the median of the (fwhm_x+fwhm_y/2) of the good stars */</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         <span class="comment">/* Compute f_min and f_max */</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         f_min = seeing_min_arcsec / hawki_step_detect_obj_output.pixscale;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         f_max = seeing_max_arcsec / hawki_step_detect_obj_output.pixscale; </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="comment">/* Get the number of good values */</span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         nb_good = 0 ;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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>             fx = fwhms_x[iobj] ;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>             fy = fwhms_y[iobj] ;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                     (fr < seeing_fwhm_var)) nb_good++ ;</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> (nb_good == 0) </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_warning(__func__, <span class="stringliteral">"No objects to compute IQ on chip %d"</span>,</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                             chip+1);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>             cpl_free(fwhms_x) ;</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>             cpl_free(fwhms_y) ;</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>             <span class="keywordflow">continue</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> </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         <span class="comment">/* Get the good values */</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         fwhms_good = cpl_vector_new(nb_good) ;</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         fwhms_good_data = cpl_vector_get_data(fwhms_good) ;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         j=0 ;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         <span class="keywordflow">for</span> (iobj=0 ; iobj<nb_objs ; iobj++) </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>             fx = fwhms_x[iobj] ;</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>             fy = fwhms_y[iobj] ;</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             fr = 2.0 * fabs(fx-fy) / (fx+fy) ;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>             <span class="keywordflow">if</span> ((fx > f_min) && (fx < f_max) && (fy > f_min) && (fy < f_max) &&</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>                     (fr < seeing_fwhm_var)) </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>                 fwhms_good_data[j] = (fx + fy)/2.0 ;</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>                 j++ ;</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>         }</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         cpl_free(fwhms_x) ;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>         cpl_free(fwhms_y) ;</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="comment">/* Compute the fwhm */</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         <span class="keywordflow">if</span> (nb_good < 3) </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">/* Too few values to compute the median */</span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>             hawki_step_detect_obj_output.iq[chip] = fwhms_good_data[0] ;</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">else</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="comment">/* Compute the median */</span></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>             hawki_step_detect_obj_output.iq[chip] = </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                 cpl_vector_get_median_const(fwhms_good) ;</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_vector_delete(fwhms_good);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         hawki_step_detect_obj_output.iq[chip] *= </div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>             hawki_step_detect_obj_output.pixscale;</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>     cpl_msg_indent_less();</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">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_detect_obj_save</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> (cpl_image           **  mask_images,</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>  cpl_table           **  obj_charac,</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>  cpl_propertylist    **  obj_stats,</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>  cpl_frameset        *   framelist)</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="keyword">const</span> cpl_frame     *   ref_frame ;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     cpl_propertylist    **  qclists;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_detect_obj"</span> ;</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     <span class="keywordtype">int</span>                     i;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     <span class="comment">/* Load the WCS keys */</span></div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>     ref_frame = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>         (framelist, CPL_FRAME_GROUP_RAW);</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">/* Create the QC lists */</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; 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>         cpl_propertylist    *   inputlist;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         cpl_propertylist    *   offsetlist;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>         cpl_propertylist    *   wcslist;</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), i+1);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>         qclists[i] = cpl_propertylist_new() ;</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="comment">/* Fill the QC */</span></div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>         cpl_propertylist_append_int</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>             (qclists[i], <span class="stringliteral">"ESO QC NBOBJS"</span>, </div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>              hawki_step_detect_obj_output.nbobjs[i]);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             (qclists[i], <span class="stringliteral">"ESO QC IQ"</span>, hawki_step_detect_obj_output.iq[i]);</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM PIX"</span>,</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>              hawki_step_detect_obj_output.fwhm_pix[i]);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM ARCSEC"</span>,</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>              hawki_step_detect_obj_output.fwhm_arcsec[i]);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         cpl_propertylist_append_double</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             (qclists[i], <span class="stringliteral">"ESO QC FWHM MODE"</span>,</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>              hawki_step_detect_obj_output.fwhm_mode[i]);</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">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>         offsetlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                 HAWKI_HEADER_COMB_OFFSETS, 0);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         wcslist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>                 cpl_frame_get_filename(ref_frame), ext_nb,</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                 HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         cpl_propertylist_append(qclists[i], inputlist);</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>         cpl_propertylist_append(qclists[i], offsetlist);</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         cpl_propertylist_append(qclists[i], wcslist);</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         cpl_propertylist_delete(inputlist);</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>         cpl_propertylist_delete(offsetlist);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>         cpl_propertylist_delete(wcslist);</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="comment">/* Add the object statistics keywords */</span></div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>         cpl_propertylist_append(qclists[i], obj_stats[i]);</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>     <span class="comment">/* Write the object mask */</span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     <a class="code" href="group__hawki__save.html#ga096962e65c0aab2bce1e9b2419789bd4" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_images_save</a>(framelist,</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                       parlist,</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>                       framelist, </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>                       (<span class="keyword">const</span> cpl_image**)mask_images, </div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>                       recipe_name,</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                       HAWKI_CALPRO_OBJ_MASK, </div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>                       HAWKI_PROTYPE_OBJ_MASK,</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>                       NULL,</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>                       (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>                       <span class="stringliteral">"hawki_step_detect_obj_mask.fits"</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="comment">/* Write the FITS table with the objects statistics */</span></div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(framelist,</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>                       parlist,</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>                       framelist,    </div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>                       (<span class="keyword">const</span> cpl_table **)obj_charac,</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>                       recipe_name,</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>                       HAWKI_CALPRO_OBJ_PARAM,</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>                       HAWKI_PROTYPE_OBJ_PARAM,</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>                       NULL,</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>                       (<span class="keyword">const</span> cpl_propertylist**)qclists,</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>                       <span class="stringliteral">"hawki_step_detect_obj_stars.fits"</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>         cpl_propertylist_delete(qclists[i]) ;</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>     cpl_free(qclists) ;</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>         <span class="keywordflow">return</span> -1;</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">return</span>  0;</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> </div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_init_output(<span class="keywordtype">void</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="keywordtype">int</span>    idet;</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="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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>         hawki_step_detect_obj_output.iq[idet] = -1.0 ;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         hawki_step_detect_obj_output.nbobjs[idet] = -1 ;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>         hawki_step_detect_obj_output.fwhm_pix[idet] = -1.0 ;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>         hawki_step_detect_obj_output.fwhm_arcsec[idet] = -1.0 ;</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         hawki_step_detect_obj_output.fwhm_mode[idet] = -1.0 ;</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         hawki_step_detect_obj_output.pos_x[idet] = -1.0 ;</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>         hawki_step_detect_obj_output.pos_y[idet] = -1.0 ;</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>     hawki_step_detect_obj_output.pixscale = -1.0;</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> <span class="keyword">static</span> <span class="keywordtype">void</span> hawki_step_detect_obj_get_pscale</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> (cpl_frameset * combframes)</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>     cpl_propertylist  * plist;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     cpl_frame         * firstframe;</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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">/* Get the header infos */</span></div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     firstframe = cpl_frameset_get_frame(combframes, 0) ;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>     plist=cpl_propertylist_load(cpl_frame_get_filename(firstframe), 0) ;</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>     hawki_step_detect_obj_output.pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_msg_error(__func__, <span class="stringliteral">"Missing PIXSCALE keyword in FITS header"</span>) ;</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         <span class="keywordflow">return</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> </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/hawki__step__photom__2mass_8c_source.html b/html/hawki__step__photom__2mass_8c_source.html
index 7ebfce5..64b395d 100644
--- a/html/hawki__step__photom__2mass_8c_source.html
+++ b/html/hawki__step__photom__2mass_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_photom_2mass.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,942 +40,948 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_photom_2mass.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_photom_2mass.c,v 1.17 2012/04/23 10:08:45 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/04/23 10:08:45 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.17 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_alloc.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "irplib_cat.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "irplib_stdstar.h"</span>
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00052"></a>00052 <span class="comment">                            Functions prototypes</span>
-<a name="l00053"></a>00053 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_create(cpl_plugin *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_exec(cpl_plugin *) ;
-<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_destroy(cpl_plugin *) ;
-<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass(cpl_parameterlist   *   parlist,
-<a name="l00059"></a>00059                                    cpl_frameset        *   frameset);
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 cpl_table ** hawki_step_photom_2mass_get_zpoints
-<a name="l00063"></a>00063 (cpl_frameset *     cat_2mass,
-<a name="l00064"></a>00064  cpl_frameset *     obj_param,
-<a name="l00065"></a>00065  cpl_frameset *     obj_ima);
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="keyword">static</span> cpl_table * hawki_step_photom_2mass_retrieve_stars
-<a name="l00068"></a>00068 (cpl_frameset *     cat_2mass,
-<a name="l00069"></a>00069  cpl_propertylist * wcs_keywords);
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 <span class="keyword">static</span> cpl_array *  hawki_step_photom_2mass_ppm
-<a name="l00072"></a>00072 (cpl_table *  stars_2mass,
-<a name="l00073"></a>00073  cpl_table *  obj_det);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keyword">static</span> cpl_table * hawki_step_photom_2mass_fill_zpoint_table
-<a name="l00076"></a>00076 (cpl_table *        stars_2mass,
-<a name="l00077"></a>00077  cpl_table *        obj_det_param,
-<a name="l00078"></a>00078  cpl_array *        matches,
-<a name="l00079"></a>00079  cpl_propertylist * plist,
-<a name="l00080"></a>00080  <span class="keywordtype">int</span>                idet);
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 <span class="keyword">static</span> cpl_propertylist ** hawki_step_photom_2mass_qc
-<a name="l00083"></a>00083 (cpl_table ** zpoint_table);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_save
-<a name="l00086"></a>00086 (cpl_table **              zpoints,
-<a name="l00087"></a>00087  cpl_parameterlist *       parlist,
-<a name="l00088"></a>00088  cpl_propertylist **       qclists,
-<a name="l00089"></a>00089  cpl_frameset *            <span class="keyword">set</span>);
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00092"></a>00092 <span class="comment">                            Static variables</span>
-<a name="l00093"></a>00093 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_photom_2mass_description[] = 
-<a name="l00096"></a>00096 <span class="stringliteral">"hawki_step_photom_2mass -- HAWK-I photometric autocalibration using 2MASS.\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"The input files must be tagged:\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"obj_param.fits "</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"image.fits "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"2mass_master_index.fits "</span>HAWKI_UTIL_CAT_2MASS<span class="stringliteral">"\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"hawki_cal_photom_2mass.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): \n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"The recipe does the following steps:\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"-Search the 2MASS catalogue for stars in the FOV\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"-Matches the input detected object catalogue and the 2MASS stars\n"</span>
-<a name="l00106"></a>00106 <span class="stringliteral">"-Computes photometric characteristics for each matched star\n"</span>
-<a name="l00107"></a>00107 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00112"></a>00112 <span class="comment">                                Functions code</span>
-<a name="l00113"></a>00113 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00123"></a>00123 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00124"></a>00124 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00132"></a>00132                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00133"></a>00133                     <span class="stringliteral">"hawki_step_photom_2mass"</span>,
-<a name="l00134"></a>00134                     <span class="stringliteral">"2MASS photometric calibration"</span>,
-<a name="l00135"></a>00135                     hawki_step_photom_2mass_description,
-<a name="l00136"></a>00136                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00137"></a>00137                     PACKAGE_BUGREPORT,  
-<a name="l00138"></a>00138                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00139"></a>00139                     hawki_step_photom_2mass_create,
-<a name="l00140"></a>00140                     hawki_step_photom_2mass_exec,
-<a name="l00141"></a>00141                     hawki_step_photom_2mass_destroy);
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143     cpl_pluginlist_append(list, plugin) ;
-<a name="l00144"></a>00144     
-<a name="l00145"></a>00145     <span class="keywordflow">return</span> 0;
-<a name="l00146"></a>00146 }
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00157"></a>00157 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00158"></a>00158 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_create(cpl_plugin * plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *   recipe ;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00164"></a>00164         recipe = (cpl_recipe *)plugin ;
-<a name="l00165"></a>00165     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00168"></a>00168     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00169"></a>00169     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00170"></a>00170         <span class="keywordflow">return</span> 1;
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172     <span class="comment">/* Return */</span>
-<a name="l00173"></a>00173     <span class="keywordflow">return</span> 0;
-<a name="l00174"></a>00174 }
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00182"></a>00182 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00183"></a>00183 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_exec(cpl_plugin * plugin)
-<a name="l00184"></a>00184 {
-<a name="l00185"></a>00185     cpl_recipe  *   recipe ;
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00188"></a>00188     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00189"></a>00189         recipe = (cpl_recipe *)plugin ;
-<a name="l00190"></a>00190     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* Issue a banner */</span>
-<a name="l00193"></a>00193     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> hawki_step_photom_2mass(recipe->parameters, recipe->frames) ;
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00204"></a>00204 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00205"></a>00205 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_destroy(cpl_plugin * plugin)
-<a name="l00206"></a>00206 {
-<a name="l00207"></a>00207     cpl_recipe  *   recipe ;
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00210"></a>00210     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00211"></a>00211         recipe = (cpl_recipe *)plugin ;
-<a name="l00212"></a>00212     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00215"></a>00215     <span class="keywordflow">return</span> 0 ;
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00224"></a>00224 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00225"></a>00225 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass(cpl_parameterlist *   parlist,
-<a name="l00226"></a>00226                                    cpl_frameset *        frameset)
-<a name="l00227"></a>00227 {
-<a name="l00228"></a>00228     cpl_frameset *      cat_2mass;
-<a name="l00229"></a>00229     cpl_frameset *      obj_param;
-<a name="l00230"></a>00230     cpl_frameset *      obj_ima;
-<a name="l00231"></a>00231     cpl_table **        zpoint_table;
-<a name="l00232"></a>00232     cpl_propertylist ** qclists;
-<a name="l00233"></a>00233     <span class="keywordtype">int</span>                 idet;
-<a name="l00234"></a>00234     
-<a name="l00235"></a>00235     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00236"></a>00236     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00237"></a>00237         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00238"></a>00238         <span class="keywordflow">return</span> -1 ;
-<a name="l00239"></a>00239     }
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="comment">/* Retrieve 2MASS catalogue */</span>
-<a name="l00242"></a>00242     <span class="keywordflow">if</span> ((cat_2mass = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset,
-<a name="l00243"></a>00243                     HAWKI_UTIL_CAT_2MASS)) == NULL) 
-<a name="l00244"></a>00244     {
-<a name="l00245"></a>00245         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find 2MASS catalogue (%s)"</span>,
-<a name="l00246"></a>00246                 HAWKI_UTIL_CAT_2MASS);
-<a name="l00247"></a>00247         <span class="keywordflow">return</span> -1 ;
-<a name="l00248"></a>00248     }
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/* Retrieve obj param */</span>
-<a name="l00251"></a>00251     <span class="keywordflow">if</span> ((obj_param = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00252"></a>00252             (frameset, HAWKI_CALPRO_OBJ_PARAM)) == NULL) 
-<a name="l00253"></a>00253     {
-<a name="l00254"></a>00254         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find object parameters (%s)"</span>,
-<a name="l00255"></a>00255                 HAWKI_CALPRO_OBJ_PARAM);
-<a name="l00256"></a>00256         <span class="keywordflow">return</span> -1 ;
-<a name="l00257"></a>00257     }
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     <span class="comment">/* Retrieve reference image */</span>
-<a name="l00260"></a>00260     <span class="keywordflow">if</span> ((obj_ima = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00261"></a>00261             (frameset, HAWKI_CALPRO_COMBINED)) == NULL) 
-<a name="l00262"></a>00262     {
-<a name="l00263"></a>00263         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find combined image (%s) "</span>,
-<a name="l00264"></a>00264                 HAWKI_CALPRO_COMBINED);
-<a name="l00265"></a>00265         <span class="keywordflow">return</span> -1 ;
-<a name="l00266"></a>00266     }
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     <span class="comment">/* Compute the zpoints */</span>
-<a name="l00269"></a>00269     zpoint_table = hawki_step_photom_2mass_get_zpoints
-<a name="l00270"></a>00270         (cat_2mass, obj_param, obj_ima);
-<a name="l00271"></a>00271     <span class="keywordflow">if</span>(zpoint_table == NULL)
-<a name="l00272"></a>00272     {
-<a name="l00273"></a>00273         cpl_msg_error(__func__,<span class="stringliteral">"Could not get the zpoints"</span>);
-<a name="l00274"></a>00274         cpl_frameset_delete(cat_2mass);
-<a name="l00275"></a>00275         cpl_frameset_delete(obj_param);
-<a name="l00276"></a>00276         cpl_frameset_delete(obj_ima);
-<a name="l00277"></a>00277         <span class="keywordflow">return</span> -1;
-<a name="l00278"></a>00278     }
-<a name="l00279"></a>00279     
-<a name="l00280"></a>00280     <span class="comment">/* Get some QC */</span>
-<a name="l00281"></a>00281     qclists =  hawki_step_photom_2mass_qc(zpoint_table);
-<a name="l00282"></a>00282     <span class="keywordflow">if</span>(zpoint_table == NULL)
-<a name="l00283"></a>00283     {
-<a name="l00284"></a>00284         cpl_msg_error(__func__,<span class="stringliteral">"Could not compute quality controls"</span>);
-<a name="l00285"></a>00285         cpl_frameset_delete(cat_2mass);
-<a name="l00286"></a>00286         cpl_frameset_delete(obj_param);
-<a name="l00287"></a>00287         cpl_frameset_delete(obj_ima);
-<a name="l00288"></a>00288         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);
-<a name="l00289"></a>00289         <span class="keywordflow">return</span> -1;
-<a name="l00290"></a>00290     }
-<a name="l00291"></a>00291     
-<a name="l00292"></a>00292     <span class="comment">/* Save the products */</span>
-<a name="l00293"></a>00293     cpl_msg_info(__func__,<span class="stringliteral">"Saving products"</span>);
-<a name="l00294"></a>00294     <span class="keywordflow">if</span>(hawki_step_photom_2mass_save(zpoint_table, parlist, qclists, frameset) == -1)
-<a name="l00295"></a>00295     {
-<a name="l00296"></a>00296         cpl_msg_error(__func__,<span class="stringliteral">"Could not save products"</span>);
-<a name="l00297"></a>00297         cpl_frameset_delete(cat_2mass);
-<a name="l00298"></a>00298         cpl_frameset_delete(obj_param);
-<a name="l00299"></a>00299         cpl_frameset_delete(obj_ima);
-<a name="l00300"></a>00300         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);
-<a name="l00301"></a>00301         <span class="keywordflow">return</span> -1;
-<a name="l00302"></a>00302     }
-<a name="l00303"></a>00303     
-<a name="l00304"></a>00304     <span class="comment">/* Free and return */</span>
-<a name="l00305"></a>00305     cpl_frameset_delete(cat_2mass);
-<a name="l00306"></a>00306     cpl_frameset_delete(obj_param);
-<a name="l00307"></a>00307     cpl_frameset_delete(obj_ima);
-<a name="l00308"></a>00308     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);
-<a name="l00309"></a>00309     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00310"></a>00310         cpl_propertylist_delete(qclists[idet]);
-<a name="l00311"></a>00311     cpl_free(qclists);
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     <span class="comment">/* Return */</span>
-<a name="l00314"></a>00314     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00315"></a>00315     {
-<a name="l00316"></a>00316         cpl_msg_error(__func__,
-<a name="l00317"></a>00317                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00318"></a>00318         <span class="keywordflow">return</span> -1 ;
-<a name="l00319"></a>00319     }
-<a name="l00320"></a>00320     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00321"></a>00321 }
-<a name="l00322"></a>00322 
-<a name="l00323"></a>00323 cpl_table ** hawki_step_photom_2mass_get_zpoints
-<a name="l00324"></a>00324 (cpl_frameset *     cat_2mass,
-<a name="l00325"></a>00325  cpl_frameset *     obj_param,
-<a name="l00326"></a>00326  cpl_frameset *     obj_ima)
-<a name="l00327"></a>00327 {
-<a name="l00328"></a>00328     cpl_table **       zpoint_table;
-<a name="l00329"></a>00329     cpl_table **       obj_det_param;
-<a name="l00330"></a>00330     cpl_propertylist * plist;
-<a name="l00331"></a>00331     <span class="keywordtype">int</span>                idet;
-<a name="l00332"></a>00332     cpl_errorstate     error_prevstate = cpl_errorstate_get();
-<a name="l00333"></a>00333     
-<a name="l00334"></a>00334     <span class="comment">/* Allocate zpoint_table */</span>
-<a name="l00335"></a>00335     zpoint_table = cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * HAWKI_NB_DETECTORS);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="comment">/* Load detected obj */</span>
-<a name="l00338"></a>00338     obj_det_param = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(cpl_frameset_get_first(obj_param));
-<a name="l00339"></a>00339      
-<a name="l00340"></a>00340     <span class="comment">/* Read the main header */</span>
-<a name="l00341"></a>00341     plist = cpl_propertylist_load
-<a name="l00342"></a>00342         (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)), 0);
-<a name="l00343"></a>00343     <span class="comment">/* Loop on detectors */</span>    
-<a name="l00344"></a>00344     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00345"></a>00345     {
-<a name="l00346"></a>00346         cpl_propertylist * wcs_info;
-<a name="l00347"></a>00347         cpl_table        * stars_2mass;
-<a name="l00348"></a>00348         cpl_array        * matches;
-<a name="l00349"></a>00349         <span class="keywordtype">int</span>                ext_nb;
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351         cpl_msg_info(__func__,<span class="stringliteral">"Working on chip %d"</span>, idet + 1);
-<a name="l00352"></a>00352         cpl_msg_indent_more();
-<a name="l00353"></a>00353          
-<a name="l00354"></a>00354         <span class="comment">/* Retrieve stars */</span>
-<a name="l00355"></a>00355         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00356"></a>00356             (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)),idet+1);
-<a name="l00357"></a>00357         wcs_info = cpl_propertylist_load
-<a name="l00358"></a>00358             (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)), ext_nb);
-<a name="l00359"></a>00359         stars_2mass = 
-<a name="l00360"></a>00360             hawki_step_photom_2mass_retrieve_stars(cat_2mass, wcs_info);        
-<a name="l00361"></a>00361         <span class="keywordflow">if</span>(stars_2mass == NULL)
-<a name="l00362"></a>00362         {
-<a name="l00363"></a>00363             <span class="keywordtype">int</span> jdet;
-<a name="l00364"></a>00364             cpl_msg_error(__func__, <span class="stringliteral">"Cannot retrieve stars"</span>);
-<a name="l00365"></a>00365             cpl_propertylist_delete(plist);
-<a name="l00366"></a>00366             cpl_propertylist_delete(wcs_info);
-<a name="l00367"></a>00367             <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);
-<a name="l00368"></a>00368             <span class="keywordflow">for</span>(jdet = 0; jdet <idet; ++jdet)
-<a name="l00369"></a>00369                 cpl_table_delete(zpoint_table[jdet]);
-<a name="l00370"></a>00370             cpl_free(zpoint_table);
-<a name="l00371"></a>00371             <span class="keywordflow">return</span> NULL;
-<a name="l00372"></a>00372         }
-<a name="l00373"></a>00373          
-<a name="l00374"></a>00374         <span class="comment">/* Pattern matching btw stars in 2MASS and detected ones */</span>
-<a name="l00375"></a>00375         cpl_msg_info(__func__,<span class="stringliteral">"Matching %"</span>CPL_SIZE_FORMAT
-<a name="l00376"></a>00376                      <span class="stringliteral">" 2MASS stars and %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" detections"</span>,
-<a name="l00377"></a>00377                      cpl_table_get_nrow(stars_2mass),
-<a name="l00378"></a>00378                      cpl_table_get_nrow(obj_det_param[idet]));
-<a name="l00379"></a>00379         matches = hawki_step_photom_2mass_ppm(stars_2mass, obj_det_param[idet]);
-<a name="l00380"></a>00380         
-<a name="l00381"></a>00381         <span class="comment">/* Fill the zpoint table */</span>
-<a name="l00382"></a>00382         cpl_msg_info(__func__,<span class="stringliteral">"Computing zero points"</span>);
-<a name="l00383"></a>00383         zpoint_table[idet] = hawki_step_photom_2mass_fill_zpoint_table
-<a name="l00384"></a>00384             (stars_2mass, obj_det_param[idet], matches, plist, idet);
-<a name="l00385"></a>00385         <span class="keywordflow">if</span>(zpoint_table[idet] == NULL)
-<a name="l00386"></a>00386         {
-<a name="l00387"></a>00387             <span class="keywordtype">int</span> jdet;
-<a name="l00388"></a>00388             cpl_msg_error(__func__, <span class="stringliteral">"Could not compute the zero points"</span>);
-<a name="l00389"></a>00389             cpl_propertylist_delete(plist);
-<a name="l00390"></a>00390             cpl_propertylist_delete(wcs_info);
-<a name="l00391"></a>00391             <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);
-<a name="l00392"></a>00392             cpl_table_delete(stars_2mass);
-<a name="l00393"></a>00393             <span class="keywordflow">for</span>(jdet = 0; jdet <idet; ++jdet)
-<a name="l00394"></a>00394                 cpl_table_delete(zpoint_table[jdet]);
-<a name="l00395"></a>00395             cpl_free(zpoint_table);
-<a name="l00396"></a>00396             cpl_array_delete(matches);
-<a name="l00397"></a>00397             <span class="keywordflow">return</span> NULL;
-<a name="l00398"></a>00398         }
-<a name="l00399"></a>00399         
-<a name="l00400"></a>00400         <span class="comment">/* Cleaning resources */</span>
-<a name="l00401"></a>00401         cpl_msg_indent_less();
-<a name="l00402"></a>00402         cpl_propertylist_delete(wcs_info);
-<a name="l00403"></a>00403         cpl_table_delete(stars_2mass);
-<a name="l00404"></a>00404         cpl_array_delete(matches);
-<a name="l00405"></a>00405     }
-<a name="l00406"></a>00406     
-<a name="l00407"></a>00407     <span class="comment">/* Free and return */</span>
-<a name="l00408"></a>00408     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);
-<a name="l00409"></a>00409     cpl_propertylist_delete(plist);
-<a name="l00410"></a>00410     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00411"></a>00411     {
-<a name="l00412"></a>00412         <span class="keywordtype">int</span> jdet;
-<a name="l00413"></a>00413         <span class="keywordflow">for</span>(jdet = 0; jdet <HAWKI_NB_DETECTORS; ++jdet)
-<a name="l00414"></a>00414             cpl_table_delete(zpoint_table[jdet]);
-<a name="l00415"></a>00415         cpl_free(zpoint_table);
-<a name="l00416"></a>00416         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the zero point"</span>);
-<a name="l00417"></a>00417         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00418"></a>00418         <span class="keywordflow">return</span> NULL;
-<a name="l00419"></a>00419     }
-<a name="l00420"></a>00420     <span class="keywordflow">return</span> zpoint_table;
-<a name="l00421"></a>00421 }
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423 <span class="keyword">static</span> cpl_table *  hawki_step_photom_2mass_retrieve_stars
-<a name="l00424"></a>00424 (cpl_frameset *     cat_2mass,
-<a name="l00425"></a>00425  cpl_propertylist * wcs_keywords)
-<a name="l00426"></a>00426 {
-<a name="l00427"></a>00427     <span class="keywordtype">char</span> *          catpath;
-<a name="l00428"></a>00428     <span class="keywordtype">char</span> *          catname;
-<a name="l00429"></a>00429     cpl_table *     stars;
-<a name="l00430"></a>00430     cpl_wcs *       wcs;
-<a name="l00431"></a>00431     <span class="keywordtype">int</span>             nstars;
-<a name="l00432"></a>00432     <span class="keywordtype">int</span>             istar;
-<a name="l00433"></a>00433     <span class="keywordtype">double</span>          ra1;
-<a name="l00434"></a>00434     <span class="keywordtype">double</span>          ra2;
-<a name="l00435"></a>00435     <span class="keywordtype">double</span>          dec1;
-<a name="l00436"></a>00436     <span class="keywordtype">double</span>          dec2;
-<a name="l00437"></a>00437     <span class="keywordtype">double</span>          extra_search = 0.;
-<a name="l00438"></a>00438     cpl_matrix *    from_coord;
-<a name="l00439"></a>00439     cpl_matrix *    to_coord;
-<a name="l00440"></a>00440     cpl_array *     status;
-<a name="l00441"></a>00441     
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="comment">/* Extract the catalog path */</span>
-<a name="l00444"></a>00444     <span class="keywordflow">if</span> (irplib_2mass_get_catpars(cpl_frameset_get_first(cat_2mass),
-<a name="l00445"></a>00445                                  &catpath, &catname) != CPL_ERROR_NONE) 
-<a name="l00446"></a>00446         <span class="keywordflow">return</span> NULL;
-<a name="l00447"></a>00447     
-<a name="l00448"></a>00448     <span class="comment">/* Get the WCS info */</span>
-<a name="l00449"></a>00449     wcs = cpl_wcs_new_from_propertylist(wcs_keywords);
-<a name="l00450"></a>00450     <span class="keywordflow">if</span>(cpl_error_get_code() == CPL_ERROR_NO_WCS)
-<a name="l00451"></a>00451     {
-<a name="l00452"></a>00452         cpl_msg_error(__func__,<span class="stringliteral">"Not compiled with WCS support."</span>);
-<a name="l00453"></a>00453         <span class="keywordflow">return</span> NULL;
-<a name="l00454"></a>00454     }
-<a name="l00455"></a>00455     
-<a name="l00456"></a>00456     <span class="comment">/* Get the limits to search */</span>
-<a name="l00457"></a>00457     <span class="keywordflow">if</span>(irplib_cat_get_image_limits(wcs, extra_search, 
-<a name="l00458"></a>00458                                    &ra1, &ra2, &dec1, &dec2) == 
-<a name="l00459"></a>00459                                        CPL_ERROR_DATA_NOT_FOUND)
-<a name="l00460"></a>00460     {
-<a name="l00461"></a>00461         cpl_msg_error(__func__,<span class="stringliteral">"No WCS information found"</span>);
-<a name="l00462"></a>00462         cpl_free(catname);
-<a name="l00463"></a>00463         cpl_free(catpath);
-<a name="l00464"></a>00464         cpl_wcs_delete(wcs);
-<a name="l00465"></a>00465         <span class="keywordflow">return</span> NULL;
-<a name="l00466"></a>00466     }
-<a name="l00467"></a>00467     cpl_msg_info(__func__,<span class="stringliteral">"Searching stars in RA=[%f,%f] DEC=[%f,%f]"</span>,
-<a name="l00468"></a>00468                  ra1/15., ra2/15., dec1, dec2);
-<a name="l00469"></a>00469     
-<a name="l00470"></a>00470     
-<a name="l00471"></a>00471     <span class="comment">/* Search the stars */</span>
-<a name="l00472"></a>00472     stars = irplib_2mass_extract(catpath, ra1, ra2, dec1, dec2);
-<a name="l00473"></a>00473     <span class="keywordflow">if</span>(stars == NULL)
-<a name="l00474"></a>00474     {
-<a name="l00475"></a>00475         cpl_msg_error(__func__,<span class="stringliteral">"Error retrieving 2mass stars: %s "</span>,
-<a name="l00476"></a>00476                       cpl_error_get_message());
-<a name="l00477"></a>00477         cpl_free(catname);
-<a name="l00478"></a>00478         cpl_free(catpath);
-<a name="l00479"></a>00479         cpl_wcs_delete(wcs);
-<a name="l00480"></a>00480         <span class="keywordflow">return</span> NULL;
-<a name="l00481"></a>00481     }
-<a name="l00482"></a>00482     nstars = cpl_table_get_nrow(stars);
-<a name="l00483"></a>00483     cpl_msg_indent_more();
-<a name="l00484"></a>00484     cpl_msg_info(__func__, <span class="stringliteral">"%d 2MASS stars found"</span>, nstars);
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     <span class="comment">/* Convert Ra, Dec to X,Y using the WCS information from image */</span>
-<a name="l00487"></a>00487     from_coord = cpl_matrix_new(nstars, 2);
-<a name="l00488"></a>00488     <span class="keywordflow">for</span> (istar=0; istar<nstars; istar++)
-<a name="l00489"></a>00489     {
-<a name="l00490"></a>00490         cpl_matrix_set(from_coord, istar, 0, cpl_table_get_float
-<a name="l00491"></a>00491                        (stars, HAWKI_COL_2MASS_RA, istar, NULL));
-<a name="l00492"></a>00492         cpl_matrix_set(from_coord, istar, 1, cpl_table_get_float
-<a name="l00493"></a>00493                        (stars, HAWKI_COL_2MASS_DEC, istar, NULL));
-<a name="l00494"></a>00494     }
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496     to_coord = NULL;
-<a name="l00497"></a>00497     status   = NULL;
-<a name="l00498"></a>00498     <span class="keywordflow">if</span>(cpl_wcs_convert(wcs, from_coord, &to_coord, 
-<a name="l00499"></a>00499                        &status, CPL_WCS_WORLD2PHYS) != CPL_ERROR_NONE)
-<a name="l00500"></a>00500     {
-<a name="l00501"></a>00501         cpl_array_delete(status);
-<a name="l00502"></a>00502         cpl_matrix_delete(from_coord);
-<a name="l00503"></a>00503         cpl_matrix_delete(to_coord);
-<a name="l00504"></a>00504         cpl_free(catname);
-<a name="l00505"></a>00505         cpl_free(catpath);
-<a name="l00506"></a>00506         cpl_wcs_delete(wcs);
-<a name="l00507"></a>00507         cpl_msg_error(cpl_func,<span class="stringliteral">"Error in cpl_wcs conversion. %s"</span>,
-<a name="l00508"></a>00508                       cpl_error_get_message());
-<a name="l00509"></a>00509         <span class="keywordflow">return</span> NULL;
-<a name="l00510"></a>00510     }
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="comment">/* Add the predicted x,y coordinate columns to the  2MASS table */</span>
-<a name="l00513"></a>00513     cpl_table_new_column(stars, HAWKI_COL_2MASS_XPREDICT, CPL_TYPE_FLOAT);
-<a name="l00514"></a>00514     cpl_table_set_column_unit(stars,HAWKI_COL_2MASS_XPREDICT, <span class="stringliteral">"pixels"</span>);
-<a name="l00515"></a>00515     cpl_table_new_column(stars, HAWKI_COL_2MASS_YPREDICT, CPL_TYPE_FLOAT);
-<a name="l00516"></a>00516     cpl_table_set_column_unit(stars, HAWKI_COL_2MASS_YPREDICT, <span class="stringliteral">"pixels"</span>);
-<a name="l00517"></a>00517     <span class="keywordflow">for</span>(istar=0; istar< nstars; istar++)
-<a name="l00518"></a>00518     {
-<a name="l00519"></a>00519         <span class="keywordtype">float</span> xpredict = (float)cpl_matrix_get(to_coord, istar, 0);
-<a name="l00520"></a>00520         <span class="keywordtype">float</span> ypredict = (float)cpl_matrix_get(to_coord, istar, 1);
-<a name="l00521"></a>00521         cpl_table_set_float(stars,<span class="stringliteral">"xpredict"</span>, istar, xpredict);
-<a name="l00522"></a>00522         cpl_table_set_float(stars,<span class="stringliteral">"ypredict"</span>, istar, ypredict);
-<a name="l00523"></a>00523     }
-<a name="l00524"></a>00524     
-<a name="l00525"></a>00525     <span class="comment">/* Free and return */</span>
-<a name="l00526"></a>00526     cpl_array_delete(status);
-<a name="l00527"></a>00527     cpl_matrix_delete(from_coord);
-<a name="l00528"></a>00528     cpl_matrix_delete(to_coord);
-<a name="l00529"></a>00529     cpl_wcs_delete(wcs);
-<a name="l00530"></a>00530     cpl_free(catname);
-<a name="l00531"></a>00531     cpl_free(catpath);
-<a name="l00532"></a>00532     cpl_msg_indent_less();
-<a name="l00533"></a>00533     <span class="keywordflow">return</span> stars;
-<a name="l00534"></a>00534 }
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00542"></a>00542 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00543"></a>00543 <span class="keyword">static</span> cpl_array *   hawki_step_photom_2mass_ppm
-<a name="l00544"></a>00544 (cpl_table *  stars_2mass,
-<a name="l00545"></a>00545  cpl_table *  obj_det)
-<a name="l00546"></a>00546 {
-<a name="l00547"></a>00547     <span class="keywordtype">int</span>                istar;
-<a name="l00548"></a>00548     <span class="keywordtype">int</span>                iobj;
-<a name="l00549"></a>00549     <span class="keywordtype">int</span>                iter;
-<a name="l00550"></a>00550     <span class="keywordtype">int</span>                nstars_2mass;
-<a name="l00551"></a>00551     <span class="keywordtype">int</span>                nstars_2mass_used_match;
-<a name="l00552"></a>00552     <span class="keywordtype">int</span>                nobj;
-<a name="l00553"></a>00553     <span class="keywordtype">int</span>                nobj_used_match;
-<a name="l00554"></a>00554     <span class="keywordtype">int</span>                nmatches;
-<a name="l00555"></a>00555     <span class="keywordtype">int</span>                nmax_match_pattern = 30;
-<a name="l00556"></a>00556     cpl_matrix *       pattern;
-<a name="l00557"></a>00557     cpl_array *        matches;
-<a name="l00558"></a>00558     <span class="keywordtype">double</span>             tol = 0.1;
-<a name="l00559"></a>00559     <span class="keywordtype">double</span>             pradius = 30.0;
-<a name="l00560"></a>00560     <span class="keywordtype">double</span>             mean_data_pos_err = 5.;
-<a name="l00561"></a>00561     <span class="keywordtype">int</span>                ppm_max_iter = 5;
-<a name="l00562"></a>00562     <span class="keywordtype">double</span>             scale = 1;
-<a name="l00563"></a>00563     <span class="keywordtype">double</span>             angle;
-<a name="l00564"></a>00564     cpl_matrix *       obj_pos;
-<a name="l00565"></a>00565     cpl_propertylist * sort_prop;
-<a name="l00566"></a>00566     
-<a name="l00567"></a>00567     
-<a name="l00568"></a>00568     <span class="comment">/* Sort the detected objects */</span>
-<a name="l00569"></a>00569     cpl_msg_indent_more();
-<a name="l00570"></a>00570     sort_prop = cpl_propertylist_new();
-<a name="l00571"></a>00571     cpl_propertylist_append_bool(sort_prop, HAWKI_COL_OBJ_FLUX, 1);
-<a name="l00572"></a>00572     <span class="keywordflow">if</span> (cpl_table_sort(obj_det, sort_prop) != CPL_ERROR_NONE) 
-<a name="l00573"></a>00573     {
-<a name="l00574"></a>00574         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot sort detected sources table"</span>);
-<a name="l00575"></a>00575         cpl_propertylist_delete(sort_prop);
-<a name="l00576"></a>00576         <span class="keywordflow">return</span> NULL;
-<a name="l00577"></a>00577     }
-<a name="l00578"></a>00578 
-<a name="l00579"></a>00579     <span class="comment">/* Create matrix of X,Y coordinates of detected objects*/</span>
-<a name="l00580"></a>00580     nobj = cpl_table_get_nrow(obj_det);
-<a name="l00581"></a>00581     obj_pos = cpl_matrix_new(2, nobj);
-<a name="l00582"></a>00582     <span class="keywordflow">for</span> (iobj=0; iobj<nobj; iobj++)
-<a name="l00583"></a>00583     {
-<a name="l00584"></a>00584         <span class="keywordtype">float</span> xim = cpl_table_get_double
-<a name="l00585"></a>00585             (obj_det, HAWKI_COL_OBJ_POSX, iobj, NULL); 
-<a name="l00586"></a>00586         <span class="keywordtype">float</span> yim = cpl_table_get_double
-<a name="l00587"></a>00587             (obj_det, HAWKI_COL_OBJ_POSY, iobj, NULL);
-<a name="l00588"></a>00588         cpl_matrix_set(obj_pos, 0, iobj, xim);
-<a name="l00589"></a>00589         cpl_matrix_set(obj_pos, 1, iobj, yim);
-<a name="l00590"></a>00590     }
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="comment">/* Sort the 2MASS stars by magnitude */</span>
-<a name="l00593"></a>00593     cpl_propertylist_empty(sort_prop);
-<a name="l00594"></a>00594     cpl_propertylist_append_bool(sort_prop, HAWKI_COL_2MASS_K_MAG, 0);
-<a name="l00595"></a>00595     <span class="keywordflow">if</span> (cpl_table_sort(stars_2mass, sort_prop) != CPL_ERROR_NONE) 
-<a name="l00596"></a>00596     {
-<a name="l00597"></a>00597         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot sort 2MASS stars table"</span>);
-<a name="l00598"></a>00598         cpl_propertylist_delete(sort_prop);
-<a name="l00599"></a>00599         <span class="keywordflow">return</span> NULL;
-<a name="l00600"></a>00600     }
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     <span class="comment">/* Prepare the 2MASS matrix for the pattern matching */</span>
-<a name="l00603"></a>00603     nstars_2mass = cpl_table_get_nrow(stars_2mass);
-<a name="l00604"></a>00604     pattern = cpl_matrix_new(2, nstars_2mass);
-<a name="l00605"></a>00605     <span class="keywordflow">for</span>(istar=0; istar<nstars_2mass ; istar++)
-<a name="l00606"></a>00606     {
-<a name="l00607"></a>00607         <span class="keywordtype">float</span> x = cpl_table_get_float
-<a name="l00608"></a>00608             (stars_2mass, HAWKI_COL_2MASS_XPREDICT, istar, NULL);
-<a name="l00609"></a>00609         <span class="keywordtype">float</span> y = cpl_table_get_float
-<a name="l00610"></a>00610             (stars_2mass, HAWKI_COL_2MASS_YPREDICT, istar, NULL);
-<a name="l00611"></a>00611         cpl_matrix_set(pattern, 0, istar, x);
-<a name="l00612"></a>00612         cpl_matrix_set(pattern, 1, istar, y);
-<a name="l00613"></a>00613     }
-<a name="l00614"></a>00614     
-<a name="l00615"></a>00615     <span class="comment">/* Do the ppm */</span>
-<a name="l00616"></a>00616     nstars_2mass_used_match = nmax_match_pattern;
-<a name="l00617"></a>00617     <span class="keywordflow">if</span>(nstars_2mass < nmax_match_pattern)
-<a name="l00618"></a>00618         nstars_2mass_used_match = nstars_2mass;
-<a name="l00619"></a>00619     nobj_used_match = (int)(1.7 * nstars_2mass_used_match);
-<a name="l00620"></a>00620     <span class="keywordflow">if</span>(nobj_used_match > nobj)
-<a name="l00621"></a>00621         nobj_used_match = nobj;
-<a name="l00622"></a>00622     <span class="keywordflow">if</span>(nobj_used_match < nstars_2mass_used_match)
-<a name="l00623"></a>00623         nobj_used_match = nstars_2mass_used_match;
-<a name="l00624"></a>00624     cpl_msg_info(__func__,<span class="stringliteral">"The first step match will use %d stars "</span>
-<a name="l00625"></a>00625                  <span class="stringliteral">"and %d objects"</span>, nstars_2mass_used_match,nobj_used_match);
-<a name="l00626"></a>00626     <span class="keywordflow">for</span> (iter = 0; iter < ppm_max_iter; iter++)
-<a name="l00627"></a>00627     {
-<a name="l00628"></a>00628         <span class="keywordtype">int</span> nmatchsize;
-<a name="l00629"></a>00629         nmatches = 0;
-<a name="l00630"></a>00630         matches = cpl_ppm_match_points(obj_pos, nobj_used_match, 
-<a name="l00631"></a>00631                                        mean_data_pos_err,
-<a name="l00632"></a>00632                                        pattern, nstars_2mass_used_match,
-<a name="l00633"></a>00633                                        1, tol, pradius,
-<a name="l00634"></a>00634                                        NULL, NULL, &scale, &angle);
-<a name="l00635"></a>00635         <span class="keywordflow">if</span>(matches != NULL)
-<a name="l00636"></a>00636         {
-<a name="l00637"></a>00637             nmatchsize = cpl_array_get_size(matches);
-<a name="l00638"></a>00638             nmatches = nmatchsize -
-<a name="l00639"></a>00639                 cpl_array_count_invalid(matches);
-<a name="l00640"></a>00640         }
-<a name="l00641"></a>00641         <span class="keywordflow">else</span>
-<a name="l00642"></a>00642         {
-<a name="l00643"></a>00643             nmatchsize = 0;
-<a name="l00644"></a>00644             nmatches = 0;
-<a name="l00645"></a>00645         }
-<a name="l00646"></a>00646         
-<a name="l00647"></a>00647         cpl_msg_info(cpl_func,<span class="stringliteral">"Total matches: %d. Valid matches: %d"</span>,
-<a name="l00648"></a>00648                      nmatchsize, nmatches);
-<a name="l00649"></a>00649         cpl_msg_info(cpl_func,<span class="stringliteral">"Scale=%g angle=%g"</span>, scale, angle);
-<a name="l00650"></a>00650         <span class="keywordflow">if</span>((matches == NULL) || (nmatches < floor(nobj_used_match*0.1))) 
-<a name="l00651"></a>00651         {
-<a name="l00652"></a>00652             nobj_used_match = nobj_used_match + 10;
-<a name="l00653"></a>00653             cpl_msg_info(cpl_func,
-<a name="l00654"></a>00654                          <span class="stringliteral">"Increasing number of detections used in PPM to %d"</span>,
-<a name="l00655"></a>00655                          nobj_used_match);
-<a name="l00656"></a>00656             <span class="keywordflow">continue</span>;
-<a name="l00657"></a>00657         }
-<a name="l00658"></a>00658         <span class="keywordflow">else</span>
-<a name="l00659"></a>00659             <span class="keywordflow">break</span>;
-<a name="l00660"></a>00660     }
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662     <span class="comment">/* Output debug messages */</span>
-<a name="l00663"></a>00663     cpl_msg_indent_more();
-<a name="l00664"></a>00664     cpl_msg_debug(__func__,<span class="stringliteral">"Matched stars:"</span>);
-<a name="l00665"></a>00665     cpl_msg_indent_more();
-<a name="l00666"></a>00666     cpl_msg_debug(__func__,<span class="stringliteral">"X_OBJ  Y_OBJ    X_STAR Y_STAR   X_DIFF Y_DIFF:"</span>);
-<a name="l00667"></a>00667     <span class="keywordflow">for</span>(istar=0; istar < nstars_2mass; ++istar)
-<a name="l00668"></a>00668     {
-<a name="l00669"></a>00669         <span class="keywordtype">int</span>  null;
-<a name="l00670"></a>00670         <span class="keywordtype">double</span> x_obj, y_obj, x_star, y_star, x_diff, y_diff;
-<a name="l00671"></a>00671         iobj  = cpl_array_get_int(matches, istar, &null);
-<a name="l00672"></a>00672         
-<a name="l00673"></a>00673         <span class="keywordflow">if</span>(null != 0)
-<a name="l00674"></a>00674             <span class="keywordflow">continue</span>;
-<a name="l00675"></a>00675         x_obj = cpl_matrix_get(obj_pos, 0, iobj);
-<a name="l00676"></a>00676         y_obj = cpl_matrix_get(obj_pos, 1, iobj);
-<a name="l00677"></a>00677         x_star = cpl_matrix_get(pattern, 0, istar);
-<a name="l00678"></a>00678         y_star = cpl_matrix_get(pattern, 1, istar);
-<a name="l00679"></a>00679         x_diff = x_obj - x_star;
-<a name="l00680"></a>00680         y_diff = y_obj - y_star;
-<a name="l00681"></a>00681         cpl_msg_debug(__func__,<span class="stringliteral">"%6.1f %6.1f  %6.1f %6.1f   %6.1f %6.1f\n"</span>,
-<a name="l00682"></a>00682                       x_obj, y_obj, x_star, y_star, x_diff, y_diff);
-<a name="l00683"></a>00683     }
-<a name="l00684"></a>00684     cpl_msg_indent_less();    
-<a name="l00685"></a>00685     cpl_msg_indent_less();
-<a name="l00686"></a>00686     
-<a name="l00687"></a>00687     cpl_matrix_delete(pattern);
-<a name="l00688"></a>00688     cpl_msg_info(cpl_func, <span class="stringliteral">"%d points matched"</span>, nmatches);
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     <span class="keywordflow">if</span>(matches == NULL || nmatches == 0)
-<a name="l00691"></a>00691     {
-<a name="l00692"></a>00692         <span class="keywordflow">if</span>(nmatches == 0)
-<a name="l00693"></a>00693             cpl_array_delete(matches);
-<a name="l00694"></a>00694         cpl_msg_error(cpl_func,<span class="stringliteral">"Error in PPM. %s"</span>,cpl_error_get_message());
-<a name="l00695"></a>00695         cpl_matrix_delete(obj_pos);
-<a name="l00696"></a>00696         cpl_propertylist_delete(sort_prop);
-<a name="l00697"></a>00697         cpl_msg_indent_less();
-<a name="l00698"></a>00698         <span class="keywordflow">return</span> NULL;
-<a name="l00699"></a>00699     }
-<a name="l00700"></a>00700     
-<a name="l00701"></a>00701     <span class="keywordflow">if</span>(nmatches < floor(nobj_used_match*0.1))
-<a name="l00702"></a>00702     {
-<a name="l00703"></a>00703         cpl_msg_warning(cpl_func,<span class="stringliteral">"PPM detected matched only %d objects."</span>
-<a name="l00704"></a>00704                         <span class="stringliteral">" Results could be unreliable"</span>,nmatches);
-<a name="l00705"></a>00705     }
-<a name="l00706"></a>00706     
-<a name="l00707"></a>00707     <span class="comment">/* Free and return */</span>
-<a name="l00708"></a>00708     cpl_matrix_delete(obj_pos);
-<a name="l00709"></a>00709     cpl_propertylist_delete(sort_prop);
-<a name="l00710"></a>00710     cpl_msg_indent_less();
-<a name="l00711"></a>00711     <span class="keywordflow">return</span> matches;
-<a name="l00712"></a>00712 }
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00719"></a>00719 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00720"></a>00720 <span class="keyword">static</span> cpl_table * hawki_step_photom_2mass_fill_zpoint_table
-<a name="l00721"></a>00721 (cpl_table *        stars_2mass,
-<a name="l00722"></a>00722  cpl_table *        obj_det_param,
-<a name="l00723"></a>00723  cpl_array *        matches,
-<a name="l00724"></a>00724  cpl_propertylist * plist,
-<a name="l00725"></a>00725  <span class="keywordtype">int</span>                idet)
-<a name="l00726"></a>00726 {
-<a name="l00727"></a>00727     cpl_table    * zpoints;
-<a name="l00728"></a>00728     <span class="keywordtype">int</span>            nmatches;
-<a name="l00729"></a>00729     <span class="keywordtype">int</span>            nstars;
-<a name="l00730"></a>00730     <span class="keywordtype">int</span>            imatch;
-<a name="l00731"></a>00731     <span class="keywordtype">int</span>            istar;
-<a name="l00732"></a>00732     <span class="keyword">const</span> <span class="keywordtype">char</span>   * filter;
-<a name="l00733"></a>00733     <span class="keywordtype">char</span>           magcol_2mass[100];
-<a name="l00734"></a>00734     <span class="keywordtype">char</span>           magerrcol_2mass[100];
-<a name="l00735"></a>00735     <span class="keywordtype">double</span>         dit;
-<a name="l00736"></a>00736     <span class="keywordtype">double</span>         airmass;
-<a name="l00737"></a>00737     <span class="keywordtype">double</span>         pixscale;
-<a name="l00738"></a>00738     <span class="keywordtype">double</span>         extinction;
-<a name="l00739"></a>00739     cpl_errorstate error_prevstate = cpl_errorstate_get();
-<a name="l00740"></a>00740     
-<a name="l00741"></a>00741     <span class="comment">/* Read parameters from the propertylist */</span>
-<a name="l00742"></a>00742     airmass  = (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) +
-<a name="l00743"></a>00743                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist)) / 2.;
-<a name="l00744"></a>00744     filter   = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist);
-<a name="l00745"></a>00745     dit      = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);
-<a name="l00746"></a>00746     pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist);
-<a name="l00747"></a>00747     <span class="keywordflow">switch</span> (<a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(filter))
-<a name="l00748"></a>00748     {
-<a name="l00749"></a>00749         <span class="keywordflow">case</span> HAWKI_BAND_J:    
-<a name="l00750"></a>00750             extinction = 0.098;
-<a name="l00751"></a>00751             strcpy(magcol_2mass, HAWKI_COL_2MASS_J_MAG);
-<a name="l00752"></a>00752             strcpy(magerrcol_2mass, HAWKI_COL_2MASS_J_MAGSIG);
-<a name="l00753"></a>00753             break ;
-<a name="l00754"></a>00754         <span class="keywordflow">case</span> HAWKI_BAND_H:
-<a name="l00755"></a>00755             extinction = 0.039;
-<a name="l00756"></a>00756             strcpy(magcol_2mass, HAWKI_COL_2MASS_H_MAG);
-<a name="l00757"></a>00757             strcpy(magerrcol_2mass, HAWKI_COL_2MASS_H_MAGSIG);
-<a name="l00758"></a>00758             break ;
-<a name="l00759"></a>00759         <span class="keywordflow">case</span> HAWKI_BAND_K:
-<a name="l00760"></a>00760             extinction = 0.065;
-<a name="l00761"></a>00761             strcpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG);
-<a name="l00762"></a>00762             strcpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG);
-<a name="l00763"></a>00763             break ;
-<a name="l00764"></a>00764         <span class="keywordflow">default</span>: 
-<a name="l00765"></a>00765             extinction = 0.00;
-<a name="l00766"></a>00766             cpl_msg_warning(__func__,<span class="stringliteral">"The filter %s does not exist in 2MASS. "</span>
-<a name="l00767"></a>00767                             <span class="stringliteral">"The 2MASS K band will be used instead. "</span>
-<a name="l00768"></a>00768                             <span class="stringliteral">"Columns %s, %s, %s and %s in product will not "</span>
-<a name="l00769"></a>00769                             <span class="stringliteral">"be accurate"</span>, filter, 
-<a name="l00770"></a>00770                             HAWKI_COL_ZPOINT_MAG, HAWKI_COL_ZPOINT_ERRMAG,
-<a name="l00771"></a>00771                             HAWKI_COL_ZPOINT_ZPOINT, HAWKI_COL_ZPOINT_ATX0);
-<a name="l00772"></a>00772             strcpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG);
-<a name="l00773"></a>00773             strcpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG);
-<a name="l00774"></a>00774             break ;
-<a name="l00775"></a>00775     }
-<a name="l00776"></a>00776                 
-<a name="l00777"></a>00777     <span class="comment">/* Select only stars in 2MASS that have the given magnitude */</span>
-<a name="l00778"></a>00778     <span class="comment">//irplib_stdstar_select_stars_mag(stars_2mass, magcol_2mass);</span>
-<a name="l00779"></a>00779     <span class="comment">//cpl_msg_warning(__func__,"Paso irplib");</span>
-<a name="l00780"></a>00780     
-<a name="l00781"></a>00781     <span class="comment">/* Create the table */</span>
-<a name="l00782"></a>00782     nstars = cpl_table_get_nrow(stars_2mass);
-<a name="l00783"></a>00783     nmatches = cpl_array_get_size(matches) - cpl_array_count_invalid(matches);
-<a name="l00784"></a>00784     zpoints = cpl_table_new(nmatches) ;
-<a name="l00785"></a>00785     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_CHIP, CPL_TYPE_INT) ;
-<a name="l00786"></a>00786     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_POSX, CPL_TYPE_DOUBLE) ;
-<a name="l00787"></a>00787     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_POSY, CPL_TYPE_DOUBLE) ;
-<a name="l00788"></a>00788     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ZPOINT, CPL_TYPE_DOUBLE) ;
-<a name="l00789"></a>00789     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ATX0, CPL_TYPE_DOUBLE) ;
-<a name="l00790"></a>00790     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_MAG, CPL_TYPE_DOUBLE) ;
-<a name="l00791"></a>00791     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ERRMAG, CPL_TYPE_DOUBLE) ;
-<a name="l00792"></a>00792     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_AIRMASS, CPL_TYPE_DOUBLE) ;
-<a name="l00793"></a>00793     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FLUX, CPL_TYPE_DOUBLE) ;
-<a name="l00794"></a>00794     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FILTER, CPL_TYPE_STRING) ;
-<a name="l00795"></a>00795 <span class="comment">//    cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_PEAK, CPL_TYPE_DOUBLE) ;</span>
-<a name="l00796"></a>00796 <span class="comment">//    cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_BGD, CPL_TYPE_DOUBLE) ;</span>
-<a name="l00797"></a>00797     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMX, CPL_TYPE_DOUBLE) ;
-<a name="l00798"></a>00798     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMY, CPL_TYPE_DOUBLE) ;
-<a name="l00799"></a>00799     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHM, CPL_TYPE_DOUBLE) ;
-<a name="l00800"></a>00800     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMX_AS, CPL_TYPE_DOUBLE) ;
-<a name="l00801"></a>00801     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMY_AS, CPL_TYPE_DOUBLE) ;
-<a name="l00802"></a>00802     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHM_AS, CPL_TYPE_DOUBLE) ;
-<a name="l00803"></a>00803     imatch = 0;
-<a name="l00804"></a>00804     
-<a name="l00805"></a>00805     <span class="keywordflow">for</span> (istar=0; istar<nstars; istar++) 
-<a name="l00806"></a>00806     {
-<a name="l00807"></a>00807         <span class="keywordtype">int</span>      iobj;
-<a name="l00808"></a>00808         <span class="keywordtype">int</span>      null;
-<a name="l00809"></a>00809         <span class="keywordtype">double</span>   zpoint;
-<a name="l00810"></a>00810         <span class="keywordtype">double</span>   atx0;
-<a name="l00811"></a>00811         <span class="keywordtype">double</span>   flux;
-<a name="l00812"></a>00812         <span class="keywordtype">double</span>   mag;
-<a name="l00813"></a>00813         <span class="keywordtype">double</span>   errmag;
-<a name="l00814"></a>00814         <span class="keywordtype">double</span>   fwhm_x;
-<a name="l00815"></a>00815         <span class="keywordtype">double</span>   fwhm_y;
-<a name="l00816"></a>00816         <span class="keywordtype">double</span>   fwhm;
-<a name="l00817"></a>00817         
-<a name="l00818"></a>00818         iobj  = cpl_array_get_int(matches, istar, &null);
-<a name="l00819"></a>00819         
-<a name="l00820"></a>00820         <span class="keywordflow">if</span>(null != 0)
-<a name="l00821"></a>00821             <span class="keywordflow">continue</span>;
-<a name="l00822"></a>00822         <span class="keywordflow">if</span>(!cpl_table_is_selected(stars_2mass, istar))
-<a name="l00823"></a>00823             <span class="keywordflow">continue</span>;
-<a name="l00824"></a>00824        
-<a name="l00825"></a>00825         flux = cpl_table_get_double
-<a name="l00826"></a>00826             (obj_det_param, HAWKI_COL_OBJ_FLUX, iobj, NULL);
-<a name="l00827"></a>00827         mag = cpl_table_get_float
-<a name="l00828"></a>00828             (stars_2mass, magcol_2mass, istar, NULL); 
-<a name="l00829"></a>00829         errmag = cpl_table_get_float
-<a name="l00830"></a>00830             (stars_2mass, magerrcol_2mass, istar, NULL);
-<a name="l00831"></a>00831         zpoint = mag + 2.5 * log10(flux) - 2.5 * log10(dit);
-<a name="l00832"></a>00832         atx0 = zpoint + airmass * extinction;
-<a name="l00833"></a>00833         fwhm_x = cpl_table_get_double
-<a name="l00834"></a>00834             (obj_det_param, HAWKI_COL_OBJ_FWHM_MAJAX, iobj, NULL);
-<a name="l00835"></a>00835         fwhm_y = cpl_table_get_double
-<a name="l00836"></a>00836             (obj_det_param, HAWKI_COL_OBJ_FWHM_MINAX, iobj, NULL);
-<a name="l00837"></a>00837         fwhm   = sqrt(fwhm_x*fwhm_y); 
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839         cpl_table_set_int(zpoints, HAWKI_COL_ZPOINT_CHIP, imatch, idet + 1) ;
-<a name="l00840"></a>00840         cpl_table_set_double
-<a name="l00841"></a>00841             (zpoints, HAWKI_COL_ZPOINT_MAG, imatch, mag);
-<a name="l00842"></a>00842         cpl_table_set_double
-<a name="l00843"></a>00843             (zpoints, HAWKI_COL_ZPOINT_ERRMAG, imatch, errmag);
-<a name="l00844"></a>00844         cpl_table_set_string
-<a name="l00845"></a>00845             (zpoints, HAWKI_COL_ZPOINT_FILTER, imatch, filter);
-<a name="l00846"></a>00846         cpl_table_set_double
-<a name="l00847"></a>00847             (zpoints, HAWKI_COL_ZPOINT_AIRMASS, imatch, airmass);
-<a name="l00848"></a>00848         cpl_table_set_double
-<a name="l00849"></a>00849             (zpoints, HAWKI_COL_ZPOINT_POSX, imatch, cpl_table_get_double
-<a name="l00850"></a>00850              (obj_det_param, HAWKI_COL_OBJ_POSX, iobj, NULL));
-<a name="l00851"></a>00851         cpl_table_set_double
-<a name="l00852"></a>00852             (zpoints, HAWKI_COL_ZPOINT_POSY, imatch, cpl_table_get_double
-<a name="l00853"></a>00853              (obj_det_param, HAWKI_COL_OBJ_POSY, iobj, NULL));
-<a name="l00854"></a>00854         cpl_table_set_double(zpoints, HAWKI_COL_ZPOINT_ZPOINT, imatch, zpoint);
-<a name="l00855"></a>00855         cpl_table_set_double(zpoints, HAWKI_COL_ZPOINT_ATX0, imatch, atx0);
-<a name="l00856"></a>00856         cpl_table_set_double
-<a name="l00857"></a>00857             (zpoints, HAWKI_COL_ZPOINT_FLUX, imatch, flux);
-<a name="l00858"></a>00858 <span class="comment">//        cpl_table_set_double(tab, HAWKI_COL_ZPOINT_PEAK, imatch, </span>
-<a name="l00859"></a>00859 <span class="comment">//                hawki_img_zpoint_outputs.peak[labels[iframe]-1]) ;</span>
-<a name="l00860"></a>00860 <span class="comment">//        cpl_table_set_double(tab, HAWKI_COL_ZPOINT_BGD, imatch, </span>
-<a name="l00861"></a>00861 <span class="comment">//                hawki_img_zpoint_outputs.bgd[labels[iframe]-1]) ;</span>
-<a name="l00862"></a>00862         cpl_table_set_double
-<a name="l00863"></a>00863             (zpoints, HAWKI_COL_ZPOINT_FWHMX, imatch, fwhm_x);
-<a name="l00864"></a>00864         cpl_table_set_double
-<a name="l00865"></a>00865             (zpoints, HAWKI_COL_ZPOINT_FWHMY, imatch, fwhm_y);
-<a name="l00866"></a>00866         cpl_table_set_double
-<a name="l00867"></a>00867             (zpoints, HAWKI_COL_ZPOINT_FWHM, imatch, fwhm);
-<a name="l00868"></a>00868         cpl_table_set_double
-<a name="l00869"></a>00869             (zpoints, HAWKI_COL_ZPOINT_FWHMX_AS, imatch, fwhm_x * pixscale);
-<a name="l00870"></a>00870         cpl_table_set_double
-<a name="l00871"></a>00871             (zpoints, HAWKI_COL_ZPOINT_FWHMY_AS, imatch, fwhm_y * pixscale);
-<a name="l00872"></a>00872         cpl_table_set_double
-<a name="l00873"></a>00873             (zpoints, HAWKI_COL_ZPOINT_FWHM_AS, imatch, fwhm * pixscale);
-<a name="l00874"></a>00874         ++imatch;
-<a name="l00875"></a>00875     }
-<a name="l00876"></a>00876     
-<a name="l00877"></a>00877     <span class="comment">/* Check error and return */</span>
-<a name="l00878"></a>00878     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00879"></a>00879     {
-<a name="l00880"></a>00880         cpl_msg_error(__func__,<span class="stringliteral">"An error happened filling the zpoint table: %s"</span>,
-<a name="l00881"></a>00881                       cpl_error_get_message());
-<a name="l00882"></a>00882         cpl_table_delete(zpoints);
-<a name="l00883"></a>00883         <span class="keywordflow">return</span> NULL;
-<a name="l00884"></a>00884     }
-<a name="l00885"></a>00885     <span class="keywordflow">return</span> zpoints;
-<a name="l00886"></a>00886 }
-<a name="l00887"></a>00887 
-<a name="l00888"></a>00888 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00893"></a>00893 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00894"></a>00894 <span class="keyword">static</span> cpl_propertylist ** hawki_step_photom_2mass_qc
-<a name="l00895"></a>00895 (cpl_table ** zpoint_table)
-<a name="l00896"></a>00896 {
-<a name="l00897"></a>00897     <span class="keywordtype">int</span> idet;
-<a name="l00898"></a>00898     cpl_propertylist ** qclists;
-<a name="l00899"></a>00899     
-<a name="l00900"></a>00900     <span class="comment">/* Allocate the qclists */</span>
-<a name="l00901"></a>00901     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00902"></a>00902     
-<a name="l00903"></a>00903     <span class="comment">/* Loop on the detectors to get the mean zpoint */</span>
-<a name="l00904"></a>00904     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS ; ++idet)
-<a name="l00905"></a>00905     {
-<a name="l00906"></a>00906         <span class="keywordtype">double</span> mean_zpoint;
-<a name="l00907"></a>00907 
-<a name="l00908"></a>00908         <span class="comment">/* Allocate this qclist */</span>
-<a name="l00909"></a>00909         qclists[idet] = cpl_propertylist_new() ;
-<a name="l00910"></a>00910         
-<a name="l00911"></a>00911         <span class="comment">/* Compute the mean zpoint */</span>
-<a name="l00912"></a>00912         mean_zpoint = cpl_table_get_column_mean(zpoint_table[idet],
-<a name="l00913"></a>00913                                                 HAWKI_COL_ZPOINT_ZPOINT);
-<a name="l00914"></a>00914         
-<a name="l00915"></a>00915         cpl_propertylist_append_double
-<a name="l00916"></a>00916             (qclists[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>, mean_zpoint);
-<a name="l00917"></a>00917     }
-<a name="l00918"></a>00918     
-<a name="l00919"></a>00919     <span class="keywordflow">return</span> qclists;
-<a name="l00920"></a>00920 }
-<a name="l00921"></a>00921 
-<a name="l00922"></a>00922 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00932"></a>00932 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00933"></a>00933 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_save
-<a name="l00934"></a>00934 (cpl_table **         zpoints,
-<a name="l00935"></a>00935  cpl_parameterlist *  parlist,
-<a name="l00936"></a>00936  cpl_propertylist **  qclists,
-<a name="l00937"></a>00937  cpl_frameset *       <span class="keyword">set</span>)
-<a name="l00938"></a>00938 {
-<a name="l00939"></a>00939     cpl_propertylist *   protype;
-<a name="l00940"></a>00940     cpl_frame *          ref_frame ;
-<a name="l00941"></a>00941     cpl_frameset *       combinedframes;
-<a name="l00942"></a>00942     <span class="keywordtype">int</span>                  nframes ;
-<a name="l00943"></a>00943     <span class="keyword">const</span> <span class="keywordtype">char</span> *         recipe_name = <span class="stringliteral">"hawki_step_photom_2mass"</span> ;
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945     <span class="comment">/* Initialise */</span>
-<a name="l00946"></a>00946     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l00947"></a>00947 
-<a name="l00948"></a>00948     <span class="comment">/* Get the reference frame */</span>
-<a name="l00949"></a>00949     combinedframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(<span class="keyword">set</span>, HAWKI_CALPRO_COMBINED);
-<a name="l00950"></a>00950     ref_frame = cpl_frameset_get_first(combinedframes);
-<a name="l00951"></a>00951 
-<a name="l00952"></a>00952     <span class="comment">/* Create the protype lists */</span>
-<a name="l00953"></a>00953     protype = cpl_propertylist_new();
-<a name="l00954"></a>00954     cpl_propertylist_append_string(protype, <span class="stringliteral">"ESO PRO TYPE"</span>,
-<a name="l00955"></a>00955             HAWKI_PROTYPE_ZPOINT_TAB);
-<a name="l00956"></a>00956 
-<a name="l00957"></a>00957     <span class="comment">/* Write the zpoint table  */</span>
-<a name="l00958"></a>00958     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l00959"></a>00959                       parlist,
-<a name="l00960"></a>00960                       <span class="keyword">set</span>,
-<a name="l00961"></a>00961                       (<span class="keyword">const</span> cpl_table **)zpoints,
-<a name="l00962"></a>00962                       recipe_name,
-<a name="l00963"></a>00963                       HAWKI_CALPRO_ZPOINT_TAB,
-<a name="l00964"></a>00964                       HAWKI_PROTYPE_ZPOINT_TAB,
-<a name="l00965"></a>00965                       protype,
-<a name="l00966"></a>00966                       (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l00967"></a>00967                       <span class="stringliteral">"hawki_step_photom_2mass.fits"</span>) ;
-<a name="l00968"></a>00968 
-<a name="l00969"></a>00969     <span class="comment">/* Free and return */</span>
-<a name="l00970"></a>00970     cpl_propertylist_delete(protype);
-<a name="l00971"></a>00971     cpl_frameset_delete(combinedframes);
-<a name="l00972"></a>00972     <span class="keywordflow">return</span>  0;
-<a name="l00973"></a>00973 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_photom_2mass.c,v 1.18 2013/01/14 15:58:23 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/01/14 15:58:23 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.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 "hawki_alloc.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "irplib_cat.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "irplib_stdstar.h"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass(cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                    cpl_frameset        *   frameset);</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> cpl_table ** hawki_step_photom_2mass_get_zpoints</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> (cpl_frameset *     cat_2mass,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  cpl_frameset *     obj_param,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_frameset *     obj_ima);</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> cpl_table * hawki_step_photom_2mass_retrieve_stars</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> (cpl_frameset *     cat_2mass,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_propertylist * wcs_keywords);</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">static</span> cpl_array *  hawki_step_photom_2mass_ppm</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> (cpl_table *  stars_2mass,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_table *  obj_det);</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> cpl_table * hawki_step_photom_2mass_fill_zpoint_table</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> (cpl_table *        stars_2mass,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_table *        obj_det_param,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_array *        matches,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  cpl_propertylist * plist,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  <span class="keywordtype">int</span>                idet);</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="keyword">static</span> cpl_propertylist ** hawki_step_photom_2mass_qc</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> (cpl_table ** zpoint_table);</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">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_save</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> (cpl_table **              zpoints,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>  cpl_parameterlist *       parlist,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  cpl_propertylist **       qclists,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>  cpl_frameset *            <span class="keyword">set</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_photom_2mass_description[] = </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"hawki_step_photom_2mass -- HAWK-I photometric autocalibration using 2MASS.\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"The input files must be tagged:\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"obj_param.fits "</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="stringliteral">"image.fits "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="stringliteral">"2mass_master_index.fits "</span>HAWKI_UTIL_CAT_2MASS<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"hawki_cal_photom_2mass.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): \n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"The recipe does the following steps:\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"-Search the 2MASS catalogue for stars in the FOV\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"-Matches the input detected object catalogue and the 2MASS stars\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"-Computes photometric characteristics for each matched star\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"or 1 otherwise"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="comment">                                Functions code</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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 = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_plugin *   plugin = &recipe->interface ;</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>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                     <span class="stringliteral">"hawki_step_photom_2mass"</span>,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                     <span class="stringliteral">"2MASS photometric calibration"</span>,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                     hawki_step_photom_2mass_description,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     hawki_step_photom_2mass_create,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     hawki_step_photom_2mass_exec,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     hawki_step_photom_2mass_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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_create(cpl_plugin * plugin)</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_recipe *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</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>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">return</span> 0;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_exec(cpl_plugin * plugin)</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 ;</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">/* Get the recipe out of the plugin */</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> <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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_photom_2mass(recipe->parameters, recipe->frames) ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="keywordflow">else</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>     <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 class="line"><a name="l00223"></a><span class="lineno">  223</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">  230</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass(cpl_parameterlist *   parlist,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                    cpl_frameset *        frameset)</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_frameset *      cat_2mass;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_frameset *      obj_param;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_frameset *      obj_ima;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_table **        zpoint_table;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_propertylist ** qclists;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="keywordtype">int</span>                 idet;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve 2MASS catalogue */</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keywordflow">if</span> ((cat_2mass = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(frameset,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                     HAWKI_UTIL_CAT_2MASS)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find 2MASS catalogue (%s)"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                 HAWKI_UTIL_CAT_2MASS);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve obj param */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keywordflow">if</span> ((obj_param = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>             (frameset, HAWKI_CALPRO_OBJ_PARAM)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find object parameters (%s)"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                 HAWKI_CALPRO_OBJ_PARAM);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve reference image */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="keywordflow">if</span> ((obj_ima = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>             (frameset, HAWKI_CALPRO_COMBINED)) == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find combined image (%s) "</span>,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                 HAWKI_CALPRO_COMBINED);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         <span class="keywordflow">return</span> -1 ;</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">/* Compute the zpoints */</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     zpoint_table = hawki_step_photom_2mass_get_zpoints</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         (cat_2mass, obj_param, obj_ima);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keywordflow">if</span>(zpoint_table == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not get the zpoints"</span>);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         cpl_frameset_delete(cat_2mass);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         cpl_frameset_delete(obj_param);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         cpl_frameset_delete(obj_ima);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>         <span class="keywordflow">return</span> -1;</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">/* Get some QC */</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     qclists =  hawki_step_photom_2mass_qc(zpoint_table);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span>(zpoint_table == NULL)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not compute quality controls"</span>);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         cpl_frameset_delete(cat_2mass);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         cpl_frameset_delete(obj_param);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         cpl_frameset_delete(obj_ima);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Save the products */</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_msg_info(__func__,<span class="stringliteral">"Saving products"</span>);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">if</span>(hawki_step_photom_2mass_save(zpoint_table, parlist, qclists, frameset) == -1)</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_error(__func__,<span class="stringliteral">"Could not save products"</span>);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         cpl_frameset_delete(cat_2mass);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         cpl_frameset_delete(obj_param);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         cpl_frameset_delete(obj_ima);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);</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>     </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_frameset_delete(cat_2mass);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_frameset_delete(obj_param);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_frameset_delete(obj_ima);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_table);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         cpl_propertylist_delete(qclists[idet]);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_free(qclists);</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">/* Return */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         <span class="keywordflow">return</span> -1 ;</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">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> cpl_table ** hawki_step_photom_2mass_get_zpoints</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> (cpl_frameset *     cat_2mass,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>  cpl_frameset *     obj_param,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>  cpl_frameset *     obj_ima)</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>     cpl_table **       zpoint_table;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_table **       obj_det_param;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_propertylist * plist;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">int</span>                idet;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     cpl_errorstate     error_prevstate = cpl_errorstate_get();</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">/* Allocate zpoint_table */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     zpoint_table = cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * HAWKI_NB_DETECTORS);</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">/* Load detected obj */</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     obj_det_param = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(cpl_frameset_get_first(obj_param));</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">/* Read the main header */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     plist = cpl_propertylist_load</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)), 0);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="comment">/* Loop on detectors */</span>    </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>         cpl_propertylist * wcs_info;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         cpl_table        * stars_2mass;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         cpl_array        * matches;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         <span class="keywordtype">int</span>                ext_nb;</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_info(__func__,<span class="stringliteral">"Working on chip %d"</span>, idet + 1);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         cpl_msg_indent_more();</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">/* Retrieve stars */</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>             (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)),idet+1);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         wcs_info = cpl_propertylist_load</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>             (cpl_frame_get_filename(cpl_frameset_get_first(obj_ima)), ext_nb);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         stars_2mass = </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>             hawki_step_photom_2mass_retrieve_stars(cat_2mass, wcs_info);        </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         <span class="keywordflow">if</span>(stars_2mass == 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>             <span class="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot retrieve stars"</span>);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>             cpl_propertylist_delete(wcs_info);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>             <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>             <span class="keywordflow">for</span>(jdet = 0; jdet <idet; ++jdet)</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                 cpl_table_delete(zpoint_table[jdet]);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>             cpl_free(zpoint_table);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>             <span class="keywordflow">return</span> 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>          </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         <span class="comment">/* Pattern matching btw stars in 2MASS and detected ones */</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         cpl_msg_info(__func__,<span class="stringliteral">"Matching %"</span>CPL_SIZE_FORMAT</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                      <span class="stringliteral">" 2MASS stars and %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" detections"</span>,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                      cpl_table_get_nrow(stars_2mass),</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                      cpl_table_get_nrow(obj_det_param[idet]));</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         matches = hawki_step_photom_2mass_ppm(stars_2mass, obj_det_param[idet]);</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">/* Fill the zpoint table */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         cpl_msg_info(__func__,<span class="stringliteral">"Computing zero points"</span>);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         zpoint_table[idet] = hawki_step_photom_2mass_fill_zpoint_table</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>             (stars_2mass, obj_det_param[idet], matches, plist, idet);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         <span class="keywordflow">if</span>(zpoint_table[idet] == 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="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>             cpl_msg_error(__func__, <span class="stringliteral">"Could not compute the zero points"</span>);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>             cpl_propertylist_delete(wcs_info);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>             <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>             cpl_table_delete(stars_2mass);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>             <span class="keywordflow">for</span>(jdet = 0; jdet <idet; ++jdet)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                 cpl_table_delete(zpoint_table[jdet]);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>             cpl_free(zpoint_table);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>             cpl_array_delete(matches);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             <span class="keywordflow">return</span> 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">/* Cleaning resources */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         cpl_propertylist_delete(wcs_info);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         cpl_table_delete(stars_2mass);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         cpl_array_delete(matches);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(obj_det_param);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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="keywordtype">int</span> jdet;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         <span class="keywordflow">for</span>(jdet = 0; jdet <HAWKI_NB_DETECTORS; ++jdet)</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>             cpl_table_delete(zpoint_table[jdet]);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         cpl_free(zpoint_table);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         cpl_msg_error(__func__, <span class="stringliteral">"A problem happened computing the zero point"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keywordflow">return</span> NULL;</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> zpoint_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> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> <span class="keyword">static</span> cpl_table *  hawki_step_photom_2mass_retrieve_stars</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> (cpl_frameset *     cat_2mass,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>  cpl_propertylist * wcs_keywords)</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="keywordtype">char</span> *          catpath;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordtype">char</span> *          catname;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_table *     stars;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     cpl_wcs *       wcs;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordtype">int</span>             nstars;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordtype">int</span>             istar;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordtype">double</span>          ra1;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordtype">double</span>          ra2;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordtype">double</span>          dec1;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordtype">double</span>          dec2;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="keywordtype">double</span>          extra_search = 0.;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     cpl_matrix *    from_coord;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     cpl_matrix *    to_coord;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_array *     status;</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="comment">/* Extract the catalog path */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">if</span> (irplib_2mass_get_catpars(cpl_frameset_get_first(cat_2mass),</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                  &catpath, &catname) != CPL_ERROR_NONE) </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <span class="keywordflow">return</span> 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>     <span class="comment">/* Get the WCS info */</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     wcs = cpl_wcs_new_from_propertylist(wcs_keywords);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span>(cpl_error_get_code() == CPL_ERROR_NO_WCS)</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_msg_error(__func__,<span class="stringliteral">"Not compiled with WCS support."</span>);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         <span class="keywordflow">return</span> 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>     </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="comment">/* Get the limits to search */</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span>(irplib_cat_get_image_limits(wcs, extra_search, </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                                    &ra1, &ra2, &dec1, &dec2) == </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                                        CPL_ERROR_DATA_NOT_FOUND)</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>         cpl_msg_error(__func__,<span class="stringliteral">"No WCS information found"</span>);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         cpl_free(catname);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         cpl_free(catpath);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         <span class="keywordflow">return</span> NULL;</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(__func__,<span class="stringliteral">"Searching stars in RA=[%f,%f] DEC=[%f,%f]"</span>,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                  ra1/15., ra2/15., dec1, dec2);</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">/* Search the stars */</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     stars = irplib_2mass_extract(catpath, ra1, ra2, dec1, dec2);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="keywordflow">if</span>(stars == NULL)</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_error(__func__,<span class="stringliteral">"Error retrieving 2mass stars: %s "</span>,</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         cpl_free(catname);</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         cpl_free(catpath);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         <span class="keywordflow">return</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>     nstars = cpl_table_get_nrow(stars);</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>     cpl_msg_info(__func__, <span class="stringliteral">"%d 2MASS stars found"</span>, nstars);</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="comment">/* Convert Ra, Dec to X,Y using the WCS information from image */</span></div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     from_coord = cpl_matrix_new(nstars, 2);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     <span class="keywordflow">for</span> (istar=0; istar<nstars; istar++)</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_matrix_set(from_coord, istar, 0, cpl_table_get_float</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>                        (stars, HAWKI_COL_2MASS_RA, istar, NULL));</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         cpl_matrix_set(from_coord, istar, 1, cpl_table_get_float</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>                        (stars, HAWKI_COL_2MASS_DEC, istar, 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>     to_coord = NULL;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     status   = NULL;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="keywordflow">if</span>(cpl_wcs_convert(wcs, from_coord, &to_coord, </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                        &status, CPL_WCS_WORLD2PHYS) != CPL_ERROR_NONE)</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>         cpl_array_delete(status);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         cpl_matrix_delete(from_coord);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         cpl_matrix_delete(to_coord);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         cpl_free(catname);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         cpl_free(catpath);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         cpl_msg_error(cpl_func,<span class="stringliteral">"Error in cpl_wcs conversion. %s"</span>,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">return</span> 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>     <span class="comment">/* Add the predicted x,y coordinate columns to the  2MASS table */</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     cpl_table_new_column(stars, HAWKI_COL_2MASS_XPREDICT, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     cpl_table_set_column_unit(stars,HAWKI_COL_2MASS_XPREDICT, <span class="stringliteral">"pixels"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     cpl_table_new_column(stars, HAWKI_COL_2MASS_YPREDICT, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     cpl_table_set_column_unit(stars, HAWKI_COL_2MASS_YPREDICT, <span class="stringliteral">"pixels"</span>);</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="keywordflow">for</span>(istar=0; istar< nstars; istar++)</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="keywordtype">float</span> xpredict = (float)cpl_matrix_get(to_coord, istar, 0);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         <span class="keywordtype">float</span> ypredict = (float)cpl_matrix_get(to_coord, istar, 1);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         cpl_table_set_float(stars,<span class="stringliteral">"xpredict"</span>, istar, xpredict);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         cpl_table_set_float(stars,<span class="stringliteral">"ypredict"</span>, istar, ypredict);</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">/* Free and return */</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     cpl_array_delete(status);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_matrix_delete(from_coord);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     cpl_matrix_delete(to_coord);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     cpl_free(catname);</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     cpl_free(catpath);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keywordflow">return</span> stars;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_array *   hawki_step_photom_2mass_ppm</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> (cpl_table *  stars_2mass,</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>  cpl_table *  obj_det)</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="keywordtype">int</span>                istar;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordtype">int</span>                iobj;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordtype">int</span>                iter;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordtype">int</span>                nstars_2mass;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordtype">int</span>                nstars_2mass_used_match;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordtype">int</span>                nobj;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="keywordtype">int</span>                nobj_used_match;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <span class="keywordtype">int</span>                nmatches;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     <span class="keywordtype">int</span>                nmax_match_pattern = 30;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     cpl_matrix *       pattern;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     cpl_array *        matches;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordtype">double</span>             tol = 0.1;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordtype">double</span>             pradius = 30.0;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordtype">double</span>             mean_data_pos_err = 5.;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <span class="keywordtype">int</span>                ppm_max_iter = 5;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordtype">double</span>             scale = 1;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordtype">double</span>             angle;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     cpl_matrix *       obj_pos;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_propertylist * sort_prop;</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="comment">/* Sort the detected objects */</span></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>     sort_prop = cpl_propertylist_new();</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     cpl_propertylist_append_bool(sort_prop, HAWKI_COL_OBJ_FLUX, 1);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="keywordflow">if</span> (cpl_table_sort(obj_det, sort_prop) != 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>         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot sort detected sources table"</span>);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         cpl_propertylist_delete(sort_prop);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keywordflow">return</span> NULL;</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="comment">/* Create matrix of X,Y coordinates of detected objects*/</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     nobj = cpl_table_get_nrow(obj_det);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     obj_pos = cpl_matrix_new(2, nobj);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordflow">for</span> (iobj=0; iobj<nobj; iobj++)</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="keywordtype">float</span> xim = cpl_table_get_double</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>             (obj_det, HAWKI_COL_OBJ_POSX, iobj, NULL); </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         <span class="keywordtype">float</span> yim = cpl_table_get_double</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>             (obj_det, HAWKI_COL_OBJ_POSY, iobj, NULL);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         cpl_matrix_set(obj_pos, 0, iobj, xim);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>         cpl_matrix_set(obj_pos, 1, iobj, yim);</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="comment">/* Sort the 2MASS stars by magnitude */</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     cpl_propertylist_empty(sort_prop);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_propertylist_append_bool(sort_prop, HAWKI_COL_2MASS_K_MAG, 0);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (cpl_table_sort(stars_2mass, sort_prop) != CPL_ERROR_NONE) </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_error(cpl_func,<span class="stringliteral">"Cannot sort 2MASS stars table"</span>);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         cpl_propertylist_delete(sort_prop);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         <span class="keywordflow">return</span> 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="comment">/* Prepare the 2MASS matrix for the pattern matching */</span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     nstars_2mass = cpl_table_get_nrow(stars_2mass);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     pattern = cpl_matrix_new(2, nstars_2mass);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">for</span>(istar=0; istar<nstars_2mass ; istar++)</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">float</span> x = cpl_table_get_float</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>             (stars_2mass, HAWKI_COL_2MASS_XPREDICT, istar, NULL);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         <span class="keywordtype">float</span> y = cpl_table_get_float</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>             (stars_2mass, HAWKI_COL_2MASS_YPREDICT, istar, NULL);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_matrix_set(pattern, 0, istar, x);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         cpl_matrix_set(pattern, 1, istar, y);</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>     </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="comment">/* Do the ppm */</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     nstars_2mass_used_match = nmax_match_pattern;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordflow">if</span>(nstars_2mass < nmax_match_pattern)</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         nstars_2mass_used_match = nstars_2mass;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     nobj_used_match = (int)(1.7 * nstars_2mass_used_match);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     <span class="keywordflow">if</span>(nobj_used_match > nobj)</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         nobj_used_match = nobj;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span>(nobj_used_match < nstars_2mass_used_match)</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         nobj_used_match = nstars_2mass_used_match;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     cpl_msg_info(__func__,<span class="stringliteral">"The first step match will use %d stars "</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>                  <span class="stringliteral">"and %d objects"</span>, nstars_2mass_used_match,nobj_used_match);</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="keywordflow">for</span> (iter = 0; iter < ppm_max_iter; iter++)</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">int</span> nmatchsize;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         nmatches = 0;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         matches = cpl_ppm_match_points(obj_pos, nobj_used_match, </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                                        mean_data_pos_err,</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                                        pattern, nstars_2mass_used_match,</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                                        1, tol, pradius,</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                                        NULL, NULL, &scale, &angle);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         <span class="keywordflow">if</span>(matches != 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>             nmatchsize = cpl_array_get_size(matches);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>             nmatches = nmatchsize -</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>                 cpl_array_count_invalid(matches);</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>         {</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>             nmatchsize = 0;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>             nmatches = 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>         </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         cpl_msg_info(cpl_func,<span class="stringliteral">"Total matches: %d. Valid matches: %d"</span>,</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                      nmatchsize, nmatches);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         cpl_msg_info(cpl_func,<span class="stringliteral">"Scale=%g angle=%g"</span>, scale, angle);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         <span class="keywordflow">if</span>((matches == NULL) || (nmatches < floor(nobj_used_match*0.1))) </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>             nobj_used_match = nobj_used_match + 10;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>             cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                          <span class="stringliteral">"Increasing number of detections used in PPM to %d"</span>,</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                          nobj_used_match);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>             <span class="keywordflow">continue</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">else</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>             <span class="keywordflow">break</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>     <span class="comment">/* Output debug messages */</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     cpl_msg_debug(__func__,<span class="stringliteral">"Matched stars:"</span>);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     cpl_msg_debug(__func__,<span class="stringliteral">"X_OBJ  Y_OBJ    X_STAR Y_STAR   X_DIFF Y_DIFF:"</span>);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">for</span>(istar=0; istar < nstars_2mass; ++istar)</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>         <span class="keywordtype">int</span>  null;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>         <span class="keywordtype">double</span> x_obj, y_obj, x_star, y_star, x_diff, y_diff;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         iobj  = cpl_array_get_int(matches, istar, &null);</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="keywordflow">if</span>(null != 0)</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         x_obj = cpl_matrix_get(obj_pos, 0, iobj);</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>         y_obj = cpl_matrix_get(obj_pos, 1, iobj);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>         x_star = cpl_matrix_get(pattern, 0, istar);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>         y_star = cpl_matrix_get(pattern, 1, istar);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>         x_diff = x_obj - x_star;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         y_diff = y_obj - y_star;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>         cpl_msg_debug(__func__,<span class="stringliteral">"%6.1f %6.1f  %6.1f %6.1f   %6.1f %6.1f\n"</span>,</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                       x_obj, y_obj, x_star, y_star, x_diff, y_diff);</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_msg_indent_less();    </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_msg_indent_less();</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_matrix_delete(pattern);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%d points matched"</span>, nmatches);</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>(matches == NULL || nmatches == 0)</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>(nmatches == 0)</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>             cpl_array_delete(matches);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>         cpl_msg_error(cpl_func,<span class="stringliteral">"Error in PPM. %s"</span>,cpl_error_get_message());</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>         cpl_matrix_delete(obj_pos);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         cpl_propertylist_delete(sort_prop);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         <span class="keywordflow">return</span> NULL;</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>     <span class="keywordflow">if</span>(nmatches < floor(nobj_used_match*0.1))</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_warning(cpl_func,<span class="stringliteral">"PPM detected matched only %d objects."</span></div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                         <span class="stringliteral">" Results could be unreliable"</span>,nmatches);</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">/* Free and return */</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     cpl_matrix_delete(obj_pos);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     cpl_propertylist_delete(sort_prop);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <span class="keywordflow">return</span> matches;</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> </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</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="keyword">static</span> cpl_table * hawki_step_photom_2mass_fill_zpoint_table</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> (cpl_table *        stars_2mass,</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>  cpl_table *        obj_det_param,</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>  cpl_array *        matches,</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>  cpl_propertylist * plist,</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>  <span class="keywordtype">int</span>                idet)</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>     cpl_table    * zpoints;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordtype">int</span>            nmatches;</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordtype">int</span>            nstars;</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <span class="keywordtype">int</span>            imatch;</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keywordtype">int</span>            istar;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   * filter;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     <span class="keywordtype">char</span>           magcol_2mass[100];</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordtype">char</span>           magerrcol_2mass[100];</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     <span class="keywordtype">double</span>         dit;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordtype">double</span>         airmass;</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     <span class="keywordtype">double</span>         pixscale;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     <span class="keywordtype">double</span>         extinction;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     cpl_errorstate error_prevstate = cpl_errorstate_get();</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="comment">/* Read parameters from the propertylist */</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     airmass  = (<a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) +</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>                 <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist)) / 2.;</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     filter   = <a class="code" href="group__hawki__pfits.html#ga3ad06f5c4dea6ec8adcc437e7f9f5501" title="find out which wave band is active">hawki_pfits_get_filter</a>(plist);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     dit      = <a class="code" href="group__hawki__pfits.html#ga1971ab60e27df384b5fd533461e7356f" title="find out the DIT value">hawki_pfits_get_dit</a>(plist);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     pixscale = <a class="code" href="group__hawki__pfits.html#ga79c432e5ab5585c45472cfa86b2d146b" title="find out the pixel scale">hawki_pfits_get_pixscale</a>(plist);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     <span class="keywordflow">switch</span> (<a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(filter))</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">case</span> HAWKI_BAND_J:    </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>             extinction = 0.098;</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>             strncpy(magcol_2mass, HAWKI_COL_2MASS_J_MAG, 98);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>             strncpy(magerrcol_2mass, HAWKI_COL_2MASS_J_MAGSIG, 98);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>             break ;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         <span class="keywordflow">case</span> HAWKI_BAND_H:</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>             extinction = 0.039;</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>             strncpy(magcol_2mass, HAWKI_COL_2MASS_H_MAG, 98);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>             strncpy(magerrcol_2mass, HAWKI_COL_2MASS_H_MAGSIG, 98);</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>             break ;</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>         <span class="keywordflow">case</span> HAWKI_BAND_K:</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>             extinction = 0.065;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>             strncpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG, 98);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>             strncpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG, 98);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>             break ;</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         <span class="keywordflow">default</span>: </div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>             extinction = 0.00;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             cpl_msg_warning(__func__,<span class="stringliteral">"The filter %s does not exist in 2MASS. "</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                             <span class="stringliteral">"The 2MASS K band will be used instead. "</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>                             <span class="stringliteral">"Columns %s, %s, %s and %s in product will not "</span></div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                             <span class="stringliteral">"be accurate"</span>, filter, </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                             HAWKI_COL_ZPOINT_MAG, HAWKI_COL_ZPOINT_ERRMAG,</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>                             HAWKI_COL_ZPOINT_ZPOINT, HAWKI_COL_ZPOINT_ATX0);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>             strncpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG, 98);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>             strncpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG, 98);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>             break ;</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>     <span class="comment">/* Select only stars in 2MASS that have the given magnitude */</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="comment">//irplib_stdstar_select_stars_mag(stars_2mass, magcol_2mass);</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="comment">//cpl_msg_warning(__func__,"Paso irplib");</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">/* Create the table */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     nstars = cpl_table_get_nrow(stars_2mass);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     nmatches = cpl_array_get_size(matches) - cpl_array_count_invalid(matches);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     zpoints = cpl_table_new(nmatches) ;</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_CHIP, CPL_TYPE_INT) ;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_POSX, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_POSY, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ZPOINT, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ATX0, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_MAG, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_ERRMAG, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_AIRMASS, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FLUX, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FILTER, CPL_TYPE_STRING) ;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> <span class="comment">//    cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_PEAK, CPL_TYPE_DOUBLE) ;</span></div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> <span class="comment">//    cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_BGD, CPL_TYPE_DOUBLE) ;</span></div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMX, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMY, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHM, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMX_AS, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHMY_AS, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     cpl_table_new_column(zpoints, HAWKI_COL_ZPOINT_FWHM_AS, CPL_TYPE_DOUBLE) ;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     imatch = 0;</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">for</span> (istar=0; istar<nstars; istar++) </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="keywordtype">int</span>      iobj;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>         <span class="keywordtype">int</span>      null;</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>         <span class="keywordtype">double</span>   zpoint;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         <span class="keywordtype">double</span>   atx0;</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>         <span class="keywordtype">double</span>   flux;</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>         <span class="keywordtype">double</span>   mag;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         <span class="keywordtype">double</span>   errmag;</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         <span class="keywordtype">double</span>   fwhm_x;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         <span class="keywordtype">double</span>   fwhm_y;</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>         <span class="keywordtype">double</span>   fwhm;</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>         iobj  = cpl_array_get_int(matches, istar, &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="keywordflow">if</span>(null != 0)</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         <span class="keywordflow">if</span>(!cpl_table_is_selected(stars_2mass, istar))</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>             <span class="keywordflow">continue</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>         flux = cpl_table_get_double</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>             (obj_det_param, HAWKI_COL_OBJ_FLUX, iobj, NULL);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         mag = cpl_table_get_float</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             (stars_2mass, magcol_2mass, istar, NULL); </div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>         errmag = cpl_table_get_float</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>             (stars_2mass, magerrcol_2mass, istar, NULL);</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         zpoint = mag + 2.5 * log10(flux) - 2.5 * log10(dit);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         atx0 = zpoint + airmass * extinction;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>         fwhm_x = cpl_table_get_double</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             (obj_det_param, HAWKI_COL_OBJ_FWHM_MAJAX, iobj, NULL);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>         fwhm_y = cpl_table_get_double</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             (obj_det_param, HAWKI_COL_OBJ_FWHM_MINAX, iobj, NULL);</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>         fwhm   = sqrt(fwhm_x*fwhm_y); </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>         cpl_table_set_int(zpoints, HAWKI_COL_ZPOINT_CHIP, imatch, idet + 1) ;</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>             (zpoints, HAWKI_COL_ZPOINT_MAG, imatch, mag);</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             (zpoints, HAWKI_COL_ZPOINT_ERRMAG, imatch, errmag);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>         cpl_table_set_string</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>             (zpoints, HAWKI_COL_ZPOINT_FILTER, imatch, filter);</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             (zpoints, HAWKI_COL_ZPOINT_AIRMASS, imatch, airmass);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             (zpoints, HAWKI_COL_ZPOINT_POSX, imatch, cpl_table_get_double</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>              (obj_det_param, HAWKI_COL_OBJ_POSX, iobj, NULL));</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>             (zpoints, HAWKI_COL_ZPOINT_POSY, imatch, cpl_table_get_double</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>              (obj_det_param, HAWKI_COL_OBJ_POSY, iobj, NULL));</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>         cpl_table_set_double(zpoints, HAWKI_COL_ZPOINT_ZPOINT, imatch, zpoint);</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>         cpl_table_set_double(zpoints, HAWKI_COL_ZPOINT_ATX0, imatch, atx0);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>             (zpoints, HAWKI_COL_ZPOINT_FLUX, imatch, flux);</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span> <span class="comment">//        cpl_table_set_double(tab, HAWKI_COL_ZPOINT_PEAK, imatch, </span></div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> <span class="comment">//                hawki_img_zpoint_outputs.peak[labels[iframe]-1]) ;</span></div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span> <span class="comment">//        cpl_table_set_double(tab, HAWKI_COL_ZPOINT_BGD, imatch, </span></div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> <span class="comment">//                hawki_img_zpoint_outputs.bgd[labels[iframe]-1]) ;</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             (zpoints, HAWKI_COL_ZPOINT_FWHMX, imatch, fwhm_x);</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>             (zpoints, HAWKI_COL_ZPOINT_FWHMY, imatch, fwhm_y);</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>             (zpoints, HAWKI_COL_ZPOINT_FWHM, imatch, fwhm);</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>             (zpoints, HAWKI_COL_ZPOINT_FWHMX_AS, imatch, fwhm_x * pixscale);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             (zpoints, HAWKI_COL_ZPOINT_FWHMY_AS, imatch, fwhm_y * pixscale);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>         cpl_table_set_double</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             (zpoints, HAWKI_COL_ZPOINT_FWHM_AS, imatch, fwhm * pixscale);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         ++imatch;</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>     <span class="comment">/* Check error and return */</span></div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_msg_error(__func__,<span class="stringliteral">"An error happened filling the zpoint table: %s"</span>,</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>         cpl_table_delete(zpoints);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         <span class="keywordflow">return</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>     <span class="keywordflow">return</span> zpoints;</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> <span class="keyword">static</span> cpl_propertylist ** hawki_step_photom_2mass_qc</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> (cpl_table ** zpoint_table)</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="keywordtype">int</span> idet;</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     cpl_propertylist ** qclists;</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="comment">/* Allocate the qclists */</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</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">/* Loop on the detectors to get the mean zpoint */</span></div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS ; ++idet)</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="keywordtype">double</span> mean_zpoint;</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="comment">/* Allocate this qclist */</span></div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         qclists[idet] = cpl_propertylist_new() ;</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="comment">/* Compute the mean zpoint */</span></div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>         mean_zpoint = cpl_table_get_column_mean(zpoint_table[idet],</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>                                                 HAWKI_COL_ZPOINT_ZPOINT);</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_propertylist_append_double</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>             (qclists[idet], <span class="stringliteral">"ESO QC ZPOINT"</span>, mean_zpoint);</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>     <span class="keywordflow">return</span> qclists;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_photom_2mass_save</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> (cpl_table **         zpoints,</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>  cpl_parameterlist *  parlist,</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>  cpl_propertylist **  qclists,</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>  cpl_frameset *       <span class="keyword">set</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>     cpl_propertylist *   protype;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     cpl_frame *          ref_frame ;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>     cpl_frameset *       combinedframes;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     <span class="keywordtype">int</span>                  nframes ;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *         recipe_name = <span class="stringliteral">"hawki_step_photom_2mass"</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</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>     <span class="comment">/* Get the reference frame */</span></div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>     combinedframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(<span class="keyword">set</span>, HAWKI_CALPRO_COMBINED);</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     ref_frame = cpl_frameset_get_first(combinedframes);</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="comment">/* Create the protype lists */</span></div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>     protype = cpl_propertylist_new();</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     cpl_propertylist_append_string(protype, <span class="stringliteral">"ESO PRO TYPE"</span>,</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             HAWKI_PROTYPE_ZPOINT_TAB);</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="comment">/* Write the zpoint table  */</span></div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>                       parlist,</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>                       <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>                       (<span class="keyword">const</span> cpl_table **)zpoints,</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>                       recipe_name,</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>                       HAWKI_CALPRO_ZPOINT_TAB,</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>                       HAWKI_PROTYPE_ZPOINT_TAB,</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>                       protype,</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>                       (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>                       <span class="stringliteral">"hawki_step_photom_2mass.fits"</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>     <span class="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     cpl_propertylist_delete(protype);</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>     cpl_frameset_delete(combinedframes);</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>     <span class="keywordflow">return</span>  0;</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</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/hawki__step__refine__offsets_8c_source.html b/html/hawki__step__refine__offsets_8c_source.html
index 80c148f..0c50ace 100644
--- a/html/hawki__step__refine__offsets_8c_source.html
+++ b/html/hawki__step__refine__offsets_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_refine_offsets.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,778 +40,779 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_refine_offsets.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_refine_offsets.c,v 1.17 2011/10/24 10:42: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 10:42:12 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.17 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.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="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_calib.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_saa.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_bkg.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00052"></a>00052 <span class="preprocessor">#include "hawki_properties_tel.h"</span>
-<a name="l00053"></a>00053 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00056"></a>00056 <span class="comment">                                Define</span>
-<a name="l00057"></a>00057 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span>
-<a name="l00062"></a>00062 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00063"></a>00063 <span class="comment">                            Functions prototypes</span>
-<a name="l00064"></a>00064 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_create(cpl_plugin *) ;
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_exec(cpl_plugin *) ;
-<a name="l00068"></a>00068 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_destroy(cpl_plugin *) ;
-<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_retrieve_input_param
-<a name="l00072"></a>00072 (cpl_parameterlist  *  parlist);
-<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_fine
-<a name="l00074"></a>00074 (<span class="keyword">const</span> cpl_frameset  *  science_objects_frames,
-<a name="l00075"></a>00075  <span class="keyword">const</span> cpl_frameset  *  reference_objects_frames,
-<a name="l00076"></a>00076  cpl_bivector        ** refined_offsets,
-<a name="l00077"></a>00077  cpl_vector          ** correl);
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_save
-<a name="l00080"></a>00080 (cpl_bivector      ** refined_offsets,
-<a name="l00081"></a>00081  cpl_vector        ** correlations,
-<a name="l00082"></a>00082  cpl_parameterlist *  recipe_parlist,
-<a name="l00083"></a>00083  cpl_frameset      *  recipe_frameset);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="keyword">static</span> cpl_bivector ** hawki_step_refine_offsets_read_select_objects
-<a name="l00086"></a>00086 (<span class="keyword">const</span> cpl_frameset *  reference_obj_frames,
-<a name="l00087"></a>00087  <span class="keywordtype">double</span>                first_image_off_x,
-<a name="l00088"></a>00088  <span class="keywordtype">double</span>                first_image_off_y,
-<a name="l00089"></a>00089  <span class="keywordtype">int</span>                   nx,
-<a name="l00090"></a>00090  <span class="keywordtype">int</span>                   ny);
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00093"></a>00093 <span class="comment">                            Static variables</span>
-<a name="l00094"></a>00094 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096 <span class="keyword">static</span> <span class="keyword">struct </span>
-<a name="l00097"></a>00097 {
-<a name="l00098"></a>00098     <span class="comment">/* Inputs */</span>
-<a name="l00099"></a>00099     <span class="keywordtype">int</span>                 nbrightest;
-<a name="l00100"></a>00100     <span class="keywordtype">int</span>                 sx ;
-<a name="l00101"></a>00101     <span class="keywordtype">int</span>                 sy ;
-<a name="l00102"></a>00102     <span class="keywordtype">int</span>                 mx ;
-<a name="l00103"></a>00103     <span class="keywordtype">int</span>                 my ;
-<a name="l00104"></a>00104 } hawki_step_refine_offsets_config;
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_refine_offsets_description[] =
-<a name="l00107"></a>00107 <span class="stringliteral">"hawki_step_refine_offsets -- utility to refine the nominal offsets.\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"This utility will take the offsets in the header as a first approach\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"and tries to refine them correlating the input images at the points\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"given by the detected objects.\n"</span>
-<a name="l00111"></a>00111 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00112"></a>00112 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00113"></a>00113 <span class="stringliteral">"images.fits "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">" or\n"</span>
-<a name="l00114"></a>00114 <span class="stringliteral">"images.fits "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">" and\n"</span>
-<a name="l00115"></a>00115 <span class="stringliteral">"det_obj_stats.fits "</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"\n"</span>
-<a name="l00116"></a>00116 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"hawki_step_refine_offsets.fits ("</span>HAWKI_CALPRO_OFFSETS<span class="stringliteral">"): Table with refined offsets\n"</span>
-<a name="l00118"></a>00118 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00119"></a>00119 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00120"></a>00120 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00124"></a>00124 <span class="comment">                                Functions code</span>
-<a name="l00125"></a>00125 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00144"></a>00144                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00145"></a>00145                     <span class="stringliteral">"hawki_step_refine_offsets"</span>,
-<a name="l00146"></a>00146                     <span class="stringliteral">"Jitter recipe"</span>,
-<a name="l00147"></a>00147                     hawki_step_refine_offsets_description,
-<a name="l00148"></a>00148                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00149"></a>00149                     PACKAGE_BUGREPORT,  
-<a name="l00150"></a>00150                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00151"></a>00151                     hawki_step_refine_offsets_create,
-<a name="l00152"></a>00152                     hawki_step_refine_offsets_exec,
-<a name="l00153"></a>00153                     hawki_step_refine_offsets_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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00169"></a>00169 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00170"></a>00170 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_create(cpl_plugin * plugin)
-<a name="l00171"></a>00171 {
-<a name="l00172"></a>00172     cpl_recipe      * recipe ;
-<a name="l00173"></a>00173     cpl_parameter   * p ;
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00181"></a>00181     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00182"></a>00182     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00183"></a>00183         <span class="keywordflow">return</span> 1;
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00186"></a>00186     <span class="comment">/* --xcorr */</span>
-<a name="l00187"></a>00187     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_refine_offsets.xcorr"</span>,
-<a name="l00188"></a>00188                                 CPL_TYPE_STRING,
-<a name="l00189"></a>00189                                 <span class="stringliteral">"Cross correlation search and measure sizes"</span>,
-<a name="l00190"></a>00190                                 <span class="stringliteral">"hawki.hawki_step_refine_offsets"</span>,
-<a name="l00191"></a>00191                                 <span class="stringliteral">"20,20,25,25"</span>) ;
-<a name="l00192"></a>00192     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcorr"</span>) ;
-<a name="l00193"></a>00193     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00194"></a>00194     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196     <span class="comment">/* --nbrightest */</span>
-<a name="l00197"></a>00197     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_refine_offsets.nbrightest"</span>,
-<a name="l00198"></a>00198                                 CPL_TYPE_INT,
-<a name="l00199"></a>00199                                 <span class="stringliteral">"Number of brightest objects to use"</span>,
-<a name="l00200"></a>00200                                 <span class="stringliteral">"hawki.hawki_step_refine_offsets"</span>,
-<a name="l00201"></a>00201                                 3);
-<a name="l00202"></a>00202     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"nbrightest"</span>) ;
-<a name="l00203"></a>00203     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;
-<a name="l00204"></a>00204     cpl_parameterlist_append(recipe->parameters, p) ;
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00216"></a>00216 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00217"></a>00217 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_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="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00222"></a>00222     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00223"></a>00223         recipe = (cpl_recipe *)plugin ;
-<a name="l00224"></a>00224     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/* Issue a banner */</span>
-<a name="l00227"></a>00227     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="keywordflow">return</span> hawki_step_refine_offsets(recipe->parameters, recipe->frames) ;
-<a name="l00230"></a>00230 }
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00238"></a>00238 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00239"></a>00239 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_destroy(cpl_plugin * plugin)
-<a name="l00240"></a>00240 {
-<a name="l00241"></a>00241     cpl_recipe  *   recipe ;
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00244"></a>00244     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00245"></a>00245         recipe = (cpl_recipe *)plugin ;
-<a name="l00246"></a>00246     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     cpl_parameterlist_delete(recipe->parameters) ;
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00259"></a>00259 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00260"></a>00260 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets(
-<a name="l00261"></a>00261         cpl_parameterlist   *   parlist, 
-<a name="l00262"></a>00262         cpl_frameset        *   framelist)
-<a name="l00263"></a>00263 {
-<a name="l00264"></a>00264     cpl_frameset    *   science_obj_frames ;
-<a name="l00265"></a>00265     cpl_frameset    *   reference_obj_frames ;
-<a name="l00266"></a>00266     cpl_bivector    **  refined_offsets;
-<a name="l00267"></a>00267     cpl_vector      **  correl;
-<a name="l00268"></a>00268     <span class="keywordtype">int</span>                 idet;
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00271"></a>00271     <span class="keywordflow">if</span>(hawki_step_refine_offsets_retrieve_input_param(parlist))
-<a name="l00272"></a>00272     {
-<a name="l00273"></a>00273         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);
-<a name="l00274"></a>00274         <span class="keywordflow">return</span> -1;
-<a name="l00275"></a>00275     }
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00278"></a>00278     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00279"></a>00279         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00280"></a>00280         <span class="keywordflow">return</span> -1 ;
-<a name="l00281"></a>00281     }
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     <span class="comment">/* Get the object images frames */</span>
-<a name="l00284"></a>00284     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);
-<a name="l00285"></a>00285     science_obj_frames = 
-<a name="l00286"></a>00286         <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_DIST_CORRECTED);
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (science_obj_frames == NULL)
-<a name="l00288"></a>00288     {
-<a name="l00289"></a>00289         science_obj_frames =
-<a name="l00290"></a>00290                 <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKG_SUBTRACTED);
-<a name="l00291"></a>00291         <span class="keywordflow">if</span> (science_obj_frames == NULL)
-<a name="l00292"></a>00292         {
-<a name="l00293"></a>00293             cpl_msg_error(__func__, <span class="stringliteral">"No science object frames provided (%s)"</span>,
-<a name="l00294"></a>00294                     HAWKI_CALPRO_DIST_CORRECTED);
-<a name="l00295"></a>00295             <span class="keywordflow">return</span> -1 ;
-<a name="l00296"></a>00296         }
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298     
-<a name="l00299"></a>00299     <span class="comment">/* Get the detected "objects" frame */</span>
-<a name="l00300"></a>00300     reference_obj_frames = 
-<a name="l00301"></a>00301         <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_OBJ_PARAM);
-<a name="l00302"></a>00302     <span class="keywordflow">if</span>(cpl_frameset_get_size(reference_obj_frames) != 1)
-<a name="l00303"></a>00303     {
-<a name="l00304"></a>00304         cpl_msg_error(__func__, <span class="stringliteral">"One object parameters frame must be provided (%s)"</span>,
-<a name="l00305"></a>00305                 HAWKI_CALPRO_OBJ_PARAM);
-<a name="l00306"></a>00306         cpl_frameset_delete(science_obj_frames) ;
-<a name="l00307"></a>00307         <span class="keywordflow">if</span>(reference_obj_frames != NULL)
-<a name="l00308"></a>00308             cpl_frameset_delete(reference_obj_frames);
-<a name="l00309"></a>00309         <span class="keywordflow">return</span> -1 ;
-<a name="l00310"></a>00310     }
-<a name="l00311"></a>00311     
-<a name="l00312"></a>00312     <span class="comment">/* Get the offsets refinement */</span>
-<a name="l00313"></a>00313     refined_offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));
-<a name="l00314"></a>00314     correl          = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_vector *));
-<a name="l00315"></a>00315     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00316"></a>00316     {
-<a name="l00317"></a>00317         refined_offsets[idet] = cpl_bivector_new
-<a name="l00318"></a>00318             (cpl_frameset_get_size(science_obj_frames));
-<a name="l00319"></a>00319         correl[idet] = cpl_vector_new
-<a name="l00320"></a>00320             (cpl_frameset_get_size(science_obj_frames));
-<a name="l00321"></a>00321     }
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (hawki_step_refine_offsets_fine
-<a name="l00323"></a>00323             (science_obj_frames, reference_obj_frames, 
-<a name="l00324"></a>00324              refined_offsets, correl) == -1) 
-<a name="l00325"></a>00325    {
-<a name="l00326"></a>00326         cpl_msg_error(__func__, <span class="stringliteral">"Cannot refine the objects"</span>) ;
-<a name="l00327"></a>00327         cpl_frameset_delete(reference_obj_frames) ;
-<a name="l00328"></a>00328         cpl_frameset_delete(science_obj_frames) ;
-<a name="l00329"></a>00329         <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00330"></a>00330         {
-<a name="l00331"></a>00331             cpl_bivector_delete(refined_offsets[idet]);
-<a name="l00332"></a>00332             cpl_vector_delete(correl[idet]);
-<a name="l00333"></a>00333         }
-<a name="l00334"></a>00334         cpl_free(refined_offsets);
-<a name="l00335"></a>00335         cpl_free(correl);
-<a name="l00336"></a>00336         <span class="keywordflow">return</span> -1 ;
-<a name="l00337"></a>00337     }
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     <span class="comment">/* Save the products */</span>
-<a name="l00340"></a>00340     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> (hawki_step_refine_offsets_save
-<a name="l00342"></a>00342             (refined_offsets, correl, parlist, framelist) == -1)
-<a name="l00343"></a>00343     {
-<a name="l00344"></a>00344         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00345"></a>00345                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00346"></a>00346         cpl_frameset_delete(science_obj_frames);
-<a name="l00347"></a>00347         cpl_frameset_delete(reference_obj_frames);
-<a name="l00348"></a>00348         <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00349"></a>00349         {
-<a name="l00350"></a>00350             cpl_bivector_delete(refined_offsets[idet]);
-<a name="l00351"></a>00351             cpl_vector_delete(correl[idet]);
-<a name="l00352"></a>00352         }
-<a name="l00353"></a>00353         cpl_free(refined_offsets);
-<a name="l00354"></a>00354         cpl_free(correl);
-<a name="l00355"></a>00355         <span class="keywordflow">return</span> -1 ;
-<a name="l00356"></a>00356     }
-<a name="l00357"></a>00357     
-<a name="l00358"></a>00358     <span class="comment">/* Free and return */</span>
-<a name="l00359"></a>00359     cpl_frameset_delete(science_obj_frames);
-<a name="l00360"></a>00360     cpl_frameset_delete(reference_obj_frames);
-<a name="l00361"></a>00361     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00362"></a>00362     {
-<a name="l00363"></a>00363         cpl_bivector_delete(refined_offsets[idet]);
-<a name="l00364"></a>00364         cpl_vector_delete(correl[idet]);
-<a name="l00365"></a>00365     }
-<a name="l00366"></a>00366     cpl_free(refined_offsets);
-<a name="l00367"></a>00367     cpl_free(correl);
-<a name="l00368"></a>00368     
-<a name="l00369"></a>00369     <span class="comment">/* Return */</span>
-<a name="l00370"></a>00370     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00371"></a>00371     {
-<a name="l00372"></a>00372         cpl_msg_error(__func__,
-<a name="l00373"></a>00373                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00374"></a>00374         <span class="keywordflow">return</span> -1 ;
-<a name="l00375"></a>00375     }
-<a name="l00376"></a>00376     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00377"></a>00377 }
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379 <span class="keywordtype">int</span> hawki_step_refine_offsets_retrieve_input_param
-<a name="l00380"></a>00380 (cpl_parameterlist  *  parlist)
-<a name="l00381"></a>00381 {
-<a name="l00382"></a>00382     cpl_parameter   *   par ;
-<a name="l00383"></a>00383     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;
-<a name="l00384"></a>00384     par = NULL ;
-<a name="l00385"></a>00385     par = cpl_parameterlist_find
-<a name="l00386"></a>00386         (parlist, <span class="stringliteral">"hawki.hawki_step_refine_offsets.nbrightest"</span>);
-<a name="l00387"></a>00387     hawki_step_refine_offsets_config.nbrightest =
-<a name="l00388"></a>00388         cpl_parameter_get_int(par);
-<a name="l00389"></a>00389     par = cpl_parameterlist_find
-<a name="l00390"></a>00390         (parlist, <span class="stringliteral">"hawki.hawki_step_refine_offsets.xcorr"</span>);
-<a name="l00391"></a>00391     sval = cpl_parameter_get_string(par);
-<a name="l00392"></a>00392     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,
-<a name="l00393"></a>00393                &hawki_step_refine_offsets_config.sx,
-<a name="l00394"></a>00394                &hawki_step_refine_offsets_config.sy,
-<a name="l00395"></a>00395                &hawki_step_refine_offsets_config.mx,
-<a name="l00396"></a>00396                &hawki_step_refine_offsets_config.my)!=4)
-<a name="l00397"></a>00397     {
-<a name="l00398"></a>00398         <span class="keywordflow">return</span> -1;
-<a name="l00399"></a>00399     }
-<a name="l00400"></a>00400     <span class="keywordflow">return</span> 0;
-<a name="l00401"></a>00401 }
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00410"></a>00410 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00411"></a>00411 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_fine
-<a name="l00412"></a>00412 (<span class="keyword">const</span> cpl_frameset  *  science_obj_frames,
-<a name="l00413"></a>00413  <span class="keyword">const</span> cpl_frameset  *  reference_obj_frames,
-<a name="l00414"></a>00414  cpl_bivector        ** refined_offsets,
-<a name="l00415"></a>00415  cpl_vector          ** correl)
-<a name="l00416"></a>00416 {
-<a name="l00417"></a>00417     cpl_imagelist    *   in ;
-<a name="l00418"></a>00418     cpl_bivector     *   nominal_offsets ;
-<a name="l00419"></a>00419     cpl_bivector     **  reference_objects;
-<a name="l00420"></a>00420     <span class="keywordtype">double</span>           *   offs_est_x ;
-<a name="l00421"></a>00421     <span class="keywordtype">double</span>           *   offs_est_y ;
-<a name="l00422"></a>00422     <span class="keywordtype">double</span>               off_0_x;
-<a name="l00423"></a>00423     <span class="keywordtype">double</span>               off_0_y;
-<a name="l00424"></a>00424     <span class="keywordtype">double</span>               max_x, max_y ;
-<a name="l00425"></a>00425     <span class="keywordtype">int</span>                  idet;
-<a name="l00426"></a>00426     <span class="keywordtype">int</span>                  ioff;
-<a name="l00427"></a>00427     cpl_propertylist *   header;
-<a name="l00428"></a>00428     <span class="keywordtype">int</span>                  nx;
-<a name="l00429"></a>00429     <span class="keywordtype">int</span>                  ny;
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     <span class="comment">/* Get the nominal offsets from the header */</span>
-<a name="l00432"></a>00432     cpl_msg_info(__func__,<span class="stringliteral">"Getting the nominal offsets"</span>);
-<a name="l00433"></a>00433     nominal_offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(science_obj_frames); 
-<a name="l00434"></a>00434     <span class="keywordflow">if</span> (nominal_offsets  == NULL) 
-<a name="l00435"></a>00435     {
-<a name="l00436"></a>00436         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>) ;
-<a name="l00437"></a>00437         <span class="keywordflow">return</span> -1;
-<a name="l00438"></a>00438     }
-<a name="l00439"></a>00439     offs_est_x = cpl_bivector_get_x_data(nominal_offsets);
-<a name="l00440"></a>00440     offs_est_y = cpl_bivector_get_y_data(nominal_offsets);
-<a name="l00441"></a>00441     
-<a name="l00442"></a>00442     <span class="comment">/* Print the header offsets */</span>
-<a name="l00443"></a>00443     cpl_msg_indent_more();
-<a name="l00444"></a>00444     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) 
-<a name="l00445"></a>00445     {
-<a name="l00446"></a>00446         cpl_msg_info(__func__, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,
-<a name="l00447"></a>00447                 offs_est_x[ioff], offs_est_y[ioff]) ;
-<a name="l00448"></a>00448     }
-<a name="l00449"></a>00449     cpl_msg_indent_less();
-<a name="l00450"></a>00450     
-<a name="l00451"></a>00451     <span class="comment">/* Get the size of the detectors of the first extension */</span>
-<a name="l00452"></a>00452     header = cpl_propertylist_load
-<a name="l00453"></a>00453         (cpl_frame_get_filename
-<a name="l00454"></a>00454                 (cpl_frameset_get_first_const(science_obj_frames)), 1);
-<a name="l00455"></a>00455     nx = <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(header);
-<a name="l00456"></a>00456     ny = <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(header);
-<a name="l00457"></a>00457     cpl_propertylist_delete(header);
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="comment">/* Get the first offset to all offsets */</span>
-<a name="l00460"></a>00460     off_0_x = offs_est_x[0];
-<a name="l00461"></a>00461     off_0_y = offs_est_y[0];
-<a name="l00462"></a>00462 
-<a name="l00463"></a>00463     <span class="comment">/* Get the objects (anchor points)*/</span>
-<a name="l00464"></a>00464     <span class="comment">/* They are already in the "first image" reference system */</span>
-<a name="l00465"></a>00465     reference_objects = 
-<a name="l00466"></a>00466         hawki_step_refine_offsets_read_select_objects(reference_obj_frames,
-<a name="l00467"></a>00467                                                       off_0_x,
-<a name="l00468"></a>00468                                                       off_0_y,
-<a name="l00469"></a>00469                                                       nx,
-<a name="l00470"></a>00470                                                       ny);
-<a name="l00471"></a>00471     <span class="keywordflow">if</span>(reference_objects == NULL)
-<a name="l00472"></a>00472     {
-<a name="l00473"></a>00473         cpl_msg_error(__func__,<span class="stringliteral">"Error reading the reference objects"</span>);
-<a name="l00474"></a>00474         cpl_bivector_delete(nominal_offsets);
-<a name="l00475"></a>00475         <span class="keywordflow">return</span> -1;
-<a name="l00476"></a>00476     }
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478     <span class="comment">/* Subtract the first offset to all offsets */</span>
-<a name="l00479"></a>00479     max_x = max_y = 0.0 ;
-<a name="l00480"></a>00480     <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) 
-<a name="l00481"></a>00481     {
-<a name="l00482"></a>00482         offs_est_x[ioff] -= off_0_x;
-<a name="l00483"></a>00483         offs_est_y[ioff] -= off_0_y;
-<a name="l00484"></a>00484         <span class="keywordflow">if</span> (fabs(offs_est_x[ioff]) > max_x) max_x = fabs(offs_est_x[ioff]) ;
-<a name="l00485"></a>00485         <span class="keywordflow">if</span> (fabs(offs_est_y[ioff]) > max_y) max_y = fabs(offs_est_y[ioff]) ;
-<a name="l00486"></a>00486     }
-<a name="l00487"></a>00487     offs_est_x[0] = offs_est_y[0] = 0.00 ;
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     <span class="comment">/* Get the opposite offsets. This is to change from </span>
-<a name="l00490"></a>00490 <span class="comment">     * telescope convention to cpl convention */</span> 
-<a name="l00491"></a>00491     cpl_vector_multiply_scalar(cpl_bivector_get_x(nominal_offsets), -1.0);
-<a name="l00492"></a>00492     cpl_vector_multiply_scalar(cpl_bivector_get_y(nominal_offsets), -1.0);
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     <span class="comment">/* Loop on the detectors */</span>
-<a name="l00495"></a>00495     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00496"></a>00496     {
-<a name="l00497"></a>00497         cpl_msg_info(__func__, <span class="stringliteral">"Working on detector number %d"</span>, idet+1) ;
-<a name="l00498"></a>00498         cpl_msg_indent_more();
-<a name="l00499"></a>00499         
-<a name="l00500"></a>00500         <span class="comment">/* Load the input data */</span>
-<a name="l00501"></a>00501         cpl_msg_info(__func__, <span class="stringliteral">"Loading the input data"</span>) ;
-<a name="l00502"></a>00502         cpl_msg_indent_more() ;
-<a name="l00503"></a>00503         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(science_obj_frames,
-<a name="l00504"></a>00504                                   idet+1, CPL_TYPE_FLOAT)) == NULL) 
-<a name="l00505"></a>00505         {
-<a name="l00506"></a>00506             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;
-<a name="l00507"></a>00507             cpl_bivector_delete(nominal_offsets) ;
-<a name="l00508"></a>00508             <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00509"></a>00509             {
-<a name="l00510"></a>00510                 cpl_bivector_delete(reference_objects[idet]);
-<a name="l00511"></a>00511             }
-<a name="l00512"></a>00512             cpl_free(reference_objects);
-<a name="l00513"></a>00513             cpl_msg_indent_less() ;
-<a name="l00514"></a>00514             cpl_msg_indent_less() ;
-<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="comment">/* Get the refinement */</span>
-<a name="l00519"></a>00519         cpl_msg_info(__func__, <span class="stringliteral">"Getting the refinement"</span>);
-<a name="l00520"></a>00520         cpl_msg_indent_more() ;
-<a name="l00521"></a>00521         <span class="keywordflow">if</span> (hawki_geom_refine_images_offsets
-<a name="l00522"></a>00522                 (in, 
-<a name="l00523"></a>00523                  nominal_offsets,
-<a name="l00524"></a>00524                  reference_objects[idet],
-<a name="l00525"></a>00525                  hawki_step_refine_offsets_config.sx,
-<a name="l00526"></a>00526                  hawki_step_refine_offsets_config.sy,
-<a name="l00527"></a>00527                  hawki_step_refine_offsets_config.mx,
-<a name="l00528"></a>00528                  hawki_step_refine_offsets_config.my,
-<a name="l00529"></a>00529                  refined_offsets[idet],
-<a name="l00530"></a>00530                  correl[idet]) == -1)
-<a name="l00531"></a>00531         {
-<a name="l00532"></a>00532             cpl_msg_error(__func__, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;
-<a name="l00533"></a>00533             cpl_imagelist_delete(in) ;
-<a name="l00534"></a>00534             cpl_bivector_delete(nominal_offsets) ;
-<a name="l00535"></a>00535             <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00536"></a>00536                 cpl_bivector_delete(reference_objects[idet]);
-<a name="l00537"></a>00537             cpl_free(reference_objects);
-<a name="l00538"></a>00538             cpl_msg_indent_less() ;
-<a name="l00539"></a>00539             cpl_msg_indent_less() ;
-<a name="l00540"></a>00540             <span class="keywordflow">return</span> -1;
-<a name="l00541"></a>00541         }
-<a name="l00542"></a>00542         
-<a name="l00543"></a>00543         <span class="comment">/* Convert to "telescope criteria" */</span>
-<a name="l00544"></a>00544         <span class="comment">/* Also add the offset of the first image */</span>
-<a name="l00545"></a>00545         cpl_vector_multiply_scalar
-<a name="l00546"></a>00546             (cpl_bivector_get_x(refined_offsets[idet]), -1.0);
-<a name="l00547"></a>00547         cpl_vector_multiply_scalar
-<a name="l00548"></a>00548             (cpl_bivector_get_y(refined_offsets[idet]), -1.0);
-<a name="l00549"></a>00549         cpl_vector_add_scalar
-<a name="l00550"></a>00550             (cpl_bivector_get_x(refined_offsets[idet]), off_0_x);
-<a name="l00551"></a>00551         cpl_vector_add_scalar
-<a name="l00552"></a>00552             (cpl_bivector_get_y(refined_offsets[idet]), off_0_y);
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554         <span class="comment">/* Print the new offsets */</span>
-<a name="l00555"></a>00555         <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(refined_offsets[idet]); ioff++) 
-<a name="l00556"></a>00556         {
-<a name="l00557"></a>00557             cpl_msg_info(__func__,<span class="stringliteral">"Refined telescope offsets (Frame %d): %g %g"</span>,
-<a name="l00558"></a>00558                          ioff+1,
-<a name="l00559"></a>00559                          cpl_vector_get(cpl_bivector_get_x
-<a name="l00560"></a>00560                                         (refined_offsets[idet]), ioff),
-<a name="l00561"></a>00561                          cpl_vector_get(cpl_bivector_get_y
-<a name="l00562"></a>00562                                         (refined_offsets[idet]), ioff));
-<a name="l00563"></a>00563         }
-<a name="l00564"></a>00564         cpl_imagelist_delete(in) ;
-<a name="l00565"></a>00565         cpl_msg_indent_less() ;
-<a name="l00566"></a>00566         cpl_msg_indent_less() ;
-<a name="l00567"></a>00567     }
-<a name="l00568"></a>00568     
-<a name="l00569"></a>00569     <span class="comment">/* Freeing */</span>
-<a name="l00570"></a>00570     cpl_bivector_delete(nominal_offsets);
-<a name="l00571"></a>00571     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00572"></a>00572         cpl_bivector_delete(reference_objects[idet]);
-<a name="l00573"></a>00573     cpl_free(reference_objects);
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575     <span class="keywordflow">return</span> 0;
-<a name="l00576"></a>00576 }
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00586"></a>00586 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_save
-<a name="l00589"></a>00589 (cpl_bivector      ** refined_offsets,
-<a name="l00590"></a>00590  cpl_vector        ** correlations,
-<a name="l00591"></a>00591  cpl_parameterlist *  recipe_parlist,
-<a name="l00592"></a>00592  cpl_frameset      *  recipe_frameset)
-<a name="l00593"></a>00593 {
-<a name="l00594"></a>00594     cpl_table        ** offset_tables;
-<a name="l00595"></a>00595     <span class="keywordtype">int</span>                 ioff;
-<a name="l00596"></a>00596     <span class="keywordtype">int</span>                 idet;
-<a name="l00597"></a>00597     <span class="keywordtype">int</span>                 noff;
-<a name="l00598"></a>00598     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_step_refine_offsets"</span>;
-<a name="l00599"></a>00599     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l00600"></a>00600     
-<a name="l00601"></a>00601     
-<a name="l00602"></a>00602     <span class="comment">/* Convert the offsets to a table */</span>
-<a name="l00603"></a>00603     offset_tables = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00604"></a>00604     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00605"></a>00605     {
-<a name="l00606"></a>00606         offset_tables[idet] = cpl_table_new
-<a name="l00607"></a>00607             (cpl_bivector_get_size(refined_offsets[idet]));
-<a name="l00608"></a>00608         cpl_table_new_column(offset_tables[idet], 
-<a name="l00609"></a>00609                              HAWKI_COL_OFFSET_X, CPL_TYPE_FLOAT);
-<a name="l00610"></a>00610         cpl_table_set_column_unit(offset_tables[idet],HAWKI_COL_OFFSET_X,<span class="stringliteral">"pix"</span>);
-<a name="l00611"></a>00611         cpl_table_new_column(offset_tables[idet], 
-<a name="l00612"></a>00612                              HAWKI_COL_OFFSET_Y, CPL_TYPE_FLOAT);
-<a name="l00613"></a>00613         cpl_table_set_column_unit(offset_tables[idet],HAWKI_COL_OFFSET_Y,<span class="stringliteral">"pix"</span>);
-<a name="l00614"></a>00614         cpl_table_new_column(offset_tables[idet], 
-<a name="l00615"></a>00615                              HAWKI_COL_CORRELATION, CPL_TYPE_FLOAT);
-<a name="l00616"></a>00616         noff = cpl_bivector_get_size(refined_offsets[idet]);
-<a name="l00617"></a>00617         <span class="keywordflow">for</span>(ioff = 0; ioff < noff; ++ioff)
-<a name="l00618"></a>00618         {
-<a name="l00619"></a>00619             <span class="keywordtype">double</span> xoffset, yoffset, corr;
-<a name="l00620"></a>00620             xoffset = cpl_vector_get
-<a name="l00621"></a>00621                 (cpl_bivector_get_x(refined_offsets[idet]), ioff);
-<a name="l00622"></a>00622             yoffset = cpl_vector_get
-<a name="l00623"></a>00623                 (cpl_bivector_get_y(refined_offsets[idet]), ioff);
-<a name="l00624"></a>00624             corr    = cpl_vector_get(correlations[idet], ioff);
-<a name="l00625"></a>00625             cpl_table_set
-<a name="l00626"></a>00626                 (offset_tables[idet], HAWKI_COL_OFFSET_X, ioff, xoffset);
-<a name="l00627"></a>00627             cpl_table_set
-<a name="l00628"></a>00628                 (offset_tables[idet], HAWKI_COL_OFFSET_Y, ioff, yoffset);
-<a name="l00629"></a>00629             cpl_table_set
-<a name="l00630"></a>00630                 (offset_tables[idet], HAWKI_COL_CORRELATION, ioff, corr);
-<a name="l00631"></a>00631         }
-<a name="l00632"></a>00632     }
-<a name="l00633"></a>00633     
-<a name="l00634"></a>00634     <span class="comment">/* Write the table with the statistics */</span>
-<a name="l00635"></a>00635     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset, 
-<a name="l00636"></a>00636                           recipe_parlist,
-<a name="l00637"></a>00637                           recipe_frameset,
-<a name="l00638"></a>00638                           (<span class="keyword">const</span> cpl_table **)offset_tables,
-<a name="l00639"></a>00639                           recipe_name,
-<a name="l00640"></a>00640                           HAWKI_CALPRO_OFFSETS,
-<a name="l00641"></a>00641                           HAWKI_PROTYPE_OFFSETS,
-<a name="l00642"></a>00642                           NULL,
-<a name="l00643"></a>00643                           NULL,
-<a name="l00644"></a>00644                           <span class="stringliteral">"hawki_step_refine_offsets.fits"</span>) != CPL_ERROR_NONE) 
-<a name="l00645"></a>00645     {
-<a name="l00646"></a>00646         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the first extension table"</span>) ;
-<a name="l00647"></a>00647         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00648"></a>00648             cpl_table_delete(offset_tables[idet]);
-<a name="l00649"></a>00649         cpl_free(offset_tables);
-<a name="l00650"></a>00650         <span class="keywordflow">return</span> -1 ;
-<a name="l00651"></a>00651     }
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="comment">/* Free and return */</span>
-<a name="l00654"></a>00654     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)
-<a name="l00655"></a>00655         cpl_table_delete(offset_tables[idet]);
-<a name="l00656"></a>00656     cpl_free(offset_tables);
-<a name="l00657"></a>00657     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00658"></a>00658     {
-<a name="l00659"></a>00659         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00660"></a>00660         <span class="keywordflow">return</span> -1;
-<a name="l00661"></a>00661     }
-<a name="l00662"></a>00662     <span class="keywordflow">return</span>  0;
-<a name="l00663"></a>00663 }
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00680"></a>00680 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00681"></a>00681 <span class="keyword">static</span> cpl_bivector ** hawki_step_refine_offsets_read_select_objects
-<a name="l00682"></a>00682 (<span class="keyword">const</span> cpl_frameset *  reference_obj_frames,
-<a name="l00683"></a>00683  <span class="keywordtype">double</span>                first_image_off_x,
-<a name="l00684"></a>00684  <span class="keywordtype">double</span>                first_image_off_y,
-<a name="l00685"></a>00685  <span class="keywordtype">int</span>                   nx,
-<a name="l00686"></a>00686  <span class="keywordtype">int</span>                   ny)
-<a name="l00687"></a>00687 {
-<a name="l00688"></a>00688     <span class="keyword">const</span> cpl_frame        *  reference_obj_frame;
-<a name="l00689"></a>00689     cpl_table              ** obj_param;
-<a name="l00690"></a>00690     cpl_propertylist       *  sort_column;
-<a name="l00691"></a>00691     cpl_bivector           ** reference_objects;
-<a name="l00692"></a>00692     <span class="keywordtype">int</span>                    idet;
-<a name="l00693"></a>00693     
-<a name="l00694"></a>00694     <span class="comment">/* Get the objects */</span>
-<a name="l00695"></a>00695     cpl_msg_info(__func__,<span class="stringliteral">"Getting the reference object positions"</span>);
-<a name="l00696"></a>00696     reference_obj_frame = cpl_frameset_get_first_const(reference_obj_frames);
-<a name="l00697"></a>00697     obj_param = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(reference_obj_frame);
-<a name="l00698"></a>00698     <span class="keywordflow">if</span>(obj_param == NULL)
-<a name="l00699"></a>00699     {
-<a name="l00700"></a>00700         cpl_msg_error(__func__,<span class="stringliteral">"Could not read the reference objects parameters"</span>);
-<a name="l00701"></a>00701         <span class="keywordflow">return</span> NULL;
-<a name="l00702"></a>00702     }
-<a name="l00703"></a>00703     
-<a name="l00704"></a>00704     <span class="comment">/* Create the sorting criteria: by flux */</span>
-<a name="l00705"></a>00705     sort_column = cpl_propertylist_new();
-<a name="l00706"></a>00706     cpl_propertylist_append_bool(sort_column, HAWKI_COL_OBJ_FLUX, CPL_TRUE);
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708     <span class="comment">/* Allocate partially the reference objects */</span>
-<a name="l00709"></a>00709     reference_objects = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));
-<a name="l00710"></a>00710     
-<a name="l00711"></a>00711     <span class="comment">/* Loop on detectors */</span>
-<a name="l00712"></a>00712     cpl_msg_indent_more();
-<a name="l00713"></a>00713     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)
-<a name="l00714"></a>00714     {
-<a name="l00715"></a>00715         cpl_propertylist * objects_plist;
-<a name="l00716"></a>00716         cpl_vector       * obj_x;
-<a name="l00717"></a>00717         cpl_vector       * obj_y;
-<a name="l00718"></a>00718         <span class="keywordtype">int</span>                nobj;
-<a name="l00719"></a>00719         <span class="keywordtype">int</span>                nselect;
-<a name="l00720"></a>00720         <span class="keywordtype">int</span>                iobj;
-<a name="l00721"></a>00721         <span class="keywordtype">int</span>                ext_nb;
-<a name="l00722"></a>00722         <span class="keywordtype">double</span>             reference_offset_x;
-<a name="l00723"></a>00723         <span class="keywordtype">double</span>             reference_offset_y;
-<a name="l00724"></a>00724         
-<a name="l00725"></a>00725         <span class="comment">/* Get the global offset */</span>
-<a name="l00726"></a>00726         <span class="comment">/* This allows to know which is the reference point of the detected </span>
-<a name="l00727"></a>00727 <span class="comment">         * objects positions (which are referred in general to the combined image */</span>
-<a name="l00728"></a>00728         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00729"></a>00729             (cpl_frame_get_filename(reference_obj_frame), idet + 1);
-<a name="l00730"></a>00730         objects_plist = cpl_propertylist_load
-<a name="l00731"></a>00731              (cpl_frame_get_filename(reference_obj_frame), ext_nb);
-<a name="l00732"></a>00732         reference_offset_x =
-<a name="l00733"></a>00733             <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(objects_plist);
-<a name="l00734"></a>00734         reference_offset_y = 
-<a name="l00735"></a>00735             <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(objects_plist);
-<a name="l00736"></a>00736         <span class="keywordflow">if</span>(cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00737"></a>00737         {
-<a name="l00738"></a>00738             cpl_msg_error(__func__,<span class="stringliteral">"Could not find keywords "</span>
-<a name="l00739"></a>00739                           <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX,Y in reference objects frame"</span>);            
-<a name="l00740"></a>00740             cpl_propertylist_delete(objects_plist);
-<a name="l00741"></a>00741             cpl_propertylist_delete(sort_column);
-<a name="l00742"></a>00742             <span class="keywordflow">return</span> NULL;
-<a name="l00743"></a>00743         }
-<a name="l00744"></a>00744         cpl_msg_info(__func__,<span class="stringliteral">"Objects offsets wrt telescope: %f %f"</span>, 
-<a name="l00745"></a>00745                      reference_offset_x, reference_offset_y);
-<a name="l00746"></a>00746         cpl_propertylist_delete(objects_plist);
-<a name="l00747"></a>00747         
-<a name="l00748"></a>00748         <span class="comment">/* Sort the table by flux */</span>
-<a name="l00749"></a>00749         cpl_table_sort(obj_param[idet], sort_column);
-<a name="l00750"></a>00750         nobj = cpl_table_get_nrow(obj_param[idet]); 
-<a name="l00751"></a>00751         
-<a name="l00752"></a>00752         <span class="comment">/* Allocate objects vector */</span>
-<a name="l00753"></a>00753         reference_objects[idet] = cpl_bivector_new(nobj);
-<a name="l00754"></a>00754         obj_x = cpl_bivector_get_x(reference_objects[idet]);
-<a name="l00755"></a>00755         obj_y = cpl_bivector_get_y(reference_objects[idet]);
-<a name="l00756"></a>00756         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects in chip %d: %d"</span>, idet+1,nobj);
-<a name="l00757"></a>00757         
-<a name="l00758"></a>00758         <span class="comment">/* Keep only those objects within the first image */</span>
-<a name="l00759"></a>00759         cpl_table_unselect_all(obj_param[idet]);
-<a name="l00760"></a>00760         <span class="keywordflow">for</span>(iobj = 0 ; iobj < nobj; ++iobj)
-<a name="l00761"></a>00761         {
-<a name="l00762"></a>00762             <span class="keywordtype">double</span> xpos_orig = cpl_table_get
-<a name="l00763"></a>00763                 (obj_param[idet], HAWKI_COL_OBJ_POSX, iobj, NULL);
-<a name="l00764"></a>00764             <span class="keywordtype">double</span> ypos_orig = cpl_table_get
-<a name="l00765"></a>00765                 (obj_param[idet], HAWKI_COL_OBJ_POSY, iobj, NULL);
-<a name="l00766"></a>00766             <span class="keywordtype">double</span> xpos_rel = xpos_orig - reference_offset_x + first_image_off_x;
-<a name="l00767"></a>00767             <span class="keywordtype">double</span> ypos_rel = ypos_orig - reference_offset_y + first_image_off_y;
-<a name="l00768"></a>00768             <span class="keywordflow">if</span>(xpos_rel < 0.0 || xpos_rel >= nx ||
-<a name="l00769"></a>00769                ypos_rel < 0.0 || ypos_rel >= ny)
-<a name="l00770"></a>00770             {
-<a name="l00771"></a>00771                 cpl_table_select_row(obj_param[idet], iobj);
-<a name="l00772"></a>00772             }
-<a name="l00773"></a>00773         }
-<a name="l00774"></a>00774         cpl_table_erase_selected(obj_param[idet]);
-<a name="l00775"></a>00775         nobj = cpl_table_get_nrow(obj_param[idet]);
-<a name="l00776"></a>00776         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects within limits of detector "</span>
-<a name="l00777"></a>00777                                <span class="stringliteral">"in chip %d: %d"</span>, idet+1,nobj);
-<a name="l00778"></a>00778         
-<a name="l00779"></a>00779         <span class="comment">/* Apply the flux criteria */</span>
-<a name="l00780"></a>00780         nselect = hawki_step_refine_offsets_config.nbrightest;
-<a name="l00781"></a>00781         <span class="keywordflow">if</span>(nselect < 0 || nselect > nobj)
-<a name="l00782"></a>00782             nselect = nobj;
-<a name="l00783"></a>00783         cpl_msg_info(__func__, <span class="stringliteral">"Number of selected objects: %d"</span>, nselect);
-<a name="l00784"></a>00784         <span class="keywordflow">for</span>(iobj = 0 ; iobj < nselect; ++iobj)
-<a name="l00785"></a>00785         {
-<a name="l00786"></a>00786             <span class="keywordtype">double</span> xpos_orig = cpl_table_get
-<a name="l00787"></a>00787                 (obj_param[idet], HAWKI_COL_OBJ_POSX, iobj, NULL);
-<a name="l00788"></a>00788             <span class="keywordtype">double</span> ypos_orig = cpl_table_get
-<a name="l00789"></a>00789                 (obj_param[idet], HAWKI_COL_OBJ_POSY, iobj, NULL);
-<a name="l00790"></a>00790 
-<a name="l00791"></a>00791             cpl_vector_set
-<a name="l00792"></a>00792                 (obj_x, iobj, xpos_orig - reference_offset_x + first_image_off_x);
-<a name="l00793"></a>00793             cpl_vector_set
-<a name="l00794"></a>00794                 (obj_y, iobj, ypos_orig - reference_offset_y + first_image_off_y);
-<a name="l00795"></a>00795             cpl_msg_debug(__func__,<span class="stringliteral">"Using anchor point at %f,%f"</span>,
-<a name="l00796"></a>00796                           cpl_vector_get(obj_x,iobj),
-<a name="l00797"></a>00797                           cpl_vector_get(obj_y,iobj));
-<a name="l00798"></a>00798             
-<a name="l00799"></a>00799         }
-<a name="l00800"></a>00800         cpl_vector_set_size(obj_x, nselect);
-<a name="l00801"></a>00801         cpl_vector_set_size(obj_y, nselect);
-<a name="l00802"></a>00802         
-<a name="l00803"></a>00803     }
-<a name="l00804"></a>00804     cpl_msg_indent_less();
-<a name="l00805"></a>00805     
-<a name="l00806"></a>00806     <span class="comment">/* Freeing */</span>
-<a name="l00807"></a>00807     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00808"></a>00808         cpl_table_delete(obj_param[idet]);
-<a name="l00809"></a>00809     cpl_free(obj_param);
-<a name="l00810"></a>00810     cpl_propertylist_delete(sort_column);
-<a name="l00811"></a>00811     
-<a name="l00812"></a>00812     <span class="keywordflow">return</span> reference_objects;
-<a name="l00813"></a>00813 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_refine_offsets.c,v 1.17 2011/10/24 10:42: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/10/24 10:42:12 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <cpl.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="preprocessor">#include "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_calib.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_saa.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_bkg.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#include "hawki_properties_tel.h"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">#include "hawki_image_stats.h"</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">                                Define</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> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#define NEGLIG_OFF_DIFF     0.1</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#define SQR(x) ((x)*(x))</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></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">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets(cpl_parameterlist *, cpl_frameset *) ;</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">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_retrieve_input_param</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> (cpl_parameterlist  *  parlist);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_fine</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> (<span class="keyword">const</span> cpl_frameset  *  science_objects_frames,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  <span class="keyword">const</span> cpl_frameset  *  reference_objects_frames,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_bivector        ** refined_offsets,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  cpl_vector          ** correl);</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> <span class="keywordtype">int</span> hawki_step_refine_offsets_save</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> (cpl_bivector      ** refined_offsets,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  cpl_vector        ** correlations,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_frameset      *  recipe_frameset);</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> cpl_bivector ** hawki_step_refine_offsets_read_select_objects</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> (<span class="keyword">const</span> cpl_frameset *  reference_obj_frames,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>  <span class="keywordtype">double</span>                first_image_off_x,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>  <span class="keywordtype">double</span>                first_image_off_y,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>  <span class="keywordtype">int</span>                   nx,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  <span class="keywordtype">int</span>                   ny);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="comment">                            Static variables</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keyword">struct </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">/* Inputs */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="keywordtype">int</span>                 nbrightest;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordtype">int</span>                 sx ;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">int</span>                 sy ;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordtype">int</span>                 mx ;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="keywordtype">int</span>                 my ;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> } hawki_step_refine_offsets_config;</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">static</span> <span class="keywordtype">char</span> hawki_step_refine_offsets_description[] =</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"hawki_step_refine_offsets -- utility to refine the nominal offsets.\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"This utility will take the offsets in the header as a first approach\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"and tries to refine them correlating the input images at the points\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"given by the detected objects.\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"images.fits "</span>HAWKI_CALPRO_DIST_CORRECTED<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"images.fits "</span>HAWKI_CALPRO_BKG_SUBTRACTED<span class="stringliteral">" and\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="stringliteral">"det_obj_stats.fits "</span>HAWKI_CALPRO_OBJ_PARAM<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"hawki_step_refine_offsets.fits ("</span>HAWKI_CALPRO_OFFSETS<span class="stringliteral">"): Table with refined offsets\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="stringliteral">"or 1 otherwise"</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> </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="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>                     HAWKI_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">"hawki_step_refine_offsets"</span>,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"Jitter recipe"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     hawki_step_refine_offsets_description,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</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>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                     hawki_step_refine_offsets_create,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     hawki_step_refine_offsets_exec,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     hawki_step_refine_offsets_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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_create(cpl_plugin * plugin)</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_recipe      * recipe ;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="comment">/* --xcorr */</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_refine_offsets.xcorr"</span>,</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                                 <span class="stringliteral">"Cross correlation search and measure sizes"</span>,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                                 <span class="stringliteral">"hawki.hawki_step_refine_offsets"</span>,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                                 <span class="stringliteral">"20,20,25,25"</span>) ;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcorr"</span>) ;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* --nbrightest */</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_step_refine_offsets.nbrightest"</span>,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                 <span class="stringliteral">"Number of brightest objects to use"</span>,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                 <span class="stringliteral">"hawki.hawki_step_refine_offsets"</span>,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                                 3);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"nbrightest"</span>) ;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV) ;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     cpl_parameterlist_append(recipe->parameters, p) ;</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">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">else</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="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_refine_offsets(recipe->parameters, recipe->frames) ;</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">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets(</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         cpl_frameset        *   framelist)</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_frameset    *   science_obj_frames ;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_frameset    *   reference_obj_frames ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_bivector    **  refined_offsets;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_vector      **  correl;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="keywordtype">int</span>                 idet;</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">/* Retrieve input parameters */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordflow">if</span>(hawki_step_refine_offsets_retrieve_input_param(parlist))</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>         cpl_msg_error(__func__, <span class="stringliteral">"Wrong parameters"</span>);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</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> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="comment">/* Get the object images frames */</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     science_obj_frames = </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_DIST_CORRECTED);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (science_obj_frames == NULL)</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>         science_obj_frames =</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                 <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKG_SUBTRACTED);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         <span class="keywordflow">if</span> (science_obj_frames == NULL)</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_error(__func__, <span class="stringliteral">"No science object frames provided (%s)"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                     HAWKI_CALPRO_DIST_CORRECTED);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>             <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Get the detected "objects" frame */</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     reference_obj_frames = </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_OBJ_PARAM);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="keywordflow">if</span>(cpl_frameset_get_size(reference_obj_frames) != 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>         cpl_msg_error(__func__, <span class="stringliteral">"One object parameters frame must be provided (%s)"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                 HAWKI_CALPRO_OBJ_PARAM);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         cpl_frameset_delete(science_obj_frames) ;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         <span class="keywordflow">if</span>(reference_obj_frames != NULL)</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>             cpl_frameset_delete(reference_obj_frames);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Get the offsets refinement */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     refined_offsets = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     correl          = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_vector *));</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)</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>         refined_offsets[idet] = cpl_bivector_new</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             (cpl_frameset_get_size(science_obj_frames));</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         correl[idet] = cpl_vector_new</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             (cpl_frameset_get_size(science_obj_frames));</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> (hawki_step_refine_offsets_fine</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>             (science_obj_frames, reference_obj_frames, </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>              refined_offsets, correl) == -1) </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_msg_error(__func__, <span class="stringliteral">"Cannot refine the objects"</span>) ;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         cpl_frameset_delete(reference_obj_frames) ;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_frameset_delete(science_obj_frames) ;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)</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>             cpl_bivector_delete(refined_offsets[idet]);</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>             cpl_vector_delete(correl[idet]);</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_free(refined_offsets);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         cpl_free(correl);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* Save the products */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>) ;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> (hawki_step_refine_offsets_save</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             (refined_offsets, correl, parlist, framelist) == -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>         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                                  <span class="stringliteral">"Check permisions or disk space"</span>);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         cpl_frameset_delete(science_obj_frames);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         cpl_frameset_delete(reference_obj_frames);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)</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_bivector_delete(refined_offsets[idet]);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>             cpl_vector_delete(correl[idet]);</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_free(refined_offsets);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         cpl_free(correl);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_frameset_delete(science_obj_frames);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_frameset_delete(reference_obj_frames);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">for</span>(idet = 0 ; idet < HAWKI_NB_DETECTORS; ++idet)</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_bivector_delete(refined_offsets[idet]);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         cpl_vector_delete(correl[idet]);</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_free(refined_offsets);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     cpl_free(correl);</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">/* Return */</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         <span class="keywordflow">return</span> -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">else</span> <span class="keywordflow">return</span> 0 ;</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="keywordtype">int</span> hawki_step_refine_offsets_retrieve_input_param</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> (cpl_parameterlist  *  parlist)</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>     cpl_parameter   *   par ;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      *   sval ;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     par = NULL ;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         (parlist, <span class="stringliteral">"hawki.hawki_step_refine_offsets.nbrightest"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     hawki_step_refine_offsets_config.nbrightest =</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     par = cpl_parameterlist_find</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         (parlist, <span class="stringliteral">"hawki.hawki_step_refine_offsets.xcorr"</span>);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     sval = cpl_parameter_get_string(par);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (sscanf(sval, <span class="stringliteral">"%d,%d,%d,%d"</span>,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                &hawki_step_refine_offsets_config.sx,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                &hawki_step_refine_offsets_config.sy,</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                &hawki_step_refine_offsets_config.mx,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                &hawki_step_refine_offsets_config.my)!=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="keywordflow">return</span> -1;</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">return</span> 0;</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> </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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_fine</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> (<span class="keyword">const</span> cpl_frameset  *  science_obj_frames,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>  <span class="keyword">const</span> cpl_frameset  *  reference_obj_frames,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>  cpl_bivector        ** refined_offsets,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>  cpl_vector          ** correl)</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>     cpl_imagelist    *   in ;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_bivector     *   nominal_offsets ;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_bivector     **  reference_objects;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keywordtype">double</span>           *   offs_est_x ;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordtype">double</span>           *   offs_est_y ;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keywordtype">double</span>               off_0_x;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordtype">double</span>               off_0_y;</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordtype">double</span>               max_x, max_y ;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordtype">int</span>                  idet;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordtype">int</span>                  ioff;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_propertylist *   header;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordtype">int</span>                  nx;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keywordtype">int</span>                  ny;</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">/* Get the nominal offsets from the header */</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     cpl_msg_info(__func__,<span class="stringliteral">"Getting the nominal offsets"</span>);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     nominal_offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(science_obj_frames); </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keywordflow">if</span> (nominal_offsets  == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot load the header offsets"</span>) ;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         <span class="keywordflow">return</span> -1;</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>     offs_est_x = cpl_bivector_get_x_data(nominal_offsets);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     offs_est_y = cpl_bivector_get_y_data(nominal_offsets);</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">/* Print the header offsets */</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) </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_msg_info(__func__, <span class="stringliteral">"Telescope offsets (Frame %d): %g %g"</span>, ioff+1,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                 offs_est_x[ioff], offs_est_y[ioff]) ;</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>     cpl_msg_indent_less();</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">/* Get the size of the detectors of the first extension */</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     header = cpl_propertylist_load</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         (cpl_frame_get_filename</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                 (cpl_frameset_get_first_const(science_obj_frames)), 1);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     nx = <a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(header);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     ny = <a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(header);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     cpl_propertylist_delete(header);</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="comment">/* Get the first offset to all offsets */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     off_0_x = offs_est_x[0];</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     off_0_y = offs_est_y[0];</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">/* Get the objects (anchor points)*/</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="comment">/* They are already in the "first image" reference system */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     reference_objects = </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         hawki_step_refine_offsets_read_select_objects(reference_obj_frames,</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                                                       off_0_x,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                                       off_0_y,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                                                       nx,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                                       ny);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span>(reference_objects == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Error reading the reference objects"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         cpl_bivector_delete(nominal_offsets);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Subtract the first offset to all offsets */</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     max_x = max_y = 0.0 ;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">for</span> (ioff=1 ; ioff<cpl_bivector_get_size(nominal_offsets) ; ioff++) </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>         offs_est_x[ioff] -= off_0_x;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         offs_est_y[ioff] -= off_0_y;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         <span class="keywordflow">if</span> (fabs(offs_est_x[ioff]) > max_x) max_x = fabs(offs_est_x[ioff]) ;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         <span class="keywordflow">if</span> (fabs(offs_est_y[ioff]) > max_y) max_y = fabs(offs_est_y[ioff]) ;</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>     offs_est_x[0] = offs_est_y[0] = 0.00 ;</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">/* Get the opposite offsets. This is to change from </span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> <span class="comment">     * telescope convention to cpl convention */</span> </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     cpl_vector_multiply_scalar(cpl_bivector_get_x(nominal_offsets), -1.0);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     cpl_vector_multiply_scalar(cpl_bivector_get_y(nominal_offsets), -1.0);</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="comment">/* Loop on the detectors */</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_msg_info(__func__, <span class="stringliteral">"Working on detector number %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         cpl_msg_indent_more();</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">/* Load the input data */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         cpl_msg_info(__func__, <span class="stringliteral">"Loading the input data"</span>) ;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         <span class="keywordflow">if</span> ((in = <a class="code" href="group__hawki__load.html#gad4d9d26496599a54ebc31e2a43814895" title="Load the chips of HAWKI frameset in an image list.">hawki_load_detector</a>(science_obj_frames,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                                   idet+1, CPL_TYPE_FLOAT)) == NULL) </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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip %d"</span>, idet+1) ;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             cpl_bivector_delete(nominal_offsets) ;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</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>                 cpl_bivector_delete(reference_objects[idet]);</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>             cpl_free(reference_objects);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>             cpl_msg_indent_less() ;</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="comment">/* Get the refinement */</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         cpl_msg_info(__func__, <span class="stringliteral">"Getting the refinement"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         <span class="keywordflow">if</span> (hawki_geom_refine_images_offsets</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                 (in, </div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                  nominal_offsets,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                  reference_objects[idet],</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>                  hawki_step_refine_offsets_config.sx,</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>                  hawki_step_refine_offsets_config.sy,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                  hawki_step_refine_offsets_config.mx,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                  hawki_step_refine_offsets_config.my,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                  refined_offsets[idet],</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                  correl[idet]) == -1)</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_error(__func__, <span class="stringliteral">"Cannot apply the shift and add"</span>) ;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>             cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>             cpl_bivector_delete(nominal_offsets) ;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>             <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                 cpl_bivector_delete(reference_objects[idet]);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             cpl_free(reference_objects);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             cpl_msg_indent_less() ;</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>             <span class="keywordflow">return</span> -1;</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>         <span class="comment">/* Convert to "telescope criteria" */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         <span class="comment">/* Also add the offset of the first image */</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         cpl_vector_multiply_scalar</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             (cpl_bivector_get_x(refined_offsets[idet]), -1.0);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_vector_multiply_scalar</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             (cpl_bivector_get_y(refined_offsets[idet]), -1.0);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         cpl_vector_add_scalar</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             (cpl_bivector_get_x(refined_offsets[idet]), off_0_x);</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         cpl_vector_add_scalar</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             (cpl_bivector_get_y(refined_offsets[idet]), off_0_y);</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="comment">/* Print the new offsets */</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         <span class="keywordflow">for</span> (ioff=0 ; ioff<cpl_bivector_get_size(refined_offsets[idet]); ioff++) </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(__func__,<span class="stringliteral">"Refined telescope offsets (Frame %d): %g %g"</span>,</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                          ioff+1,</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                          cpl_vector_get(cpl_bivector_get_x</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                                         (refined_offsets[idet]), ioff),</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                          cpl_vector_get(cpl_bivector_get_y</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                                         (refined_offsets[idet]), ioff));</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_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         cpl_msg_indent_less() ;</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>     <span class="comment">/* Freeing */</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_bivector_delete(nominal_offsets);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         cpl_bivector_delete(reference_objects[idet]);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     cpl_free(reference_objects);</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> 0;</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">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_refine_offsets_save</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> (cpl_bivector      ** refined_offsets,</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>  cpl_vector        ** correlations,</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>  cpl_frameset      *  recipe_frameset)</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>     cpl_table        ** offset_tables;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">int</span>                 ioff;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordtype">int</span>                 noff;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_step_refine_offsets"</span>;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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">/* Convert the offsets to a table */</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     offset_tables = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</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>         offset_tables[idet] = cpl_table_new</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>             (cpl_bivector_get_size(refined_offsets[idet]));</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         cpl_table_new_column(offset_tables[idet], </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>                              HAWKI_COL_OFFSET_X, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         cpl_table_set_column_unit(offset_tables[idet],HAWKI_COL_OFFSET_X,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         cpl_table_new_column(offset_tables[idet], </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>                              HAWKI_COL_OFFSET_Y, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         cpl_table_set_column_unit(offset_tables[idet],HAWKI_COL_OFFSET_Y,<span class="stringliteral">"pix"</span>);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         cpl_table_new_column(offset_tables[idet], </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>                              HAWKI_COL_CORRELATION, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         noff = cpl_bivector_get_size(refined_offsets[idet]);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         <span class="keywordflow">for</span>(ioff = 0; ioff < noff; ++ioff)</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="keywordtype">double</span> xoffset, yoffset, corr;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>             xoffset = cpl_vector_get</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>                 (cpl_bivector_get_x(refined_offsets[idet]), ioff);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>             yoffset = cpl_vector_get</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>                 (cpl_bivector_get_y(refined_offsets[idet]), ioff);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             corr    = cpl_vector_get(correlations[idet], ioff);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             cpl_table_set</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                 (offset_tables[idet], HAWKI_COL_OFFSET_X, ioff, xoffset);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             cpl_table_set</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                 (offset_tables[idet], HAWKI_COL_OFFSET_Y, ioff, yoffset);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>             cpl_table_set</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>                 (offset_tables[idet], HAWKI_COL_CORRELATION, ioff, corr);</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>     }</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">/* Write the table with the statistics */</span></div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset, </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                           recipe_parlist,</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                           recipe_frameset,</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                           (<span class="keyword">const</span> cpl_table **)offset_tables,</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                           recipe_name,</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>                           HAWKI_CALPRO_OFFSETS,</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>                           HAWKI_PROTYPE_OFFSETS,</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>                           NULL,</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                           NULL,</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>                           <span class="stringliteral">"hawki_step_refine_offsets.fits"</span>) != CPL_ERROR_NONE) </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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the first extension table"</span>) ;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>             cpl_table_delete(offset_tables[idet]);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>         cpl_free(offset_tables);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keywordflow">for</span>(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet)</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         cpl_table_delete(offset_tables[idet]);</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     cpl_free(offset_tables);</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         <span class="keywordflow">return</span> -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>     <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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="keyword">static</span> cpl_bivector ** hawki_step_refine_offsets_read_select_objects</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> (<span class="keyword">const</span> cpl_frameset *  reference_obj_frames,</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>  <span class="keywordtype">double</span>                first_image_off_x,</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>  <span class="keywordtype">double</span>                first_image_off_y,</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>  <span class="keywordtype">int</span>                   nx,</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>  <span class="keywordtype">int</span>                   ny)</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="keyword">const</span> cpl_frame        *  reference_obj_frame;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     cpl_table              ** obj_param;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_propertylist       *  sort_column;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     cpl_bivector           ** reference_objects;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordtype">int</span>                    idet;</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="comment">/* Get the objects */</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_msg_info(__func__,<span class="stringliteral">"Getting the reference object positions"</span>);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     reference_obj_frame = cpl_frameset_get_first_const(reference_obj_frames);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     obj_param = <a class="code" href="group__hawki__load.html#ga8ad708e19bdb35ac89abc2d9ba3932f0" title="Load a table with four extensions, one for each chip.">hawki_load_tables</a>(reference_obj_frame);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordflow">if</span>(obj_param == 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>         cpl_msg_error(__func__,<span class="stringliteral">"Could not read the reference objects parameters"</span>);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         <span class="keywordflow">return</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>     </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     <span class="comment">/* Create the sorting criteria: by flux */</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     sort_column = cpl_propertylist_new();</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     cpl_propertylist_append_bool(sort_column, HAWKI_COL_OBJ_FLUX, CPL_TRUE);</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="comment">/* Allocate partially the reference objects */</span></div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     reference_objects = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_bivector *));</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">/* Loop on detectors */</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++)</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>         cpl_propertylist * objects_plist;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>         cpl_vector       * obj_x;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         cpl_vector       * obj_y;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>         <span class="keywordtype">int</span>                nobj;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         <span class="keywordtype">int</span>                nselect;</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         <span class="keywordtype">int</span>                iobj;</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         <span class="keywordtype">int</span>                ext_nb;</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         <span class="keywordtype">double</span>             reference_offset_x;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         <span class="keywordtype">double</span>             reference_offset_y;</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="comment">/* Get the global offset */</span></div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         <span class="comment">/* This allows to know which is the reference point of the detected </span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> <span class="comment">         * objects positions (which are referred in general to the combined image */</span></div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>             (cpl_frame_get_filename(reference_obj_frame), idet + 1);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         objects_plist = cpl_propertylist_load</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>              (cpl_frame_get_filename(reference_obj_frame), ext_nb);</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>         reference_offset_x =</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>             <a class="code" href="group__hawki__pfits.html#ga24483514187ce9bcf0860cc654b8508c" title="find out the cumulative X offset of the combined image">hawki_pfits_get_comb_cumoffsetx</a>(objects_plist);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         reference_offset_y = </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>             <a class="code" href="group__hawki__pfits.html#gadc1b3f141f5474486b5b32502634b29a" title="find out the cumulative Y offset of the combined image">hawki_pfits_get_comb_cumoffsety</a>(objects_plist);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>         <span class="keywordflow">if</span>(cpl_error_get_code() != CPL_ERROR_NONE)</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_msg_error(__func__,<span class="stringliteral">"Could not find keywords "</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                           <span class="stringliteral">"ESO QC COMBINED CUMOFFSETX,Y in reference objects frame"</span>);            </div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>             cpl_propertylist_delete(objects_plist);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>             cpl_propertylist_delete(sort_column);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>             <span class="keywordflow">return</span> NULL;</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>         cpl_msg_info(__func__,<span class="stringliteral">"Objects offsets wrt telescope: %f %f"</span>, </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>                      reference_offset_x, reference_offset_y);</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         cpl_propertylist_delete(objects_plist);</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">/* Sort the table by flux */</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         cpl_table_sort(obj_param[idet], sort_column);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         nobj = cpl_table_get_nrow(obj_param[idet]); </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="comment">/* Allocate objects vector */</span></div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         reference_objects[idet] = cpl_bivector_new(nobj);</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>         obj_x = cpl_bivector_get_x(reference_objects[idet]);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>         obj_y = cpl_bivector_get_y(reference_objects[idet]);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects in chip %d: %d"</span>, idet+1,nobj);</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="comment">/* Keep only those objects within the first image */</span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         cpl_table_unselect_all(obj_param[idet]);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         <span class="keywordflow">for</span>(iobj = 0 ; iobj < nobj; ++iobj)</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> xpos_orig = cpl_table_get</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>                 (obj_param[idet], HAWKI_COL_OBJ_POSX, iobj, NULL);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>             <span class="keywordtype">double</span> ypos_orig = cpl_table_get</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                 (obj_param[idet], HAWKI_COL_OBJ_POSY, iobj, NULL);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>             <span class="keywordtype">double</span> xpos_rel = xpos_orig - reference_offset_x + first_image_off_x;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>             <span class="keywordtype">double</span> ypos_rel = ypos_orig - reference_offset_y + first_image_off_y;</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>             <span class="keywordflow">if</span>(xpos_rel < 0.0 || xpos_rel >= nx ||</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                ypos_rel < 0.0 || ypos_rel >= ny)</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>                 cpl_table_select_row(obj_param[idet], iobj);</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>         }</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         cpl_table_erase_selected(obj_param[idet]);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         nobj = cpl_table_get_nrow(obj_param[idet]);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         cpl_msg_info(__func__, <span class="stringliteral">"Number of objects within limits of detector "</span></div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>                                <span class="stringliteral">"in chip %d: %d"</span>, idet+1,nobj);</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="comment">/* Apply the flux criteria */</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         nselect = hawki_step_refine_offsets_config.nbrightest;</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         <span class="keywordflow">if</span>(nselect < 0 || nselect > nobj)</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>             nselect = nobj;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         cpl_msg_info(__func__, <span class="stringliteral">"Number of selected objects: %d"</span>, nselect);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         <span class="keywordflow">for</span>(iobj = 0 ; iobj < nselect; ++iobj)</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> xpos_orig = cpl_table_get</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                 (obj_param[idet], HAWKI_COL_OBJ_POSX, iobj, NULL);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             <span class="keywordtype">double</span> ypos_orig = cpl_table_get</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>                 (obj_param[idet], HAWKI_COL_OBJ_POSY, iobj, NULL);</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_vector_set</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                 (obj_x, iobj, xpos_orig - reference_offset_x + first_image_off_x);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>             cpl_vector_set</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                 (obj_y, iobj, ypos_orig - reference_offset_y + first_image_off_y);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>             cpl_msg_debug(__func__,<span class="stringliteral">"Using anchor point at %f,%f"</span>,</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>                           cpl_vector_get(obj_x,iobj),</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                           cpl_vector_get(obj_y,iobj));</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>         }</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         cpl_vector_set_size(obj_x, nselect);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>         cpl_vector_set_size(obj_y, nselect);</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>     cpl_msg_indent_less();</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="comment">/* Freeing */</span></div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     <span class="keywordflow">for</span> (idet=0 ; idet< HAWKI_NB_DETECTORS ; idet++) </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>         cpl_table_delete(obj_param[idet]);</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     cpl_free(obj_param);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_propertylist_delete(sort_column);</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">return</span> reference_objects;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</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/hawki__step__stats_8c_source.html b/html/hawki__step__stats_8c_source.html
index bc619ea..62e1fbf 100644
--- a/html/hawki__step__stats_8c_source.html
+++ b/html/hawki__step__stats_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_stats.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,409 +40,410 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_stats.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_stats.c,v 1.13 2012/11/30 14:51:22 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/30 14:51:22 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.13 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_image_stats.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                            Functions prototypes</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00054"></a>00054 <span class="preprocessor">#endif</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_create(cpl_plugin *) ;
-<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_exec(cpl_plugin *) ;
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_destroy(cpl_plugin *) ;
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_frameset_stats
-<a name="l00063"></a>00063 (cpl_table        ** target_stats,
-<a name="l00064"></a>00064  cpl_propertylist ** stats_stats,
-<a name="l00065"></a>00065  cpl_frameset     *  target_frames);
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_save
-<a name="l00068"></a>00068 (cpl_table         ** target_stats,
-<a name="l00069"></a>00069  cpl_parameterlist *  recipe_parlist,
-<a name="l00070"></a>00070  cpl_frameset      *  recipe_frameset,
-<a name="l00071"></a>00071  cpl_frameset      *  used_frameset,
-<a name="l00072"></a>00072  cpl_propertylist  ** stats_stats,
-<a name="l00073"></a>00073  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,
-<a name="l00074"></a>00074  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype);
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00077"></a>00077 <span class="comment">                            Static variables</span>
-<a name="l00078"></a>00078 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_stats_description[] =
-<a name="l00081"></a>00081 <span class="stringliteral">"hawki_step_stats -- hawki statistics utility (mean, stdev, ...).\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"raw-jitter.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"bkg.fits "</span>HAWKI_CALPRO_BKGIMAGE<span class="stringliteral">" or\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"raw-flat.fits "</span>HAWKI_CAL_FLAT_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"raw-dark.fits "</span>HAWKI_CAL_DARK_RAW<span class="stringliteral">" or\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"raw-zpoint.fits "</span>HAWKI_CAL_ZPOINT_RAW<span class="stringliteral">" \n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_JITTER_STATS<span class="stringliteral">"): Statistics of raw jitter images, or\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_JITTER_BKG_STATS<span class="stringliteral">"): Statistics of background images, or\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_FLAT_STATS<span class="stringliteral">"): Statistics of raw flats, or\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_DARK_STATS<span class="stringliteral">"): Statistics of raw darks, or\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_ZPOINT_STATS<span class="stringliteral">"): Statistics of raw standard star images.\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00100"></a>00100 <span class="comment">                                Functions code</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="l00111"></a>00111 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00112"></a>00112 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00113"></a>00113 {
-<a name="l00114"></a>00114     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00115"></a>00115     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     cpl_plugin_init(plugin,
-<a name="l00118"></a>00118                     CPL_PLUGIN_API,
-<a name="l00119"></a>00119                     HAWKI_BINARY_VERSION,
-<a name="l00120"></a>00120                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00121"></a>00121                     <span class="stringliteral">"hawki_step_stats"</span>,
-<a name="l00122"></a>00122                     <span class="stringliteral">"Standard statistics utility"</span>,
-<a name="l00123"></a>00123                     hawki_step_stats_description,
-<a name="l00124"></a>00124                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00125"></a>00125                     PACKAGE_BUGREPORT,  
-<a name="l00126"></a>00126                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00127"></a>00127                     hawki_step_stats_create,
-<a name="l00128"></a>00128                     hawki_step_stats_exec,
-<a name="l00129"></a>00129                     hawki_step_stats_destroy) ;
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     cpl_pluginlist_append(list, plugin) ;
-<a name="l00132"></a>00132     
-<a name="l00133"></a>00133     <span class="keywordflow">return</span> 0;
-<a name="l00134"></a>00134 }
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136 <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">int</span> hawki_step_stats_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">/* cpl_parameter   * p ; */</span>
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00157"></a>00157     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00158"></a>00158     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00159"></a>00159         <span class="keywordflow">return</span> 1;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00162"></a>00162     <span class="comment">/* None.. */</span>
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/* Return */</span>
-<a name="l00165"></a>00165     <span class="keywordflow">return</span> 0;
-<a name="l00166"></a>00166 }
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00174"></a>00174 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_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="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="comment">/* Issue a banner */</span>
-<a name="l00185"></a>00185     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="keywordflow">return</span> hawki_step_stats(recipe->parameters, recipe->frames) ;
-<a name="l00188"></a>00188 }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00196"></a>00196 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00197"></a>00197 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_destroy(cpl_plugin * plugin)
-<a name="l00198"></a>00198 {
-<a name="l00199"></a>00199     cpl_recipe  *   recipe ;
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     cpl_parameterlist_delete(recipe->parameters) ;
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00217"></a>00217 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00218"></a>00218 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats(
-<a name="l00219"></a>00219         cpl_parameterlist   *   parlist, 
-<a name="l00220"></a>00220         cpl_frameset        *   framelist)
-<a name="l00221"></a>00221 {
-<a name="l00222"></a>00222     cpl_frameset     *  frames ;
-<a name="l00223"></a>00223     cpl_table        ** target_stats;
-<a name="l00224"></a>00224     cpl_propertylist ** stats_stats;  
-<a name="l00225"></a>00225     <span class="keywordtype">int</span>                 idet;
-<a name="l00226"></a>00226     <span class="keywordtype">char</span>                calpro[1024];
-<a name="l00227"></a>00227     <span class="keywordtype">char</span>                protype[1024];
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00230"></a>00230     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) 
-<a name="l00231"></a>00231     {
-<a name="l00232"></a>00232         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00233"></a>00233         <span class="keywordflow">return</span> -1;
-<a name="l00234"></a>00234     }
-<a name="l00235"></a>00235 
-<a name="l00236"></a>00236     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00237"></a>00237     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);
-<a name="l00238"></a>00238     frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;
-<a name="l00239"></a>00239     snprintf(calpro, 1024, HAWKI_CALPRO_JITTER_STATS);
-<a name="l00240"></a>00240     snprintf(protype, 1024, HAWKI_PROTYPE_JITTER_STATS);
-<a name="l00241"></a>00241     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00242"></a>00242     {
-<a name="l00243"></a>00243         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKGIMAGE);
-<a name="l00244"></a>00244         snprintf(calpro, 1024, HAWKI_CALPRO_JITTER_BKG_STATS);
-<a name="l00245"></a>00245         snprintf(protype, 1024, HAWKI_PROTYPE_JITTER_BKG_STATS);
-<a name="l00246"></a>00246     }
-<a name="l00247"></a>00247     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00248"></a>00248     {
-<a name="l00249"></a>00249         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_DARK_RAW);
-<a name="l00250"></a>00250         snprintf(calpro, 1024, HAWKI_CALPRO_DARK_STATS);
-<a name="l00251"></a>00251         snprintf(protype, 1024, HAWKI_PROTYPE_DARK_STATS);
-<a name="l00252"></a>00252     }
-<a name="l00253"></a>00253     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00254"></a>00254     {
-<a name="l00255"></a>00255         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_FLAT_RAW);
-<a name="l00256"></a>00256         snprintf(calpro, 1024, HAWKI_CALPRO_FLAT_STATS);
-<a name="l00257"></a>00257         snprintf(protype, 1024, HAWKI_PROTYPE_FLAT_STATS);
-<a name="l00258"></a>00258     }
-<a name="l00259"></a>00259     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00260"></a>00260     {
-<a name="l00261"></a>00261         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_ZPOINT_RAW);
-<a name="l00262"></a>00262         snprintf(calpro, 1024, HAWKI_CALPRO_ZPOINT_STATS);
-<a name="l00263"></a>00263         snprintf(protype, 1024, HAWKI_PROTYPE_ZPOINT_STATS);
-<a name="l00264"></a>00264     }
-<a name="l00265"></a>00265     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00266"></a>00266     {
-<a name="l00267"></a>00267         cpl_msg_error(__func__,<span class="stringliteral">"Tag of input frames not supported"</span>);
-<a name="l00268"></a>00268         cpl_msg_error(__func__,<span class="stringliteral">"Supported: %s %s %s %s %s"</span>,
-<a name="l00269"></a>00269                 HAWKI_IMG_JITTER_RAW, HAWKI_CALPRO_BKGIMAGE,
-<a name="l00270"></a>00270                 HAWKI_CAL_DARK_RAW, HAWKI_CAL_FLAT_RAW, HAWKI_CAL_ZPOINT_RAW);
-<a name="l00271"></a>00271         <span class="keywordflow">return</span> -1;
-<a name="l00272"></a>00272     }
-<a name="l00273"></a>00273     
-<a name="l00274"></a>00274     <span class="comment">/* Create the statistics table and the "stats of the stats"*/</span>
-<a name="l00275"></a>00275     target_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00276"></a>00276     stats_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));
-<a name="l00277"></a>00277     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00278"></a>00278     {
-<a name="l00279"></a>00279         target_stats[idet] = cpl_table_new(cpl_frameset_get_size(frames));
-<a name="l00280"></a>00280         stats_stats[idet] = cpl_propertylist_new();
-<a name="l00281"></a>00281     }
-<a name="l00282"></a>00282     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(target_stats);
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/* Compute actually the statistics */</span>
-<a name="l00285"></a>00285     hawki_step_stats_frameset_stats(target_stats, stats_stats, frames);
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="comment">/* Saving the table product */</span>
-<a name="l00288"></a>00288     <span class="keywordflow">if</span>(hawki_step_stats_save
-<a name="l00289"></a>00289         (target_stats, parlist, framelist, frames, stats_stats, calpro, protype) !=0)
-<a name="l00290"></a>00290         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00291"></a>00291                         <span class="stringliteral">"Check permisions or disk space\n"</span>);
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293     <span class="comment">/* Free and return */</span>
-<a name="l00294"></a>00294     cpl_frameset_delete(frames);
-<a name="l00295"></a>00295     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00296"></a>00296     {
-<a name="l00297"></a>00297         cpl_table_delete(target_stats[idet]);
-<a name="l00298"></a>00298         cpl_propertylist_delete(stats_stats[idet]);
-<a name="l00299"></a>00299     }
-<a name="l00300"></a>00300     cpl_free(target_stats); 
-<a name="l00301"></a>00301     cpl_free(stats_stats); 
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     <span class="comment">/* Return */</span>
-<a name="l00304"></a>00304     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00305"></a>00305     {
-<a name="l00306"></a>00306         cpl_msg_error(__func__,
-<a name="l00307"></a>00307                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00308"></a>00308         <span class="keywordflow">return</span> -1 ;
-<a name="l00309"></a>00309     }
-<a name="l00310"></a>00310     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00311"></a>00311 }
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00323"></a>00323 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00324"></a>00324 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_frameset_stats
-<a name="l00325"></a>00325 (cpl_table        ** target_stats,
-<a name="l00326"></a>00326  cpl_propertylist ** stats_stats,
-<a name="l00327"></a>00327  cpl_frameset     *  target_frames)
-<a name="l00328"></a>00328 {
-<a name="l00329"></a>00329     <span class="keywordtype">int</span> iframe;
-<a name="l00330"></a>00330     <span class="keywordtype">int</span> nframes;
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="comment">/* Loop on the number of frames */</span>
-<a name="l00333"></a>00333     nframes = cpl_frameset_get_size(target_frames);
-<a name="l00334"></a>00334     cpl_msg_info(__func__, <span class="stringliteral">"Looping the target frames: %d frames"</span>, nframes);
-<a name="l00335"></a>00335     cpl_msg_indent_more();
-<a name="l00336"></a>00336     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l00337"></a>00337     {
-<a name="l00338"></a>00338         <span class="comment">/* Local storage variables */</span>
-<a name="l00339"></a>00339         cpl_frame     * this_target_frame;
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341         <span class="comment">/* Computing statistics for this frame */</span>
-<a name="l00342"></a>00342         cpl_msg_info(__func__, <span class="stringliteral">"Computing stats for frame: %d"</span>, iframe +1);
-<a name="l00343"></a>00343         this_target_frame = cpl_frameset_get_frame(target_frames, iframe);
-<a name="l00344"></a>00344         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a>
-<a name="l00345"></a>00345             (target_stats, this_target_frame, iframe);
-<a name="l00346"></a>00346     }
-<a name="l00347"></a>00347     cpl_msg_indent_less();
-<a name="l00348"></a>00348     
-<a name="l00349"></a>00349     <span class="comment">/* Compute stats of the stats */</span>
-<a name="l00350"></a>00350     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(target_stats, stats_stats);
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     <span class="comment">/* Print info about the statistics */</span>
-<a name="l00353"></a>00353     hawki_image_stats_print(target_stats);
-<a name="l00354"></a>00354     
-<a name="l00355"></a>00355     <span class="keywordflow">return</span> 0;
-<a name="l00356"></a>00356 }
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00368"></a>00368 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00369"></a>00369 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_save
-<a name="l00370"></a>00370 (cpl_table         ** target_stats,
-<a name="l00371"></a>00371  cpl_parameterlist *  recipe_parlist,
-<a name="l00372"></a>00372  cpl_frameset      *  recipe_frameset,
-<a name="l00373"></a>00373  cpl_frameset      *  used_frameset,
-<a name="l00374"></a>00374  cpl_propertylist  ** stats_stats,
-<a name="l00375"></a>00375  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,
-<a name="l00376"></a>00376  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype)
-<a name="l00377"></a>00377 {
-<a name="l00378"></a>00378     <span class="keyword">const</span> cpl_frame  *  reference_frame;
-<a name="l00379"></a>00379     cpl_propertylist *  referencelist;
-<a name="l00380"></a>00380     cpl_propertylist ** extlists;
-<a name="l00381"></a>00381     <span class="keywordtype">int</span>                 idet;
-<a name="l00382"></a>00382     <span class="keywordtype">int</span>                 ext_nb;
-<a name="l00383"></a>00383     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_step_stats"</span>;
-<a name="l00384"></a>00384     cpl_errorstate      error_prevstate = cpl_errorstate_get();
-<a name="l00385"></a>00385     
-<a name="l00386"></a>00386     
-<a name="l00387"></a>00387     <span class="comment">/* Get the reference frame (the first one) */</span>
-<a name="l00388"></a>00388     reference_frame = cpl_frameset_get_first_const(used_frameset);
-<a name="l00389"></a>00389     
-<a name="l00390"></a>00390     <span class="comment">/* Create the prop lists */</span>
-<a name="l00391"></a>00391     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;
-<a name="l00392"></a>00392     referencelist = cpl_propertylist_load_regexp
-<a name="l00393"></a>00393         (cpl_frame_get_filename(reference_frame), 0,HAWKI_HEADER_EXT_FORWARD,0);
-<a name="l00394"></a>00394     extlists = 
-<a name="l00395"></a>00395         cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l00396"></a>00396     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00397"></a>00397     {
-<a name="l00398"></a>00398         <span class="comment">/* Get the extension number */</span>
-<a name="l00399"></a>00399         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00400"></a>00400             (cpl_frame_get_filename(reference_frame), idet+1);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402         <span class="comment">/* Propagate the keywords from input frame extensions */</span>
-<a name="l00403"></a>00403         extlists[idet] = cpl_propertylist_load_regexp(
-<a name="l00404"></a>00404                 cpl_frame_get_filename(reference_frame), ext_nb,
-<a name="l00405"></a>00405                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00406"></a>00406         
-<a name="l00407"></a>00407         <span class="comment">/* Add the stats of the stats */</span>
-<a name="l00408"></a>00408         cpl_propertylist_append(extlists[idet],stats_stats[idet]);
-<a name="l00409"></a>00409     }
-<a name="l00410"></a>00410     
-<a name="l00411"></a>00411     <span class="comment">/* Write the table with the statistics */</span>
-<a name="l00412"></a>00412     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset,
-<a name="l00413"></a>00413                       recipe_parlist,
-<a name="l00414"></a>00414                       used_frameset,
-<a name="l00415"></a>00415                       (<span class="keyword">const</span> cpl_table **)target_stats,
-<a name="l00416"></a>00416                       recipe_name,
-<a name="l00417"></a>00417                       calpro,
-<a name="l00418"></a>00418                       protype,
-<a name="l00419"></a>00419                       (<span class="keyword">const</span> cpl_propertylist*)referencelist, 
-<a name="l00420"></a>00420                       (<span class="keyword">const</span> cpl_propertylist**)extlists, 
-<a name="l00421"></a>00421                       <span class="stringliteral">"hawki_step_stats.fits"</span>);
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="comment">/* Free and return */</span>
-<a name="l00424"></a>00424     cpl_propertylist_delete(referencelist) ;
-<a name="l00425"></a>00425     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00426"></a>00426     {
-<a name="l00427"></a>00427         cpl_propertylist_delete(extlists[idet]) ;
-<a name="l00428"></a>00428     }
-<a name="l00429"></a>00429     cpl_free(extlists) ;
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00432"></a>00432     {
-<a name="l00433"></a>00433         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00434"></a>00434         <span class="keywordflow">return</span> -1;
-<a name="l00435"></a>00435     }
-<a name="l00436"></a>00436     <span class="keywordflow">return</span>  0;
-<a name="l00437"></a>00437 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_stats.c,v 1.13 2012/11/30 14:51:22 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/11/30 14:51:22 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_image_stats.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_utils.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> </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> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats(cpl_parameterlist *, cpl_frameset *) ;</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">int</span> hawki_step_stats_frameset_stats</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> (cpl_table        ** target_stats,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  cpl_propertylist ** stats_stats,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  cpl_frameset     *  target_frames);</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">int</span> hawki_step_stats_save</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> (cpl_table         ** target_stats,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_frameset      *  recipe_frameset,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>  cpl_propertylist  ** stats_stats,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="comment">                            Static variables</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="comment"> -----------------------------------------------------------------------------*/</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">static</span> <span class="keywordtype">char</span> hawki_step_stats_description[] =</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"hawki_step_stats -- hawki statistics utility (mean, stdev, ...).\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"raw-jitter.fits "</span>HAWKI_IMG_JITTER_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"bkg.fits "</span>HAWKI_CALPRO_BKGIMAGE<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"raw-flat.fits "</span>HAWKI_CAL_FLAT_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"raw-dark.fits "</span>HAWKI_CAL_DARK_RAW<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"raw-zpoint.fits "</span>HAWKI_CAL_ZPOINT_RAW<span class="stringliteral">" \n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_JITTER_STATS<span class="stringliteral">"): Statistics of raw jitter images, or\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_JITTER_BKG_STATS<span class="stringliteral">"): Statistics of background images, or\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_FLAT_STATS<span class="stringliteral">"): Statistics of raw flats, or\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_DARK_STATS<span class="stringliteral">"): Statistics of raw darks, or\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"hawki_step_stats.fits ("</span>HAWKI_CALPRO_ZPOINT_STATS<span class="stringliteral">"): Statistics of raw standard star images.\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"or 1 otherwise"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment">                                Functions code</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="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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     <span class="stringliteral">"hawki_step_stats"</span>,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     <span class="stringliteral">"Standard statistics utility"</span>,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     hawki_step_stats_description,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     hawki_step_stats_create,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     hawki_step_stats_exec,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     hawki_step_stats_destroy) ;</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_pluginlist_append(list, plugin) ;</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">return</span> 0;</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="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">int</span> hawki_step_stats_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">/* cpl_parameter   * p ; */</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">/* Get the recipe out of the plugin */</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> <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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>         <span class="keywordflow">return</span> 1;</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="comment">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/* None.. */</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_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="comment">/* Get the recipe out of the plugin */</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> <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="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_stats(recipe->parameters, recipe->frames) ;</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="l00196"></a><span class="lineno">  196</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats(</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         cpl_frameset        *   framelist)</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_frameset     *  frames ;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_table        ** target_stats;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_propertylist ** stats_stats;  </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordtype">char</span>                calpro[1024];</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="keywordtype">char</span>                protype[1024];</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) </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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_IMG_JITTER_RAW) ;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     snprintf(calpro, 1024, HAWKI_CALPRO_JITTER_STATS);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     snprintf(protype, 1024, HAWKI_PROTYPE_JITTER_STATS);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">if</span> (frames == NULL)</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>         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CALPRO_BKGIMAGE);</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>         snprintf(calpro, 1024, HAWKI_CALPRO_JITTER_BKG_STATS);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         snprintf(protype, 1024, HAWKI_PROTYPE_JITTER_BKG_STATS);</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="keywordflow">if</span> (frames == 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>         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_DARK_RAW);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         snprintf(calpro, 1024, HAWKI_CALPRO_DARK_STATS);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         snprintf(protype, 1024, HAWKI_PROTYPE_DARK_STATS);</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">if</span> (frames == NULL)</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>         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_FLAT_RAW);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         snprintf(calpro, 1024, HAWKI_CALPRO_FLAT_STATS);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>         snprintf(protype, 1024, HAWKI_PROTYPE_FLAT_STATS);</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> (frames == 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>         frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_CAL_ZPOINT_RAW);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         snprintf(calpro, 1024, HAWKI_CALPRO_ZPOINT_STATS);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         snprintf(protype, 1024, HAWKI_PROTYPE_ZPOINT_STATS);</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">if</span> (frames == NULL)</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_error(__func__,<span class="stringliteral">"Tag of input frames not supported"</span>);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>         cpl_msg_error(__func__,<span class="stringliteral">"Supported: %s %s %s %s %s"</span>,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                 HAWKI_IMG_JITTER_RAW, HAWKI_CALPRO_BKGIMAGE,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                 HAWKI_CAL_DARK_RAW, HAWKI_CAL_FLAT_RAW, HAWKI_CAL_ZPOINT_RAW);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Create the statistics table and the "stats of the stats"*/</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     target_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     stats_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         target_stats[idet] = cpl_table_new(cpl_frameset_get_size(frames));</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         stats_stats[idet] = cpl_propertylist_new();</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__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(target_stats);</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">/* Compute actually the statistics */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     hawki_step_stats_frameset_stats(target_stats, stats_stats, 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>     <span class="comment">/* Saving the table product */</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">if</span>(hawki_step_stats_save</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         (target_stats, parlist, framelist, frames, stats_stats, calpro, protype) !=0)</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                         <span class="stringliteral">"Check permisions or disk space\n"</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_frameset_delete(frames);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_table_delete(target_stats[idet]);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         cpl_propertylist_delete(stats_stats[idet]);</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>     cpl_free(target_stats); </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_free(stats_stats); </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">/* Return */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         <span class="keywordflow">return</span> -1 ;</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">else</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_frameset_stats</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> (cpl_table        ** target_stats,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>  cpl_propertylist ** stats_stats,</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>  cpl_frameset     *  target_frames)</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="keywordtype">int</span> iframe;</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> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="comment">/* Loop on the number of frames */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     nframes = cpl_frameset_get_size(target_frames);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_msg_info(__func__, <span class="stringliteral">"Looping the target frames: %d frames"</span>, nframes);</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>     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)</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">/* Local storage variables */</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         cpl_frame     * this_target_frame;</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">/* Computing statistics for this frame */</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         cpl_msg_info(__func__, <span class="stringliteral">"Computing stats for frame: %d"</span>, iframe +1);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         this_target_frame = cpl_frameset_get_frame(target_frames, iframe);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>             (target_stats, this_target_frame, iframe);</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_indent_less();</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">/* Compute stats of the stats */</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(target_stats, stats_stats);</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">/* Print info about the statistics */</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     hawki_image_stats_print(target_stats);</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">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stats_save</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> (cpl_table         ** target_stats,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>  cpl_frameset      *  recipe_frameset,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>  cpl_propertylist  ** stats_stats,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype)</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="keyword">const</span> cpl_frame  *  reference_frame;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     cpl_propertylist *  referencelist;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     cpl_propertylist ** extlists;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordtype">int</span>                 ext_nb;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_step_stats"</span>;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_errorstate      error_prevstate = cpl_errorstate_get();</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">/* Get the reference frame (the first one) */</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     reference_frame = cpl_frameset_get_first_const(used_frameset);</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">/* Create the prop lists */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     referencelist = cpl_propertylist_load_regexp</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         (cpl_frame_get_filename(reference_frame), 0,HAWKI_HEADER_EXT_FORWARD,0);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     extlists = </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>             (cpl_frame_get_filename(reference_frame), idet+1);</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">/* Propagate the keywords from input frame extensions */</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         extlists[idet] = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                 cpl_frame_get_filename(reference_frame), ext_nb,</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</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">/* Add the stats of the stats */</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         cpl_propertylist_append(extlists[idet],stats_stats[idet]);</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">/* Write the table with the statistics */</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                       recipe_parlist,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                       used_frameset,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                       (<span class="keyword">const</span> cpl_table **)target_stats,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                       recipe_name,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                       calpro,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                       protype,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                       (<span class="keyword">const</span> cpl_propertylist*)referencelist, </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                       (<span class="keyword">const</span> cpl_propertylist**)extlists, </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                       <span class="stringliteral">"hawki_step_stats.fits"</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_propertylist_delete(referencelist) ;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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>         cpl_propertylist_delete(extlists[idet]) ;</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>     cpl_free(extlists) ;</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>(!cpl_errorstate_is_equal(error_prevstate))</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_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         <span class="keywordflow">return</span> -1;</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>  0;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</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/hawki__step__stitch_8c_source.html b/html/hawki__step__stitch_8c_source.html
index f36bd9d..ec242cd 100644
--- a/html/hawki__step__stitch_8c_source.html
+++ b/html/hawki__step__stitch_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_stitch.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,334 +40,340 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_stitch.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_stitch.c,v 1.7 2011/10/24 10:41: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 10:41:54 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00047"></a>00047 <span class="comment">                            Functions prototypes</span>
-<a name="l00048"></a>00048 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_create(cpl_plugin *) ;
-<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_exec(cpl_plugin *) ;
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_destroy(cpl_plugin *) ;
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_save
-<a name="l00055"></a>00055 (cpl_image           *   in,
-<a name="l00056"></a>00056  cpl_frame           *   combined,
-<a name="l00057"></a>00057  cpl_parameterlist   *   parlist,
-<a name="l00058"></a>00058  cpl_frameset        *   <span class="keyword">set</span>);
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00061"></a>00061 <span class="comment">                            Static variables</span>
-<a name="l00062"></a>00062 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_stitch_description[] =
-<a name="l00065"></a>00065 <span class="stringliteral">"hawki_step_stitch -- Stitching utility\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"This recipe accepts 1 parameter:\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"First parameter:   the HAWKI image to stitch "</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">")\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"This recipe produces 1 file:\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"First product:     the stitch image.\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_STITCHED<span class="stringliteral">")\n"</span> ;
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00075"></a>00075 <span class="comment">                                Functions code</span>
-<a name="l00076"></a>00076 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00087"></a>00087 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00096"></a>00096                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00097"></a>00097                     <span class="stringliteral">"hawki_step_stitch"</span>,
-<a name="l00098"></a>00098                     <span class="stringliteral">"Stitching utility"</span>,
-<a name="l00099"></a>00099                     hawki_step_stitch_description,
-<a name="l00100"></a>00100                     <span class="stringliteral">"Cesar Enrique Garcia"</span>,
-<a name="l00101"></a>00101                     PACKAGE_BUGREPORT,  
-<a name="l00102"></a>00102                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00103"></a>00103                     hawki_step_stitch_create,
-<a name="l00104"></a>00104                     hawki_step_stitch_exec,
-<a name="l00105"></a>00105                     hawki_step_stitch_destroy) ;
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     cpl_pluginlist_append(list, plugin) ;
-<a name="l00108"></a>00108     
-<a name="l00109"></a>00109     <span class="keywordflow">return</span> 0;
-<a name="l00110"></a>00110 }
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00120"></a>00120 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00121"></a>00121 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_create(cpl_plugin * plugin)
-<a name="l00122"></a>00122 {
-<a name="l00123"></a>00123     cpl_recipe      *   recipe ;
-<a name="l00124"></a>00124         
-<a name="l00125"></a>00125     <span class="comment">/* Check that the plugin is part of a valid recipe */</span>
-<a name="l00126"></a>00126     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00127"></a>00127         recipe = (cpl_recipe *)plugin ;
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00131"></a>00131     recipe->parameters = cpl_parameterlist_new() ; 
-<a name="l00132"></a>00132     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00133"></a>00133         <span class="keywordflow">return</span> 1;
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="comment">/* Return */</span>
-<a name="l00136"></a>00136     <span class="keywordflow">return</span> 0;
-<a name="l00137"></a>00137 }
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139 <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">int</span> hawki_step_stitch_exec(cpl_plugin * plugin)
-<a name="l00147"></a>00147 {
-<a name="l00148"></a>00148     cpl_recipe  *   recipe ;
-<a name="l00149"></a>00149     
-<a name="l00150"></a>00150     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* Issue a banner */</span>
-<a name="l00156"></a>00156     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00157"></a>00157 
-<a name="l00158"></a>00158     <span class="keywordflow">return</span> hawki_step_stitch(recipe->parameters, recipe->frames) ;
-<a name="l00159"></a>00159 }
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00167"></a>00167 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00168"></a>00168 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_destroy(cpl_plugin * plugin)
-<a name="l00169"></a>00169 {
-<a name="l00170"></a>00170     cpl_recipe  *   recipe ;
-<a name="l00171"></a>00171     
-<a name="l00172"></a>00172     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     cpl_parameterlist_delete(recipe->parameters) ; 
-<a name="l00178"></a>00178     <span class="keywordflow">return</span> 0 ;
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00188"></a>00188 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00189"></a>00189 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch(
-<a name="l00190"></a>00190         cpl_parameterlist   *   parlist,
-<a name="l00191"></a>00191         cpl_frameset        *   frameset)
-<a name="l00192"></a>00192 {
-<a name="l00193"></a>00193     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   comb_filename ;
-<a name="l00194"></a>00194     cpl_frameset        *   combframes;
-<a name="l00195"></a>00195     cpl_frame           *   combframe;
-<a name="l00196"></a>00196     cpl_propertylist    *   plist ;
-<a name="l00197"></a>00197     cpl_image           *   stitched ;
-<a name="l00198"></a>00198     cpl_image           *   in[HAWKI_NB_DETECTORS] ;
-<a name="l00199"></a>00199     <span class="keywordtype">double</span>                  posx[HAWKI_NB_DETECTORS] ;
-<a name="l00200"></a>00200     <span class="keywordtype">double</span>                  posy[HAWKI_NB_DETECTORS] ;
-<a name="l00201"></a>00201     <span class="keywordtype">int</span>                     i, j ;
-<a name="l00202"></a>00202     cpl_errorstate          error_prevstate;
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     <span class="comment">/* Retrieve input parameters */</span>
-<a name="l00206"></a>00206  
-<a name="l00207"></a>00207     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00208"></a>00208     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {
-<a name="l00209"></a>00209         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00210"></a>00210         <span class="keywordflow">return</span> -1 ;
-<a name="l00211"></a>00211     }
-<a name="l00212"></a>00212     
-<a name="l00213"></a>00213     <span class="comment">/* Identifying the combined frame */</span>
-<a name="l00214"></a>00214     cpl_msg_info(__func__, <span class="stringliteral">"Identifying the combined frame"</span>);
-<a name="l00215"></a>00215     combframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00216"></a>00216         (frameset, HAWKI_CALPRO_COMBINED);
-<a name="l00217"></a>00217     <span class="keywordflow">if</span> (combframes == NULL)
-<a name="l00218"></a>00218     {
-<a name="l00219"></a>00219         cpl_msg_error(__func__, <span class="stringliteral">"No combined images found (%s)"</span>,
-<a name="l00220"></a>00220                 HAWKI_CALPRO_COMBINED);
-<a name="l00221"></a>00221         cpl_frameset_delete(combframes);
-<a name="l00222"></a>00222         <span class="keywordflow">return</span> -1 ;
-<a name="l00223"></a>00223     }
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     <span class="comment">/* Check that we have 1 files in input */</span>
-<a name="l00226"></a>00226     <span class="keywordflow">if</span> (cpl_frameset_get_size(combframes) != 1) {
-<a name="l00227"></a>00227         cpl_msg_error(__func__, <span class="stringliteral">"Expects one single combined images"</span>) ;
-<a name="l00228"></a>00228         cpl_frameset_delete(combframes);
-<a name="l00229"></a>00229         <span class="keywordflow">return</span> -1 ;
-<a name="l00230"></a>00230     }
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232     <span class="comment">/* Load the HAWKI images */</span>
-<a name="l00233"></a>00233     cpl_msg_info(__func__,<span class="stringliteral">"Loading combined frame"</span>);
-<a name="l00234"></a>00234     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00235"></a>00235         <span class="keywordflow">if</span> ((in[i] = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(combframes, 0, i+1, 
-<a name="l00236"></a>00236                         CPL_TYPE_FLOAT)) == NULL) {
-<a name="l00237"></a>00237             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip nb %d"</span>, i+1) ;
-<a name="l00238"></a>00238             <span class="keywordflow">for</span> (j=0 ; j<i ; i++) cpl_image_delete(in[j]) ;
-<a name="l00239"></a>00239             cpl_frameset_delete(combframes);
-<a name="l00240"></a>00240             <span class="keywordflow">return</span> -1 ;
-<a name="l00241"></a>00241         }
-<a name="l00242"></a>00242     }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="comment">/* Get the first input frame */</span>
-<a name="l00245"></a>00245     combframe     = cpl_frameset_get_first(combframes);
-<a name="l00246"></a>00246     comb_filename = cpl_frame_get_filename(combframe);
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     <span class="comment">/* Get the POSX / POSY informations */</span>
-<a name="l00249"></a>00249     error_prevstate = cpl_errorstate_get();
-<a name="l00250"></a>00250     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00251"></a>00251         plist = cpl_propertylist_load_regexp(comb_filename, i+1, <span class="stringliteral">"QC"</span>, 0) ;
-<a name="l00252"></a>00252         posx[i] = <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(plist); 
-<a name="l00253"></a>00253         posy[i] = <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(plist);
-<a name="l00254"></a>00254         cpl_propertylist_delete(plist) ;
-<a name="l00255"></a>00255         <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00256"></a>00256         {
-<a name="l00257"></a>00257             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get POS infos for chip %d"</span>, i+1) ;
-<a name="l00258"></a>00258             <span class="keywordflow">return</span> -1 ;
-<a name="l00259"></a>00259         }
-<a name="l00260"></a>00260     }
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     <span class="comment">/* Compute the stitched image */</span>
-<a name="l00263"></a>00263     cpl_msg_info(__func__, <span class="stringliteral">"Computing the stiched image"</span>) ;
-<a name="l00264"></a>00264     <span class="keywordflow">if</span> ((stitched = <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>(in, posx, posy)) == NULL) {
-<a name="l00265"></a>00265         cpl_msg_error(__func__, <span class="stringliteral">"Cannot stitch the images"</span>) ;
-<a name="l00266"></a>00266         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(in[i]) ;
-<a name="l00267"></a>00267         <span class="keywordflow">return</span> -1 ;
-<a name="l00268"></a>00268     }
-<a name="l00269"></a>00269     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(in[i]) ;
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     <span class="comment">/* Save the corrected image */</span>
-<a name="l00272"></a>00272     <span class="keywordflow">if</span> (hawki_step_stitch_save(stitched, combframe, parlist, frameset) == -1) 
-<a name="l00273"></a>00273         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00274"></a>00274                                  <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276     <span class="comment">/* Free and Return */</span>
-<a name="l00277"></a>00277     cpl_frameset_delete(combframes);
-<a name="l00278"></a>00278     cpl_image_delete(stitched);
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     <span class="comment">/* Return */</span>
-<a name="l00281"></a>00281     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00282"></a>00282     {
-<a name="l00283"></a>00283         cpl_msg_error(__func__,
-<a name="l00284"></a>00284                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</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">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00288"></a>00288 }
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00298"></a>00298 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00299"></a>00299 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_save
-<a name="l00300"></a>00300 (cpl_image           *   in,
-<a name="l00301"></a>00301  cpl_frame           *   combined,
-<a name="l00302"></a>00302  cpl_parameterlist   *   parlist,
-<a name="l00303"></a>00303  cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l00304"></a>00304 {
-<a name="l00305"></a>00305     cpl_propertylist    *   plist;
-<a name="l00306"></a>00306     cpl_propertylist    *   wcslist;
-<a name="l00307"></a>00307     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_stitch"</span> ;
-<a name="l00308"></a>00308     <span class="keywordtype">int</span>                     ext_chip_1;
-<a name="l00309"></a>00309     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     cpl_msg_indent_more();
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     <span class="comment">/* Create a propertylist for PRO.x */</span>
-<a name="l00314"></a>00314     plist = cpl_propertylist_new();
-<a name="l00315"></a>00315     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,
-<a name="l00316"></a>00316                                    HAWKI_PROTYPE_STITCHED) ;
-<a name="l00317"></a>00317     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,
-<a name="l00318"></a>00318                                    HAWKI_CALPRO_STITCHED) ;
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     <span class="comment">/* Handle WCS keys */</span>
-<a name="l00321"></a>00321     ext_chip_1 = 1;
-<a name="l00322"></a>00322     wcslist = cpl_propertylist_load_regexp(
-<a name="l00323"></a>00323             cpl_frame_get_filename(combined), ext_chip_1, HAWKI_HEADER_WCS, 0);
-<a name="l00324"></a>00324     cpl_propertylist_append(plist, wcslist);
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326     <span class="comment">/* Save the image */</span>
-<a name="l00327"></a>00327     <span class="keywordflow">if</span>(cpl_dfs_save_image(<span class="keyword">set</span>,
-<a name="l00328"></a>00328                           NULL,
-<a name="l00329"></a>00329                           parlist,
-<a name="l00330"></a>00330                           <span class="keyword">set</span>,
-<a name="l00331"></a>00331                           NULL,
-<a name="l00332"></a>00332                           in,
-<a name="l00333"></a>00333                           CPL_BPP_IEEE_FLOAT,
-<a name="l00334"></a>00334                           recipe_name,
-<a name="l00335"></a>00335                           plist,
-<a name="l00336"></a>00336                           NULL,
-<a name="l00337"></a>00337                           PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00338"></a>00338                           <span class="stringliteral">"hawki_step_stitch.fits"</span>) != CPL_ERROR_NONE)
-<a name="l00339"></a>00339         cpl_msg_error(__func__,<span class="stringliteral">"Could not save stitched image"</span>);
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     cpl_propertylist_delete(plist) ;
-<a name="l00342"></a>00342     cpl_propertylist_delete(wcslist) ;
-<a name="l00343"></a>00343     cpl_msg_indent_less();
-<a name="l00344"></a>00344     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00345"></a>00345     {
-<a name="l00346"></a>00346         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00347"></a>00347         <span class="keywordflow">return</span> -1;
-<a name="l00348"></a>00348     }
-<a name="l00349"></a>00349     <span class="keywordflow">return</span>  0;
-<a name="l00350"></a>00350 }
-<a name="l00351"></a>00351 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_stitch.c,v 1.8 2013/03/11 11:01: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/03/11 11:01: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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_load.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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">                            Functions prototypes</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">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">int</span> hawki_step_stitch_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch(cpl_parameterlist *, cpl_frameset *) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_save</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> (cpl_image           *   in,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>  cpl_frame           *   combined,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>  cpl_frameset        *   <span class="keyword">set</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">                            Static variables</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="keyword">static</span> <span class="keywordtype">char</span> hawki_step_stitch_description[] =</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"hawki_step_stitch -- Stitching utility\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"This recipe accepts 1 parameter:\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"First parameter:   the HAWKI image to stitch "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_COMBINED<span class="stringliteral">")\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"This recipe produces 1 file:\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"First product:     the stitch image.\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"                   (PRO CATG = "</span>HAWKI_CALPRO_STITCHED<span class="stringliteral">")\n"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>                     HAWKI_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">"hawki_step_stitch"</span>,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     <span class="stringliteral">"Stitching utility"</span>,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     hawki_step_stitch_description,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     <span class="stringliteral">"Cesar Enrique Garcia"</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>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     hawki_step_stitch_create,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     hawki_step_stitch_exec,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     hawki_step_stitch_destroy) ;</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>     cpl_pluginlist_append(list, plugin) ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_create(cpl_plugin * 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>     cpl_recipe      *   recipe ;</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">/* Check that the plugin is part of a valid recipe */</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</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>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         <span class="keywordflow">return</span> 1;</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="comment">/* Return */</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">return</span> 0;</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="l00144"></a><span class="lineno">  144</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_exec(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>     </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordflow">else</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</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>     <span class="keywordflow">return</span> hawki_step_stitch(recipe->parameters, recipe->frames) ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_destroy(cpl_plugin * plugin)</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>     cpl_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ; </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordflow">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch(</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         cpl_frameset        *   frameset)</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="keyword">const</span> <span class="keywordtype">char</span>          *   comb_filename ;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     cpl_frameset        *   combframes;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     cpl_frame           *   combframe;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_image           *   stitched ;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cpl_image           *   in[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="keywordtype">double</span>                  posx[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="keywordtype">double</span>                  posy[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordtype">int</span>                     i, j ;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_errorstate          error_prevstate;</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">/* Retrieve input parameters */</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>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(frameset)) {</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</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>     <span class="comment">/* Identifying the combined frame */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying the combined frame"</span>);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     combframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         (frameset, HAWKI_CALPRO_COMBINED);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">if</span> (combframes == NULL)</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_msg_error(__func__, <span class="stringliteral">"No combined images found (%s)"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                 HAWKI_CALPRO_COMBINED);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         <span class="keywordflow">return</span> -1 ;</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">/* Check that we have 1 files in input */</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="keywordflow">if</span> (cpl_frameset_get_size(combframes) != 1) {</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>         cpl_msg_error(__func__, <span class="stringliteral">"Expects one single combined images"</span>) ;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         <span class="keywordflow">return</span> -1 ;</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">/* Load the HAWKI images */</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_msg_info(__func__,<span class="stringliteral">"Loading combined frame"</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         <span class="keywordflow">if</span> ((in[i] = <a class="code" href="group__hawki__load.html#ga5b9129188e69306c15cec2d4568ddeed" title="Load the chip of HAWKI image from a frameset in an image.">hawki_load_image</a>(combframes, 0, i+1, </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                         CPL_TYPE_FLOAT)) == NULL) {</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot load chip nb %d"</span>, i+1) ;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>             <span class="keywordflow">for</span> (j=0 ; j<i ; i++) cpl_image_delete(in[j]) ;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>             cpl_frameset_delete(combframes);</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>     }</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">/* Get the first input frame */</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     combframe     = cpl_frameset_get_first(combframes);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     comb_filename = cpl_frame_get_filename(combframe);</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">/* Get the POSX / POSY informations */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     error_prevstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         plist = cpl_propertylist_load_regexp(comb_filename, i+1, <span class="stringliteral">"QC"</span>, 0) ;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>         posx[i] = <a class="code" href="group__hawki__pfits.html#ga88f1a9b44888686b6489fba06921f5a1" title="find out the relative X offset of the combined image wrt first image">hawki_pfits_get_comb_posx</a>(plist); </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         posy[i] = <a class="code" href="group__hawki__pfits.html#ga5408b902329bdad15fd408d73fa6376e" title="find out the relative Y offset of the combined image wrt first image">hawki_pfits_get_comb_posy</a>(plist);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>         cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_error(__func__, <span class="stringliteral">"Cannot get POS infos for chip %d"</span>, i+1) ;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             <span class="keywordflow">return</span> -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>     <span class="comment">/* Compute the stitched image */</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_msg_info(__func__, <span class="stringliteral">"Computing the stiched image"</span>) ;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">if</span> ((stitched = <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>(in, posx, posy)) == NULL) {</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot stitch the images"</span>) ;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(in[i]) ;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         <span class="keywordflow">return</span> -1 ;</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="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) cpl_image_delete(in[i]) ;</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="comment">/* Save the corrected image */</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">if</span> (hawki_step_stitch_save(stitched, combframe, parlist, frameset) == -1) </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>         cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                  <span class="stringliteral">"Check permisions or disk space"</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">/* Free and Return */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_frameset_delete(combframes);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_image_delete(stitched);</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">/* Return */</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</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">else</span> <span class="keywordflow">return</span> 0 ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_stitch_save</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> (cpl_image           *   in,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>  cpl_frame           *   combined,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>  cpl_frameset        *   <span class="keyword">set</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_propertylist    *   plist;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_propertylist    *   wcslist;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_stitch"</span> ;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">int</span>                     ext_chip_1;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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_msg_indent_more();</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">/* Create a propertylist for PRO.x */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     plist = cpl_propertylist_new();</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                                    HAWKI_PROTYPE_STITCHED) ;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                    HAWKI_CALPRO_STITCHED) ;</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">/* Handle WCS keys */</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     ext_chip_1 = 1;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     wcslist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>             cpl_frame_get_filename(combined), ext_chip_1, HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     cpl_propertylist_append(plist, wcslist);</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">/* Save the image */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordflow">if</span>(cpl_dfs_save_image(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                           NULL,</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>                           parlist,</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                           <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                           NULL,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                           in,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                           CPL_BPP_IEEE_FLOAT,</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                           recipe_name,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                           plist,</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                           NULL,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                           PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                           <span class="stringliteral">"hawki_step_stitch.fits"</span>) != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         cpl_msg_error(__func__,<span class="stringliteral">"Could not save stitched image"</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>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_propertylist_delete(wcslist) ;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         <span class="keywordflow">return</span> -1;</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">return</span>  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><!-- 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/hawki__step__subtract__bkg_8c_source.html b/html/hawki__step__subtract__bkg_8c_source.html
index bab08b7..22597b6 100644
--- a/html/hawki__step__subtract__bkg_8c_source.html
+++ b/html/hawki__step__subtract__bkg_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_step_subtract_bkg.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,504 +40,505 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_step_subtract_bkg.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_step_subtract_bkg.c,v 1.18 2012/11/30 14:50: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2008 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/30 14:50:51 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.18 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                                Structs</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00053"></a>00053 <span class="comment">                            Functions prototypes</span>
-<a name="l00054"></a>00054 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_create(cpl_plugin *) ;
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_exec(cpl_plugin *) ;
-<a name="l00063"></a>00063 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_destroy(cpl_plugin *) ;
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_one_save
-<a name="l00067"></a>00067 (cpl_frameset        *  objframes,
-<a name="l00068"></a>00068  cpl_frameset        *  bkgframes,
-<a name="l00069"></a>00069  cpl_parameterlist   *  parlist,
-<a name="l00070"></a>00070  cpl_frameset        *  recipe_framelist);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_all_save
-<a name="l00073"></a>00073 (cpl_frameset        *  objframes,
-<a name="l00074"></a>00074  cpl_frameset        *  bkgframes,
-<a name="l00075"></a>00075  cpl_parameterlist   *  recipe_parlist,
-<a name="l00076"></a>00076  cpl_frameset        *  recipe_framelist);
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_save
-<a name="l00079"></a>00079 (cpl_imagelist     *  obj_images,
-<a name="l00080"></a>00080  <span class="keywordtype">int</span>                  iserie,
-<a name="l00081"></a>00081  cpl_frameset      *  used_frameset,
-<a name="l00082"></a>00082  cpl_parameterlist *  recipe_parlist,
-<a name="l00083"></a>00083  cpl_frameset      *  recipe_framelist);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00086"></a>00086 <span class="comment">                            Static variables</span>
-<a name="l00087"></a>00087 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_subtract_bkg_description[] =
-<a name="l00090"></a>00090 <span class="stringliteral">"hawki_step_subtract_bkg -- hawki background subtraction utility.\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"This recipe will subtract the given background to the science images.\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"The background can be obtained from the sky or object images\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"using the hawki_util_compute_bkg utility.\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"There are two modes of operation:\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"One single background image that it is subtracted to all object images.\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"As many background images as objects. A one to one relationship is applied.\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"obj_basic_cal-file.fits "</span>HAWKI_CALPRO_BASICCALIBRATED<span class="stringliteral">" or\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"background-file.fits "</span>HAWKI_CALPRO_BKGIMAGE<span class="stringliteral">" \n"</span>;
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00102"></a>00102 <span class="comment">                                Functions code</span>
-<a name="l00103"></a>00103 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00113"></a>00113 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00114"></a>00114 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00115"></a>00115 {
-<a name="l00116"></a>00116     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00117"></a>00117     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     cpl_plugin_init(plugin,
-<a name="l00120"></a>00120                     CPL_PLUGIN_API,
-<a name="l00121"></a>00121                     HAWKI_BINARY_VERSION,
-<a name="l00122"></a>00122                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00123"></a>00123                     <span class="stringliteral">"hawki_step_subtract_bkg"</span>,
-<a name="l00124"></a>00124                     <span class="stringliteral">"Background subtraction utility"</span>,
-<a name="l00125"></a>00125                     hawki_step_subtract_bkg_description,
-<a name="l00126"></a>00126                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00127"></a>00127                     PACKAGE_BUGREPORT,  
-<a name="l00128"></a>00128                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00129"></a>00129                     hawki_step_subtract_bkg_create,
-<a name="l00130"></a>00130                     hawki_step_subtract_bkg_exec,
-<a name="l00131"></a>00131                     hawki_step_subtract_bkg_destroy) ;
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     cpl_pluginlist_append(list, plugin) ;
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="keywordflow">return</span> 0;
-<a name="l00136"></a>00136 }
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00147"></a>00147 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00148"></a>00148 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_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">//cpl_parameter   * p ;</span>
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00154"></a>00154     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00155"></a>00155         recipe = (cpl_recipe *)plugin ;
-<a name="l00156"></a>00156     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00157"></a>00157 
-<a name="l00158"></a>00158     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00159"></a>00159     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00160"></a>00160     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00161"></a>00161         <span class="keywordflow">return</span> 1;
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00164"></a>00164     <span class="comment">/* None.. */</span>
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00176"></a>00176 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00177"></a>00177 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_exec(cpl_plugin * plugin)
-<a name="l00178"></a>00178 {
-<a name="l00179"></a>00179     cpl_recipe  *   recipe ;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00182"></a>00182     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00183"></a>00183         recipe = (cpl_recipe *)plugin ;
-<a name="l00184"></a>00184     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186     <span class="comment">/* Issue a banner */</span>
-<a name="l00187"></a>00187     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="keywordflow">return</span> hawki_step_subtract_bkg(recipe->parameters, recipe->frames) ;
-<a name="l00190"></a>00190 }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00198"></a>00198 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00199"></a>00199 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_destroy(cpl_plugin * plugin)
-<a name="l00200"></a>00200 {
-<a name="l00201"></a>00201     cpl_recipe  *   recipe ;
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00204"></a>00204     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00205"></a>00205         recipe = (cpl_recipe *)plugin ;
-<a name="l00206"></a>00206     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00209"></a>00209     <span class="keywordflow">return</span> 0 ;
-<a name="l00210"></a>00210 }
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00219"></a>00219 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00220"></a>00220 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg(
-<a name="l00221"></a>00221         cpl_parameterlist   *   parlist,
-<a name="l00222"></a>00222         cpl_frameset        *   framelist)
-<a name="l00223"></a>00223 {
-<a name="l00224"></a>00224     <span class="keywordtype">int</span>                 nobj;
-<a name="l00225"></a>00225     <span class="keywordtype">int</span>                 nbkg;
-<a name="l00226"></a>00226     cpl_frameset    *   objframes;
-<a name="l00227"></a>00227     cpl_frameset    *   bkgframes;
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00231"></a>00231     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist))
-<a name="l00232"></a>00232     {
-<a name="l00233"></a>00233         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00234"></a>00234         <span class="keywordflow">return</span> -1 ;
-<a name="l00235"></a>00235     }
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     <span class="comment">/* Identifying objects and bkg data frames */</span>
-<a name="l00238"></a>00238     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects and background data"</span>);
-<a name="l00239"></a>00239     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00240"></a>00240         (framelist, HAWKI_CALPRO_BASICCALIBRATED);
-<a name="l00241"></a>00241     <span class="keywordflow">if</span> (objframes == NULL)
-<a name="l00242"></a>00242     {
-<a name="l00243"></a>00243         cpl_msg_error(__func__, <span class="stringliteral">"No object frames provided (%s)"</span>,
-<a name="l00244"></a>00244                 HAWKI_CALPRO_BASICCALIBRATED);
-<a name="l00245"></a>00245         <span class="keywordflow">return</span> -1 ;
-<a name="l00246"></a>00246     }
-<a name="l00247"></a>00247     <span class="comment">/* Retrieve bkg frames */</span>
-<a name="l00248"></a>00248     bkgframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00249"></a>00249         (framelist, HAWKI_CALPRO_BKGIMAGE);
-<a name="l00250"></a>00250     <span class="keywordflow">if</span> (bkgframes == NULL)
-<a name="l00251"></a>00251     {
-<a name="l00252"></a>00252         cpl_msg_error(__func__, <span class="stringliteral">"No background frames provided (%s)"</span>,
-<a name="l00253"></a>00253                 HAWKI_CALPRO_BKGIMAGE);
-<a name="l00254"></a>00254         cpl_frameset_delete(objframes);
-<a name="l00255"></a>00255         <span class="keywordflow">return</span> -1 ;
-<a name="l00256"></a>00256     }
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258     <span class="comment">/* Subtract the background */</span>
-<a name="l00259"></a>00259     nobj = cpl_frameset_get_size(objframes);
-<a name="l00260"></a>00260     nbkg = cpl_frameset_get_size(bkgframes);
-<a name="l00261"></a>00261     <span class="keywordflow">if</span>(nobj == nbkg)
-<a name="l00262"></a>00262         hawki_step_subtract_bkg_apply_one_to_one_save
-<a name="l00263"></a>00263             (objframes, bkgframes, parlist, framelist);
-<a name="l00264"></a>00264     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nbkg == 1)
-<a name="l00265"></a>00265         hawki_step_subtract_bkg_apply_one_to_all_save
-<a name="l00266"></a>00266             (objframes, bkgframes, parlist, framelist);
-<a name="l00267"></a>00267     <span class="keywordflow">else</span>
-<a name="l00268"></a>00268     {
-<a name="l00269"></a>00269         cpl_msg_error(__func__,<span class="stringliteral">"Incompatible number of science and background"</span>
-<a name="l00270"></a>00270                                <span class="stringliteral">" images."</span>);
-<a name="l00271"></a>00271         cpl_msg_error(__func__,<span class="stringliteral">"Supply only 1 bkg frame or as many as objects"</span>);
-<a name="l00272"></a>00272         cpl_frameset_delete(objframes);
-<a name="l00273"></a>00273         cpl_frameset_delete(bkgframes);
-<a name="l00274"></a>00274         <span class="keywordflow">return</span> -1;
-<a name="l00275"></a>00275     }
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* Free resources */</span>
-<a name="l00278"></a>00278     cpl_frameset_delete(objframes);
-<a name="l00279"></a>00279     cpl_frameset_delete(bkgframes);
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     <span class="comment">/* Return */</span>
-<a name="l00282"></a>00282     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00283"></a>00283     {
-<a name="l00284"></a>00284         cpl_msg_error(__func__,
-<a name="l00285"></a>00285                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00286"></a>00286         <span class="keywordflow">return</span> -1 ;
-<a name="l00287"></a>00287     }
-<a name="l00288"></a>00288     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00289"></a>00289 }
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00300"></a>00300 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00301"></a>00301 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_one_save
-<a name="l00302"></a>00302 (cpl_frameset        *  objframes,
-<a name="l00303"></a>00303  cpl_frameset        *  bkgframes,
-<a name="l00304"></a>00304  cpl_parameterlist   *  recipe_parlist,
-<a name="l00305"></a>00305  cpl_frameset        *  recipe_framelist)
-<a name="l00306"></a>00306 {
-<a name="l00307"></a>00307     <span class="keywordtype">int</span>          iobj;
-<a name="l00308"></a>00308     <span class="keywordtype">int</span>          nobjs;
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="comment">/* Subtract the background to each object frame */</span>
-<a name="l00311"></a>00311     cpl_msg_info(__func__,<span class="stringliteral">"Using a one to one relation btw objects and bkgs"</span>);
-<a name="l00312"></a>00312     nobjs = cpl_frameset_get_size(objframes);
-<a name="l00313"></a>00313     <span class="keywordflow">for</span>(iobj = 0; iobj < nobjs; ++iobj)
-<a name="l00314"></a>00314     {
-<a name="l00315"></a>00315         cpl_frame     * obj_frame = NULL;
-<a name="l00316"></a>00316         cpl_frame     * bkg_frame = NULL;
-<a name="l00317"></a>00317         cpl_imagelist * obj_images = NULL;
-<a name="l00318"></a>00318         cpl_imagelist * bkg_images = NULL;
-<a name="l00319"></a>00319         cpl_frameset  * used_frameset;
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321         <span class="comment">/* Allocate resources */</span>
-<a name="l00322"></a>00322         used_frameset = cpl_frameset_new();
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324         <span class="comment">/* Read the object frame */</span>
-<a name="l00325"></a>00325         cpl_msg_indent_more();
-<a name="l00326"></a>00326         cpl_msg_info(__func__, <span class="stringliteral">"Applying correction to object %d"</span>, iobj+1) ;
-<a name="l00327"></a>00327         obj_frame = cpl_frameset_get_frame(objframes, iobj);
-<a name="l00328"></a>00328         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(obj_frame));
-<a name="l00329"></a>00329         <span class="keywordflow">if</span>(obj_frame != NULL)
-<a name="l00330"></a>00330             obj_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(obj_frame, CPL_TYPE_FLOAT);
-<a name="l00331"></a>00331         <span class="keywordflow">if</span>(obj_images == NULL)
-<a name="l00332"></a>00332         {
-<a name="l00333"></a>00333             cpl_msg_indent_less();
-<a name="l00334"></a>00334             cpl_msg_error(__func__, <span class="stringliteral">"Error reading obj image"</span>) ;
-<a name="l00335"></a>00335             cpl_frameset_delete(used_frameset);
-<a name="l00336"></a>00336             <span class="keywordflow">return</span> -1;
-<a name="l00337"></a>00337         }
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339         <span class="comment">/* Read the bkg */</span>
-<a name="l00340"></a>00340         bkg_frame = cpl_frameset_get_frame(bkgframes, iobj);
-<a name="l00341"></a>00341         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(bkg_frame));
-<a name="l00342"></a>00342         <span class="keywordflow">if</span>(bkg_frame != NULL)
-<a name="l00343"></a>00343             bkg_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bkg_frame, CPL_TYPE_FLOAT);
-<a name="l00344"></a>00344         <span class="keywordflow">if</span>(bkg_images == NULL)
-<a name="l00345"></a>00345         {
-<a name="l00346"></a>00346             cpl_msg_error(__func__, <span class="stringliteral">"Error reading background image"</span>) ;
-<a name="l00347"></a>00347             cpl_msg_indent_less();
-<a name="l00348"></a>00348             cpl_imagelist_delete(obj_images);
-<a name="l00349"></a>00349             cpl_frameset_delete(used_frameset);
-<a name="l00350"></a>00350             <span class="keywordflow">return</span> -1;
-<a name="l00351"></a>00351         }
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353         <span class="comment">/* Make the correction */</span>
-<a name="l00354"></a>00354         <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>(obj_images, bkg_images);
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356         <span class="comment">/* Save the subtracted frame */</span>
-<a name="l00357"></a>00357         <span class="keywordflow">if</span>(hawki_step_subtract_bkg_save(obj_images,
-<a name="l00358"></a>00358                                         iobj,
-<a name="l00359"></a>00359                                         used_frameset,
-<a name="l00360"></a>00360                                         recipe_parlist,
-<a name="l00361"></a>00361                                         recipe_framelist) != 0)
-<a name="l00362"></a>00362             cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span>
-<a name="l00363"></a>00363                             <span class="stringliteral">"Check permisions or disk space"</span>);
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365         <span class="comment">/* Free in loop */</span>
-<a name="l00366"></a>00366         cpl_msg_indent_less();
-<a name="l00367"></a>00367         cpl_imagelist_delete(obj_images);
-<a name="l00368"></a>00368         cpl_imagelist_delete(bkg_images);
-<a name="l00369"></a>00369         cpl_frameset_delete(used_frameset);
-<a name="l00370"></a>00370     }
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     <span class="comment">/* Exit */</span>
-<a name="l00373"></a>00373     <span class="keywordflow">return</span> 0;
-<a name="l00374"></a>00374 }
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00385"></a>00385 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00386"></a>00386 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_all_save
-<a name="l00387"></a>00387 (cpl_frameset        *  objframes,
-<a name="l00388"></a>00388  cpl_frameset        *  bkgframes,
-<a name="l00389"></a>00389  cpl_parameterlist   *  recipe_parlist,
-<a name="l00390"></a>00390  cpl_frameset        *  recipe_framelist)
-<a name="l00391"></a>00391 {
-<a name="l00392"></a>00392     <span class="keywordtype">int</span>             iobj;
-<a name="l00393"></a>00393     <span class="keywordtype">int</span>             nobjs;
-<a name="l00394"></a>00394     cpl_frame     * bkg_frame;
-<a name="l00395"></a>00395     cpl_imagelist * bkg_images = NULL;
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/* Read the bkg */</span>
-<a name="l00398"></a>00398     cpl_msg_info(__func__,<span class="stringliteral">"Using the same bkg for all the objects"</span>);
-<a name="l00399"></a>00399     bkg_frame = cpl_frameset_get_first(bkgframes);
-<a name="l00400"></a>00400     <span class="keywordflow">if</span>(bkg_frame != NULL)
-<a name="l00401"></a>00401         bkg_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bkg_frame, CPL_TYPE_FLOAT);
-<a name="l00402"></a>00402     <span class="keywordflow">if</span>(bkg_images == NULL)
-<a name="l00403"></a>00403     {
-<a name="l00404"></a>00404         cpl_msg_error(__func__, <span class="stringliteral">"Error reading background image"</span>);
-<a name="l00405"></a>00405         <span class="keywordflow">return</span> -1;
-<a name="l00406"></a>00406     }
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     <span class="comment">/* Subtract the background to each object frame */</span>
-<a name="l00409"></a>00409     nobjs = cpl_frameset_get_size(objframes);
-<a name="l00410"></a>00410     <span class="keywordflow">for</span>(iobj = 0; iobj < nobjs; ++iobj)
-<a name="l00411"></a>00411     {
-<a name="l00412"></a>00412         cpl_frame     * obj_frame;
-<a name="l00413"></a>00413         cpl_imagelist * obj_images = NULL;
-<a name="l00414"></a>00414         cpl_frameset  * used_frameset;
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416         <span class="comment">/* Allocate resources */</span>
-<a name="l00417"></a>00417         used_frameset = cpl_frameset_new();
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419         <span class="comment">/* Read the object frame */</span>
-<a name="l00420"></a>00420         cpl_msg_indent_more();
-<a name="l00421"></a>00421         cpl_msg_info(__func__, <span class="stringliteral">"Applying correction to object %d"</span>, iobj+1) ;
-<a name="l00422"></a>00422         obj_frame = cpl_frameset_get_frame(objframes, iobj);
-<a name="l00423"></a>00423         <span class="keywordflow">if</span>(obj_frame != NULL)
-<a name="l00424"></a>00424             obj_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(obj_frame, CPL_TYPE_FLOAT);
-<a name="l00425"></a>00425         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(obj_frame));
-<a name="l00426"></a>00426         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(bkg_frame));
-<a name="l00427"></a>00427         <span class="keywordflow">if</span>(obj_images == NULL)
-<a name="l00428"></a>00428         {
-<a name="l00429"></a>00429             cpl_msg_indent_less();
-<a name="l00430"></a>00430             cpl_msg_error(__func__, <span class="stringliteral">"Error reading obj image"</span>) ;
-<a name="l00431"></a>00431             cpl_frameset_delete(used_frameset);
-<a name="l00432"></a>00432             <span class="keywordflow">return</span> -1;
-<a name="l00433"></a>00433         }
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435         <span class="comment">/* Make the correction */</span>
-<a name="l00436"></a>00436         <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>(obj_images, bkg_images);
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438         <span class="comment">/* Save the subtracted frame */</span>
-<a name="l00439"></a>00439         hawki_step_subtract_bkg_save(obj_images,
-<a name="l00440"></a>00440                                      iobj,
-<a name="l00441"></a>00441                                      used_frameset,
-<a name="l00442"></a>00442                                      recipe_parlist,
-<a name="l00443"></a>00443                                      recipe_framelist);
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445         <span class="comment">/* Free in loop */</span>
-<a name="l00446"></a>00446         cpl_msg_indent_less();
-<a name="l00447"></a>00447         cpl_imagelist_delete(obj_images);
-<a name="l00448"></a>00448         cpl_frameset_delete(used_frameset);
-<a name="l00449"></a>00449     }
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     <span class="comment">/* Free and return */</span>
-<a name="l00452"></a>00452     cpl_imagelist_delete(bkg_images);
-<a name="l00453"></a>00453     <span class="keywordflow">return</span> 0;
-<a name="l00454"></a>00454 }
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00466"></a>00466 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00467"></a>00467 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_save
-<a name="l00468"></a>00468 (cpl_imagelist     *  obj_images,
-<a name="l00469"></a>00469  <span class="keywordtype">int</span>                  iserie,
-<a name="l00470"></a>00470  cpl_frameset      *  used_frameset,
-<a name="l00471"></a>00471  cpl_parameterlist *  recipe_parlist,
-<a name="l00472"></a>00472  cpl_frameset      *  recipe_framelist)
-<a name="l00473"></a>00473 {
-<a name="l00474"></a>00474     <span class="keyword">const</span> cpl_frame     *   raw_reference;
-<a name="l00475"></a>00475     cpl_propertylist    **  extproplists;
-<a name="l00476"></a>00476     <span class="keywordtype">char</span>                    filename[256] ;
-<a name="l00477"></a>00477     cpl_propertylist    *   inputlist ;
-<a name="l00478"></a>00478     <span class="keywordtype">int</span>                     ext_nb ;
-<a name="l00479"></a>00479     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_subtract_bkg"</span>;
-<a name="l00480"></a>00480     <span class="keywordtype">int</span>                     idet;
-<a name="l00481"></a>00481     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483     <span class="comment">/* Get the reference frame (the raw frame) */</span>
-<a name="l00484"></a>00484     raw_reference = irplib_frameset_get_first_from_group
-<a name="l00485"></a>00485         (used_frameset, CPL_FRAME_GROUP_RAW);
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="comment">/* Create the prop lists */</span>
-<a name="l00488"></a>00488     cpl_msg_indent_more();
-<a name="l00489"></a>00489     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;
-<a name="l00490"></a>00490     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l00491"></a>00491     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00492"></a>00492     {
-<a name="l00493"></a>00493         <span class="comment">/* Get the extension number */</span>
-<a name="l00494"></a>00494         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00495"></a>00495             (cpl_frame_get_filename(raw_reference), idet+1);
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497         <span class="comment">/* Allocate this property list */</span>
-<a name="l00498"></a>00498         extproplists[idet] = cpl_propertylist_new();
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00501"></a>00501         inputlist = cpl_propertylist_load_regexp(
-<a name="l00502"></a>00502                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00503"></a>00503                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00504"></a>00504         cpl_propertylist_append(extproplists[idet], inputlist);
-<a name="l00505"></a>00505         cpl_propertylist_delete(inputlist);
-<a name="l00506"></a>00506         inputlist = cpl_propertylist_load_regexp(
-<a name="l00507"></a>00507                 cpl_frame_get_filename(raw_reference), ext_nb,
-<a name="l00508"></a>00508                 HAWKI_HEADER_WCS, 0);
-<a name="l00509"></a>00509         cpl_propertylist_append(extproplists[idet], inputlist);
-<a name="l00510"></a>00510         cpl_propertylist_delete(inputlist);
-<a name="l00511"></a>00511     }
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     <span class="comment">/* Write the image */</span>
-<a name="l00514"></a>00514     snprintf(filename, 256, <span class="stringliteral">"hawki_step_subtract_bkg_%04d.fits"</span>, iserie+1);
-<a name="l00515"></a>00515     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(recipe_framelist,
-<a name="l00516"></a>00516                          recipe_parlist,
-<a name="l00517"></a>00517                          used_frameset,
-<a name="l00518"></a>00518                          obj_images,
-<a name="l00519"></a>00519                          recipe_name,
-<a name="l00520"></a>00520                          HAWKI_CALPRO_BKG_SUBTRACTED,
-<a name="l00521"></a>00521                          HAWKI_PROTYPE_BKG_SUBTRACTED,
-<a name="l00522"></a>00522                          NULL,
-<a name="l00523"></a>00523                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,
-<a name="l00524"></a>00524                          filename);
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="comment">/* Free and return */</span>
-<a name="l00527"></a>00527     cpl_msg_indent_less();
-<a name="l00528"></a>00528     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00529"></a>00529     {
-<a name="l00530"></a>00530         cpl_propertylist_delete(extproplists[idet]) ;
-<a name="l00531"></a>00531     }
-<a name="l00532"></a>00532     cpl_free(extproplists) ;
-<a name="l00533"></a>00533     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00534"></a>00534     {
-<a name="l00535"></a>00535         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00536"></a>00536         <span class="keywordflow">return</span> -1;
-<a name="l00537"></a>00537     }
-<a name="l00538"></a>00538     <span class="keywordflow">return</span>  0;
-<a name="l00539"></a>00539 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_step_subtract_bkg.c,v 1.18 2012/11/30 14:50: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2008 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/11/30 14:50:51 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_calib.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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">                                Structs</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> </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">                            Functions prototypes</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">   56</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg(cpl_parameterlist *, cpl_frameset *) ;</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">int</span> hawki_step_subtract_bkg_apply_one_to_one_save</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> (cpl_frameset        *  objframes,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  cpl_frameset        *  bkgframes,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  cpl_parameterlist   *  parlist,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_frameset        *  recipe_framelist);</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">int</span> hawki_step_subtract_bkg_apply_one_to_all_save</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> (cpl_frameset        *  objframes,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  cpl_frameset        *  bkgframes,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_parameterlist   *  recipe_parlist,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  cpl_frameset        *  recipe_framelist);</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">int</span> hawki_step_subtract_bkg_save</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> (cpl_imagelist     *  obj_images,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  <span class="keywordtype">int</span>                  iserie,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  cpl_frameset      *  recipe_framelist);</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment">                            Static variables</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">   89</span> <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_step_subtract_bkg_description[] =</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"hawki_step_subtract_bkg -- hawki background subtraction utility.\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"This recipe will subtract the given background to the science images.\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"The background can be obtained from the sky or object images\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"using the hawki_util_compute_bkg utility.\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"There are two modes of operation:\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"One single background image that it is subtracted to all object images.\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"As many background images as objects. A one to one relationship is applied.\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"obj_basic_cal-file.fits "</span>HAWKI_CALPRO_BASICCALIBRATED<span class="stringliteral">" or\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"background-file.fits "</span>HAWKI_CALPRO_BKGIMAGE<span class="stringliteral">" \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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="comment">                                Functions code</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">  105</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     <span class="stringliteral">"hawki_step_subtract_bkg"</span>,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     <span class="stringliteral">"Background subtraction utility"</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     hawki_step_subtract_bkg_description,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     hawki_step_subtract_bkg_create,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                     hawki_step_subtract_bkg_exec,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     hawki_step_subtract_bkg_destroy) ;</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_pluginlist_append(list, plugin) ;</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="keywordflow">return</span> 0;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_create(cpl_plugin * 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>     cpl_recipe      * recipe ;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">//cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="comment">/* None.. */</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="comment">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_exec(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> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <span class="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_step_subtract_bkg(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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg(</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>         cpl_frameset        *   framelist)</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="keywordtype">int</span>                 nobj;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keywordtype">int</span>                 nbkg;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_frameset    *   objframes;</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_frameset    *   bkgframes;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist))</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_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         <span class="keywordflow">return</span> -1 ;</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">/* Identifying objects and bkg data frames */</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying objects and background data"</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     objframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         (framelist, HAWKI_CALPRO_BASICCALIBRATED);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">if</span> (objframes == NULL)</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_msg_error(__func__, <span class="stringliteral">"No object frames provided (%s)"</span>,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                 HAWKI_CALPRO_BASICCALIBRATED);</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>     <span class="comment">/* Retrieve bkg frames */</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     bkgframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         (framelist, HAWKI_CALPRO_BKGIMAGE);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">if</span> (bkgframes == 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>         cpl_msg_error(__func__, <span class="stringliteral">"No background frames provided (%s)"</span>,</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                 HAWKI_CALPRO_BKGIMAGE);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>         cpl_frameset_delete(objframes);</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> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="comment">/* Subtract the background */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     nobj = cpl_frameset_get_size(objframes);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     nbkg = cpl_frameset_get_size(bkgframes);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordflow">if</span>(nobj == nbkg)</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         hawki_step_subtract_bkg_apply_one_to_one_save</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             (objframes, bkgframes, parlist, framelist);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nbkg == 1)</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>         hawki_step_subtract_bkg_apply_one_to_all_save</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>             (objframes, bkgframes, parlist, framelist);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keywordflow">else</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>         cpl_msg_error(__func__,<span class="stringliteral">"Incompatible number of science and background"</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                <span class="stringliteral">" images."</span>);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         cpl_msg_error(__func__,<span class="stringliteral">"Supply only 1 bkg frame or as many as objects"</span>);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         cpl_frameset_delete(bkgframes);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         <span class="keywordflow">return</span> -1;</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="comment">/* Free resources */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_frameset_delete(objframes);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_frameset_delete(bkgframes);</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">/* Return */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_error(__func__,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         <span class="keywordflow">return</span> -1 ;</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">else</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> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_one_save</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> (cpl_frameset        *  objframes,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>  cpl_frameset        *  bkgframes,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>  cpl_parameterlist   *  recipe_parlist,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>  cpl_frameset        *  recipe_framelist)</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">int</span>          iobj;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordtype">int</span>          nobjs;</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">/* Subtract the background to each object frame */</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_msg_info(__func__,<span class="stringliteral">"Using a one to one relation btw objects and bkgs"</span>);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     nobjs = cpl_frameset_get_size(objframes);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">for</span>(iobj = 0; iobj < nobjs; ++iobj)</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_frame     * obj_frame = NULL;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         cpl_frame     * bkg_frame = NULL;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         cpl_imagelist * obj_images = NULL;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         cpl_imagelist * bkg_images = NULL;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         cpl_frameset  * used_frameset;</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">/* Allocate resources */</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         used_frameset = cpl_frameset_new();</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">/* Read the object frame */</span></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>         cpl_msg_info(__func__, <span class="stringliteral">"Applying correction to object %d"</span>, iobj+1) ;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         obj_frame = cpl_frameset_get_frame(objframes, iobj);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(obj_frame));</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="keywordflow">if</span>(obj_frame != NULL)</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             obj_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(obj_frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>         <span class="keywordflow">if</span>(obj_images == 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>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading obj image"</span>) ;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>             cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>             <span class="keywordflow">return</span> -1;</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>         <span class="comment">/* Read the bkg */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         bkg_frame = cpl_frameset_get_frame(bkgframes, iobj);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(bkg_frame));</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         <span class="keywordflow">if</span>(bkg_frame != NULL)</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             bkg_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bkg_frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         <span class="keywordflow">if</span>(bkg_images == 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>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading background image"</span>) ;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>             cpl_imagelist_delete(obj_images);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>             cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>             <span class="keywordflow">return</span> -1;</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>         <span class="comment">/* Make the correction */</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>(obj_images, bkg_images);</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">/* Save the subtracted frame */</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         <span class="keywordflow">if</span>(hawki_step_subtract_bkg_save(obj_images,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                                         iobj,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                                         used_frameset,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                                         recipe_parlist,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                         recipe_framelist) != 0)</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>             cpl_msg_warning(__func__,<span class="stringliteral">"Some data could not be saved. "</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                             <span class="stringliteral">"Check permisions or disk space"</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>         <span class="comment">/* Free in loop */</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_imagelist_delete(obj_images);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         cpl_imagelist_delete(bkg_images);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         cpl_frameset_delete(used_frameset);</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>     <span class="comment">/* Exit */</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">return</span> 0;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_apply_one_to_all_save</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> (cpl_frameset        *  objframes,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>  cpl_frameset        *  bkgframes,</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>  cpl_parameterlist   *  recipe_parlist,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>  cpl_frameset        *  recipe_framelist)</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="keywordtype">int</span>             iobj;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">int</span>             nobjs;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     cpl_frame     * bkg_frame;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_imagelist * bkg_images = 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="comment">/* Read the bkg */</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     cpl_msg_info(__func__,<span class="stringliteral">"Using the same bkg for all the objects"</span>);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     bkg_frame = cpl_frameset_get_first(bkgframes);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">if</span>(bkg_frame != NULL)</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>         bkg_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(bkg_frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="keywordflow">if</span>(bkg_images == 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>         cpl_msg_error(__func__, <span class="stringliteral">"Error reading background image"</span>);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Subtract the background to each object frame */</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     nobjs = cpl_frameset_get_size(objframes);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <span class="keywordflow">for</span>(iobj = 0; iobj < nobjs; ++iobj)</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>         cpl_frame     * obj_frame;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         cpl_imagelist * obj_images = NULL;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         cpl_frameset  * used_frameset;</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">/* Allocate resources */</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         used_frameset = cpl_frameset_new();</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">/* Read the object frame */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         cpl_msg_info(__func__, <span class="stringliteral">"Applying correction to object %d"</span>, iobj+1) ;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         obj_frame = cpl_frameset_get_frame(objframes, iobj);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keywordflow">if</span>(obj_frame != NULL)</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             obj_images = <a class="code" href="group__hawki__load.html#gaa83706a01275860daf2d743f315e1751" title="Load all the chips of HAWKI images from a frame into an image list.">hawki_load_frame</a>(obj_frame, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(obj_frame));</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         cpl_frameset_insert(used_frameset, cpl_frame_duplicate(bkg_frame));</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         <span class="keywordflow">if</span>(obj_images == 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>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             cpl_msg_error(__func__, <span class="stringliteral">"Error reading obj image"</span>) ;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>             cpl_frameset_delete(used_frameset);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>             <span class="keywordflow">return</span> -1;</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">/* Make the correction */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         <a class="code" href="group__hawki__calib.html#ga648180245b7cace291a654d5b31e5f75" title="Apply the background subtraction to the images.">hawki_bkg_imglist_calib</a>(obj_images, bkg_images);</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">/* Save the subtracted frame */</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         hawki_step_subtract_bkg_save(obj_images,</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                                      iobj,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                      used_frameset,</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                                      recipe_parlist,</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                                      recipe_framelist);</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="comment">/* Free in loop */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         cpl_imagelist_delete(obj_images);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         cpl_frameset_delete(used_frameset);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     cpl_imagelist_delete(bkg_images);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">return</span> 0;</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> <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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_step_subtract_bkg_save</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> (cpl_imagelist     *  obj_images,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>  <span class="keywordtype">int</span>                  iserie,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>  cpl_frameset      *  used_frameset,</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>  cpl_frameset      *  recipe_framelist)</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="keyword">const</span> cpl_frame     *   raw_reference;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     cpl_propertylist    **  extproplists;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     <span class="keywordtype">char</span>                    filename[256] ;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="keywordtype">int</span>                     ext_nb ;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_step_subtract_bkg"</span>;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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">/* Get the reference frame (the raw frame) */</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     raw_reference = irplib_frameset_get_first_from_group</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         (used_frameset, CPL_FRAME_GROUP_RAW);</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="comment">/* Create the prop lists */</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>     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     extproplists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             (cpl_frame_get_filename(raw_reference), idet+1);</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="comment">/* Allocate this property list */</span></div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         extproplists[idet] = cpl_propertylist_new();</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">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                 HAWKI_HEADER_EXT_FORWARD, 0);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         cpl_propertylist_append(extproplists[idet], inputlist);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         cpl_propertylist_delete(inputlist);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         inputlist = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                 cpl_frame_get_filename(raw_reference), ext_nb,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                 HAWKI_HEADER_WCS, 0);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         cpl_propertylist_append(extproplists[idet], inputlist);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         cpl_propertylist_delete(inputlist);</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">/* Write the image */</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     snprintf(filename, 256, <span class="stringliteral">"hawki_step_subtract_bkg_%04d.fits"</span>, iserie+1);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <a class="code" href="group__hawki__save.html#ga98c1ab4685617ddf7ea51d6e1337695d" title="Save a HAWKI_NB_DETECTORS extensions HAWKI image.">hawki_imagelist_save</a>(recipe_framelist,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>                          recipe_parlist,</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>                          used_frameset,</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>                          obj_images,</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                          recipe_name,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                          HAWKI_CALPRO_BKG_SUBTRACTED,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                          HAWKI_PROTYPE_BKG_SUBTRACTED,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                          NULL,</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                          (<span class="keyword">const</span> cpl_propertylist**)extproplists,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                          filename);</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_propertylist_delete(extproplists[idet]) ;</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_free(extproplists) ;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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>         cpl_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         <span class="keywordflow">return</span> -1;</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>     <span class="keywordflow">return</span>  0;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</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/hawki__tec__filtchk_8c_source.html b/html/hawki__tec__filtchk_8c_source.html
index 6a8aaa9..ffc79c9 100644
--- a/html/hawki__tec__filtchk_8c_source.html
+++ b/html/hawki__tec__filtchk_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_tec_filtchk.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,352 +40,358 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_tec_filtchk.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_tec_filtchk.c,v 1.15 2011/10/24 10:41:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 10:41:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.15 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <hawki_dfs.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <hawki_load.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <hawki_save.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <hawki_pfits.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <hawki_image_stats.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <hawki_utils.h></span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                            Functions prototypes</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_create(cpl_plugin *) ;
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_exec(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_destroy(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_frameset_stats
-<a name="l00058"></a>00058 (cpl_table       **  target_stats,
-<a name="l00059"></a>00059  cpl_propertylist ** stats_stats,
-<a name="l00060"></a>00060  cpl_frameset     *  target_frames);
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_save
-<a name="l00063"></a>00063 (cpl_table         ** target_stats,
-<a name="l00064"></a>00064  cpl_parameterlist *  recipe_parlist,
-<a name="l00065"></a>00065  cpl_frameset      *  recipe_frameset,
-<a name="l00066"></a>00066  cpl_propertylist  ** stats_stats,
-<a name="l00067"></a>00067  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,
-<a name="l00068"></a>00068  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype);
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00071"></a>00071 <span class="comment">                            Static variables</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">char</span> hawki_tec_filtchk_description[] =
-<a name="l00075"></a>00075 <span class="stringliteral">"hawki_tec_filtchk -- Check pairs of flats taken with different filters.\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"raw-file.fits "</span>HAWKI_TEC_FLAT_RAW<span class="stringliteral">"\n"</span>;
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00080"></a>00080 <span class="comment">                                Functions code</span>
-<a name="l00081"></a>00081 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00091"></a>00091 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00092"></a>00092 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00093"></a>00093 {
-<a name="l00094"></a>00094     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00095"></a>00095     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097     cpl_plugin_init(plugin,
-<a name="l00098"></a>00098                     CPL_PLUGIN_API,
-<a name="l00099"></a>00099                     HAWKI_BINARY_VERSION,
-<a name="l00100"></a>00100                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00101"></a>00101                     <span class="stringliteral">"hawki_tec_filtchk"</span>,
-<a name="l00102"></a>00102                     <span class="stringliteral">"Filter checking recipe"</span>,
-<a name="l00103"></a>00103                     hawki_tec_filtchk_description,
-<a name="l00104"></a>00104                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00105"></a>00105                     PACKAGE_BUGREPORT,  
-<a name="l00106"></a>00106                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00107"></a>00107                     hawki_tec_filtchk_create,
-<a name="l00108"></a>00108                     hawki_tec_filtchk_exec,
-<a name="l00109"></a>00109                     hawki_tec_filtchk_destroy) ;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111     cpl_pluginlist_append(list, plugin) ;
-<a name="l00112"></a>00112     
-<a name="l00113"></a>00113     <span class="keywordflow">return</span> 0;
-<a name="l00114"></a>00114 }
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00125"></a>00125 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00126"></a>00126 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_create(cpl_plugin * plugin)
-<a name="l00127"></a>00127 {
-<a name="l00128"></a>00128     cpl_recipe      * recipe ;
-<a name="l00129"></a>00129     <span class="comment">/* cpl_parameter   * p ; */</span>
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00132"></a>00132     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00133"></a>00133         recipe = (cpl_recipe *)plugin ;
-<a name="l00134"></a>00134     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00137"></a>00137     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00138"></a>00138     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00139"></a>00139         <span class="keywordflow">return</span> 1;
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00142"></a>00142     <span class="comment">/* None.. */</span>
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144     <span class="comment">/* Return */</span>
-<a name="l00145"></a>00145     <span class="keywordflow">return</span> 0;
-<a name="l00146"></a>00146 }
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00154"></a>00154 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00155"></a>00155 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_exec(cpl_plugin * plugin)
-<a name="l00156"></a>00156 {
-<a name="l00157"></a>00157     cpl_recipe  *   recipe ;
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00160"></a>00160     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00161"></a>00161         recipe = (cpl_recipe *)plugin ;
-<a name="l00162"></a>00162     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/* Issue a banner */</span>
-<a name="l00165"></a>00165     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     <span class="keywordflow">return</span> hawki_tec_filtchk(recipe->parameters, recipe->frames) ;
-<a name="l00168"></a>00168 }
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00176"></a>00176 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00177"></a>00177 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_destroy(cpl_plugin * plugin)
-<a name="l00178"></a>00178 {
-<a name="l00179"></a>00179     cpl_recipe  *   recipe ;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00182"></a>00182     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00183"></a>00183         recipe = (cpl_recipe *)plugin ;
-<a name="l00184"></a>00184     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00187"></a>00187     <span class="keywordflow">return</span> 0 ;
-<a name="l00188"></a>00188 }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00197"></a>00197 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00198"></a>00198 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk(
-<a name="l00199"></a>00199         cpl_parameterlist   *   parlist, 
-<a name="l00200"></a>00200         cpl_frameset        *   framelist)
-<a name="l00201"></a>00201 {
-<a name="l00202"></a>00202     cpl_frameset     *  frames ;
-<a name="l00203"></a>00203     cpl_table        ** target_stats;
-<a name="l00204"></a>00204     cpl_propertylist ** stats_stats;  
-<a name="l00205"></a>00205     <span class="keywordtype">int</span>                 idet;
-<a name="l00206"></a>00206     <span class="keywordtype">char</span>                calpro[1024];
-<a name="l00207"></a>00207     <span class="keywordtype">char</span>                protype[1024];
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00210"></a>00210     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) 
-<a name="l00211"></a>00211     {
-<a name="l00212"></a>00212         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00213"></a>00213         <span class="keywordflow">return</span> -1;
-<a name="l00214"></a>00214     }
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00217"></a>00217     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);
-<a name="l00218"></a>00218     frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_TEC_FLAT_RAW) ;
-<a name="l00219"></a>00219     snprintf(calpro, 1024, HAWKI_CALPRO_FILTERPOSCHECK_STATS);
-<a name="l00220"></a>00220     snprintf(protype, 1024, HAWKI_PROTYPE_FILTERPOSCHECK_STATS);
-<a name="l00221"></a>00221     <span class="keywordflow">if</span> (frames == NULL)
-<a name="l00222"></a>00222     {
-<a name="l00223"></a>00223         cpl_msg_error(__func__,<span class="stringliteral">"Input files should be tagged %s"</span>,
-<a name="l00224"></a>00224                       HAWKI_TEC_FLAT_RAW);
-<a name="l00225"></a>00225         <span class="keywordflow">return</span> -1;
-<a name="l00226"></a>00226     }
-<a name="l00227"></a>00227     
-<a name="l00228"></a>00228     <span class="comment">/* Create the statistics table */</span>
-<a name="l00229"></a>00229     target_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));
-<a name="l00230"></a>00230     stats_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));
-<a name="l00231"></a>00231     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00232"></a>00232     {
-<a name="l00233"></a>00233         target_stats[idet] = cpl_table_new(cpl_frameset_get_size(frames));
-<a name="l00234"></a>00234         stats_stats[idet] = cpl_propertylist_new();
-<a name="l00235"></a>00235     }
-<a name="l00236"></a>00236     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(target_stats);
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     <span class="comment">/* Compute actually the statistics */</span>
-<a name="l00239"></a>00239     hawki_tec_filtchk_frameset_stats(target_stats, stats_stats, frames);
-<a name="l00240"></a>00240     
-<a name="l00241"></a>00241     <span class="comment">/* Saving the table product */</span>
-<a name="l00242"></a>00242     hawki_tec_filtchk_save
-<a name="l00243"></a>00243         (target_stats, parlist, framelist, stats_stats, calpro, protype);
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245     <span class="comment">/* Free and return */</span>
-<a name="l00246"></a>00246     cpl_frameset_delete(frames);
-<a name="l00247"></a>00247     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00248"></a>00248     {
-<a name="l00249"></a>00249         cpl_table_delete(target_stats[idet]);
-<a name="l00250"></a>00250         cpl_propertylist_delete(stats_stats[idet]);
-<a name="l00251"></a>00251     }
-<a name="l00252"></a>00252     cpl_free(target_stats); 
-<a name="l00253"></a>00253     cpl_free(stats_stats); 
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="comment">/* Return */</span>
-<a name="l00256"></a>00256     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00257"></a>00257     {
-<a name="l00258"></a>00258         cpl_msg_error(__func__,
-<a name="l00259"></a>00259                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00260"></a>00260         <span class="keywordflow">return</span> -1 ;
-<a name="l00261"></a>00261     }
-<a name="l00262"></a>00262     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00263"></a>00263 }
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00275"></a>00275 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00276"></a>00276 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_frameset_stats
-<a name="l00277"></a>00277 (cpl_table       **  target_stats,
-<a name="l00278"></a>00278  cpl_propertylist ** stats_stats,
-<a name="l00279"></a>00279  cpl_frameset     *  target_frames)
-<a name="l00280"></a>00280 {
-<a name="l00281"></a>00281     <span class="keywordtype">int</span> iframe;
-<a name="l00282"></a>00282     <span class="keywordtype">int</span> nframes;
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/* Loop on the number of frames */</span>
-<a name="l00285"></a>00285     nframes = cpl_frameset_get_size(target_frames);
-<a name="l00286"></a>00286     cpl_msg_info(__func__, <span class="stringliteral">"Looping the target frames: %d frames"</span>, nframes);
-<a name="l00287"></a>00287     cpl_msg_indent_more();
-<a name="l00288"></a>00288     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l00289"></a>00289     {
-<a name="l00290"></a>00290         <span class="comment">/* Local storage variables */</span>
-<a name="l00291"></a>00291         cpl_frame     * this_target_frame;
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293         <span class="comment">/* Computing statistics for this frame */</span>
-<a name="l00294"></a>00294         cpl_msg_info(__func__, <span class="stringliteral">"Computing stats for frame: %d"</span>, iframe +1);
-<a name="l00295"></a>00295         this_target_frame = cpl_frameset_get_frame(target_frames, iframe);
-<a name="l00296"></a>00296         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a>
-<a name="l00297"></a>00297             (target_stats, this_target_frame, iframe);
-<a name="l00298"></a>00298     }
-<a name="l00299"></a>00299     cpl_msg_indent_less();
-<a name="l00300"></a>00300     
-<a name="l00301"></a>00301     <span class="comment">/* Compute stats of the stats */</span>
-<a name="l00302"></a>00302     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(target_stats, stats_stats);
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     <span class="comment">/* Print info about the statistics */</span>
-<a name="l00305"></a>00305     hawki_image_stats_print(target_stats);
-<a name="l00306"></a>00306     
-<a name="l00307"></a>00307     <span class="keywordflow">return</span> 0;
-<a name="l00308"></a>00308 }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00320"></a>00320 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00321"></a>00321 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_save
-<a name="l00322"></a>00322 (cpl_table         ** target_stats,
-<a name="l00323"></a>00323  cpl_parameterlist *  recipe_parlist,
-<a name="l00324"></a>00324  cpl_frameset      *  recipe_frameset,
-<a name="l00325"></a>00325  cpl_propertylist  ** stats_stats,
-<a name="l00326"></a>00326  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,
-<a name="l00327"></a>00327  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype)
-<a name="l00328"></a>00328 {
-<a name="l00329"></a>00329     <span class="keyword">const</span> cpl_frame  *  reference_frame;
-<a name="l00330"></a>00330     cpl_propertylist *  referencelist;
-<a name="l00331"></a>00331     cpl_propertylist ** extlists;
-<a name="l00332"></a>00332     <span class="keywordtype">int</span>                 idet;
-<a name="l00333"></a>00333     <span class="keywordtype">int</span>                 ext_nb;
-<a name="l00334"></a>00334     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_tec_filtchk"</span>;
-<a name="l00335"></a>00335     
-<a name="l00336"></a>00336     <span class="comment">/* Get the reference frame (the first one) */</span>
-<a name="l00337"></a>00337     reference_frame = cpl_frameset_get_first_const(recipe_frameset);
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339     <span class="comment">/* Create the prop lists */</span>
-<a name="l00340"></a>00340     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;
-<a name="l00341"></a>00341     referencelist = cpl_propertylist_load_regexp
-<a name="l00342"></a>00342         (cpl_frame_get_filename(reference_frame), 0,HAWKI_HEADER_EXT_FORWARD,0);
-<a name="l00343"></a>00343     extlists = 
-<a name="l00344"></a>00344         cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));
-<a name="l00345"></a>00345     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00346"></a>00346     {
-<a name="l00347"></a>00347         <span class="comment">/* Get the extension number */</span>
-<a name="l00348"></a>00348         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>
-<a name="l00349"></a>00349             (cpl_frame_get_filename(reference_frame), idet+1);
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351         <span class="comment">/* Propagate the keywords from input frame extensions */</span>
-<a name="l00352"></a>00352         extlists[idet] = cpl_propertylist_load_regexp(
-<a name="l00353"></a>00353                 cpl_frame_get_filename(reference_frame), ext_nb,
-<a name="l00354"></a>00354                 HAWKI_HEADER_EXT_FORWARD, 0);
-<a name="l00355"></a>00355         
-<a name="l00356"></a>00356         <span class="comment">/* Add the stats of the stats */</span>
-<a name="l00357"></a>00357         cpl_propertylist_append(extlists[idet],stats_stats[idet]);
-<a name="l00358"></a>00358     }
-<a name="l00359"></a>00359     
-<a name="l00360"></a>00360     <span class="comment">/* Write the table with the statistics */</span>
-<a name="l00361"></a>00361     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset,
-<a name="l00362"></a>00362                       recipe_parlist,
-<a name="l00363"></a>00363                       recipe_frameset,
-<a name="l00364"></a>00364                       (<span class="keyword">const</span> cpl_table **)target_stats,
-<a name="l00365"></a>00365                       recipe_name,
-<a name="l00366"></a>00366                       calpro,
-<a name="l00367"></a>00367                       protype,
-<a name="l00368"></a>00368                       (<span class="keyword">const</span> cpl_propertylist*)referencelist, 
-<a name="l00369"></a>00369                       (<span class="keyword">const</span> cpl_propertylist**)extlists, 
-<a name="l00370"></a>00370                       <span class="stringliteral">"hawki_tec_filtchk_stats.fits"</span>);
-<a name="l00371"></a>00371     
-<a name="l00372"></a>00372     <span class="comment">/* Free and return */</span>
-<a name="l00373"></a>00373     cpl_propertylist_delete(referencelist) ;
-<a name="l00374"></a>00374     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) 
-<a name="l00375"></a>00375     {
-<a name="l00376"></a>00376         cpl_propertylist_delete(extlists[idet]) ;
-<a name="l00377"></a>00377     }
-<a name="l00378"></a>00378     cpl_free(extlists) ;
-<a name="l00379"></a>00379     <span class="keywordflow">return</span>  0;
-<a name="l00380"></a>00380 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_tec_filtchk.c,v 1.16 2013/03/11 11:02: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/03/11 11:02:59 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 <hawki_dfs.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <hawki_load.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <hawki_save.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <hawki_pfits.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <hawki_image_stats.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <hawki_utils.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> </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> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk(cpl_parameterlist *, cpl_frameset *) ;</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">int</span> hawki_tec_filtchk_frameset_stats</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> (cpl_table       **  target_stats,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  cpl_propertylist ** stats_stats,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  cpl_frameset     *  target_frames);</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">int</span> hawki_tec_filtchk_save</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> (cpl_table         ** target_stats,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  cpl_frameset      *  recipe_frameset,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  cpl_propertylist  ** stats_stats,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype);</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">                            Static variables</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="keyword">static</span> <span class="keywordtype">char</span> hawki_tec_filtchk_description[] =</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"hawki_tec_filtchk -- Check pairs of flats taken with different filters.\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"raw-file.fits "</span>HAWKI_TEC_FLAT_RAW<span class="stringliteral">"\n"</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">                                Functions code</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="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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     <span class="stringliteral">"hawki_tec_filtchk"</span>,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     <span class="stringliteral">"Filter checking recipe"</span>,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     hawki_tec_filtchk_description,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     hawki_tec_filtchk_create,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                     hawki_tec_filtchk_exec,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                     hawki_tec_filtchk_destroy) ;</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>     cpl_pluginlist_append(list, plugin) ;</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="keywordflow">return</span> 0;</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="l00130"></a><span class="lineno">  130</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_create(cpl_plugin * plugin)</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 ;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="comment">/* cpl_parameter   * p ; */</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -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>     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="comment">/* None.. */</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="comment">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_exec(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Issue a banner */</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_tec_filtchk(recipe->parameters, recipe->frames) ;</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">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</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> <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>     cpl_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">return</span> 0 ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk(</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         cpl_frameset        *   framelist)</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_frameset     *  frames ;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_table        ** target_stats;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_propertylist ** stats_stats;  </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordtype">char</span>                calpro[1024];</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="keywordtype">char</span>                protype[1024];</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) </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_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         <span class="keywordflow">return</span> -1;</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_msg_info(__func__, <span class="stringliteral">"Identifying input frames"</span>);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     frames = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist, HAWKI_TEC_FLAT_RAW) ;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     snprintf(calpro, 1024, HAWKI_CALPRO_FILTERPOSCHECK_STATS);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     snprintf(protype, 1024, HAWKI_PROTYPE_FILTERPOSCHECK_STATS);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">if</span> (frames == 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_msg_error(__func__,<span class="stringliteral">"Input files should be tagged %s"</span>,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                       HAWKI_TEC_FLAT_RAW);</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         <span class="keywordflow">return</span> -1;</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>     <span class="comment">/* Create the statistics table */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     target_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table *));</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     stats_stats = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist *));</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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>         target_stats[idet] = cpl_table_new(cpl_frameset_get_size(frames));</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>         stats_stats[idet] = cpl_propertylist_new();</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>     <a class="code" href="group__hawki__image__stats.html#ga788a4b7f6fba705eddcebd1f2fe26fd6" title="Initialize the table with all the statistics columns.">hawki_image_stats_initialize</a>(target_stats);</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">/* Compute actually the statistics */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     hawki_tec_filtchk_frameset_stats(target_stats, stats_stats, frames);</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">/* Saving the table product */</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     hawki_tec_filtchk_save</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         (target_stats, parlist, framelist, stats_stats, calpro, protype);</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">/* Free and return */</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_frameset_delete(frames);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">for</span>( idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_delete(target_stats[idet]);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>         cpl_propertylist_delete(stats_stats[idet]);</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_free(target_stats); </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_free(stats_stats); </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">/* Return */</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>         <span class="keywordflow">return</span> -1 ;</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">else</span> <span class="keywordflow">return</span> 0 ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_frameset_stats</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> (cpl_table       **  target_stats,</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>  cpl_propertylist ** stats_stats,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>  cpl_frameset     *  target_frames)</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="keywordtype">int</span> iframe;</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordtype">int</span> nframes;</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">/* Loop on the number of frames */</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     nframes = cpl_frameset_get_size(target_frames);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_msg_info(__func__, <span class="stringliteral">"Looping the target frames: %d frames"</span>, nframes);</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>     <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)</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">/* Local storage variables */</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>         cpl_frame     * this_target_frame;</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">/* Computing statistics for this frame */</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>         cpl_msg_info(__func__, <span class="stringliteral">"Computing stats for frame: %d"</span>, iframe +1);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         this_target_frame = cpl_frameset_get_frame(target_frames, iframe);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         <a class="code" href="group__hawki__image__stats.html#ga07a4f45b2ba4af9420f7d8600dbbe836" title="Fills a table with the statistics of the four detectors of a frame.">hawki_image_stats_fill_from_frame</a></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>             (target_stats, this_target_frame, iframe);</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>     </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="comment">/* Compute stats of the stats */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <a class="code" href="group__hawki__image__stats.html#gaaf82f2c0930f1c2bfcbc5cbef16b3928" title="Make the statistics (over image serie) of the each image statistics.">hawki_image_stats_stats</a>(target_stats, stats_stats);</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">/* Print info about the statistics */</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     hawki_image_stats_print(target_stats);</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="keywordflow">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_tec_filtchk_save</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> (cpl_table         ** target_stats,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>  cpl_parameterlist *  recipe_parlist,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>  cpl_frameset      *  recipe_frameset,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>  cpl_propertylist  ** stats_stats,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  calpro,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>        *  protype)</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="keyword">const</span> cpl_frame  *  reference_frame;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_propertylist *  referencelist;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_propertylist ** extlists;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">int</span>                 ext_nb;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *  recipe_name = <span class="stringliteral">"hawki_tec_filtchk"</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="comment">/* Get the reference frame (the first one) */</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     reference_frame = cpl_frameset_get_first_const(recipe_frameset);</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">/* Create the prop lists */</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     cpl_msg_info(__func__, <span class="stringliteral">"Creating the keywords list"</span>) ;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     referencelist = cpl_propertylist_load_regexp</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         (cpl_frame_get_filename(reference_frame), 0,HAWKI_HEADER_EXT_FORWARD,0);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     extlists = </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>         cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*));</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">/* Get the extension number */</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>             (cpl_frame_get_filename(reference_frame), idet+1);</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">/* Propagate the keywords from input frame extensions */</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         extlists[idet] = cpl_propertylist_load_regexp(</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                 cpl_frame_get_filename(reference_frame), ext_nb,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                 HAWKI_HEADER_EXT_FORWARD, 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="comment">/* Add the stats of the stats */</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         cpl_propertylist_append(extlists[idet],stats_stats[idet]);</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>     </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="comment">/* Write the table with the statistics */</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(recipe_frameset,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                       recipe_parlist,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                       recipe_frameset,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                       (<span class="keyword">const</span> cpl_table **)target_stats,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                       recipe_name,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                       calpro,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                       protype,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                       (<span class="keyword">const</span> cpl_propertylist*)referencelist, </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                       (<span class="keyword">const</span> cpl_propertylist**)extlists, </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                       <span class="stringliteral">"hawki_tec_filtchk_stats.fits"</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">/* Free and return */</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     cpl_propertylist_delete(referencelist) ;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) </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>         cpl_propertylist_delete(extlists[idet]) ;</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_free(extlists) ;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">return</span>  0;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</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/hawki__util__extinction_8c_source.html b/html/hawki__util__extinction_8c_source.html
index b5e0115..11ad05b 100644
--- a/html/hawki__util__extinction_8c_source.html
+++ b/html/hawki__util__extinction_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_util_extinction.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,510 +40,516 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_util_extinction.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_util_extinction.c,v 1.3 2011/12/22 14:28: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/12/22 14:28:43 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<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 <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_strehl.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "irplib_stdstar.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "irplib_cat.h"</span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_calib.h"</span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00049"></a>00049 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00050"></a>00050 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00051"></a>00051 <span class="preprocessor">#include "hawki_alloc.h"</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00054"></a>00054 <span class="comment">                            Functions prototypes</span>
-<a name="l00055"></a>00055 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_create(cpl_plugin *) ;
-<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_exec(cpl_plugin *) ;
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_destroy(cpl_plugin *) ;
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> cpl_table ** hawki_util_extinction_reduce
-<a name="l00063"></a>00063 (cpl_frameset    *   <span class="keyword">set</span>,
-<a name="l00064"></a>00064  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,
-<a name="l00065"></a>00065  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,
-<a name="l00066"></a>00066  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,
-<a name="l00067"></a>00067  cpl_table       **  raw_zpoint_stats,
-<a name="l00068"></a>00068  <span class="keywordtype">int</span>             *   star_labels,
-<a name="l00069"></a>00069  <span class="keywordtype">int</span>             *   det_labels,
-<a name="l00070"></a>00070  cpl_imagelist   **  images);
-<a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_save_photsol
-<a name="l00072"></a>00072 (cpl_table           **  photsol_table,
-<a name="l00073"></a>00073  cpl_frameset        *   zpoint_frames,
-<a name="l00074"></a>00074  cpl_parameterlist   *   parlist,
-<a name="l00075"></a>00075  cpl_frameset        *   <span class="keyword">set</span>);
-<a name="l00076"></a>00076 <span class="keyword">static</span> cpl_table ** hawki_util_extinction_photom
-<a name="l00077"></a>00077 (cpl_frameset *   std_stars_photom);
-<a name="l00078"></a>00078 <span class="keyword">static</span> cpl_table * hawki_util_extinction_get_photomsol
-<a name="l00079"></a>00079 (cpl_table * std_stars_photom);
-<a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_compute_keywords
-<a name="l00081"></a>00081 (cpl_frameset * <span class="keyword">set</span>, 
-<a name="l00082"></a>00082  <span class="keywordtype">int</span>          * det_labels);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00085"></a>00085 <span class="comment">                            Static variables</span>
-<a name="l00086"></a>00086 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_util_extinction_description[] =
-<a name="l00090"></a>00090 <span class="stringliteral">"hawki_util_extinction -- Zero point recipe with extinction\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"must be tagged as:\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"hawki_util_extinction.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): Zero point solution table\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"The recipe creates as an output:\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"hawki_cal_photom.fits ("</span>HAWKI_CALPRO_PHOT_TAB<span class="stringliteral">"): Photometric solution\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"Return code:\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"or 1 otherwise"</span>;
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00101"></a>00101 <span class="comment">                                Functions code</span>
-<a name="l00102"></a>00102 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00112"></a>00112 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00113"></a>00113 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00114"></a>00114 {
-<a name="l00115"></a>00115     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00116"></a>00116     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118     cpl_plugin_init(plugin,
-<a name="l00119"></a>00119                     CPL_PLUGIN_API,
-<a name="l00120"></a>00120                     HAWKI_BINARY_VERSION,
-<a name="l00121"></a>00121                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00122"></a>00122                     <span class="stringliteral">"hawki_util_extinction"</span>,
-<a name="l00123"></a>00123                     <span class="stringliteral">"Zero point with extinction computation recipe"</span>,
-<a name="l00124"></a>00124                     hawki_util_extinction_description,
-<a name="l00125"></a>00125                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00126"></a>00126                     <span class="stringliteral">"cgarcia at eso.org"</span>,
-<a name="l00127"></a>00127                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00128"></a>00128                     hawki_util_extinction_create,
-<a name="l00129"></a>00129                     hawki_util_extinction_exec,
-<a name="l00130"></a>00130                     hawki_util_extinction_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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00146"></a>00146 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_create(cpl_plugin * plugin)
-<a name="l00148"></a>00148 {
-<a name="l00149"></a>00149     cpl_recipe      * recipe ;
-<a name="l00150"></a>00150     cpl_parameter   * p ;
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00153"></a>00153     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00154"></a>00154         recipe = (cpl_recipe *)plugin ;
-<a name="l00155"></a>00155     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00158"></a>00158     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00159"></a>00159     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00160"></a>00160         <span class="keywordflow">return</span> 1;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/* Return */</span>
-<a name="l00165"></a>00165     <span class="keywordflow">return</span> 0;
-<a name="l00166"></a>00166 }
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00174"></a>00174 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_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="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="comment">/* Issue a banner */</span>
-<a name="l00185"></a>00185     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="keywordflow">return</span> hawki_util_extinction(recipe->parameters, recipe->frames) ;
-<a name="l00188"></a>00188 }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00196"></a>00196 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00197"></a>00197 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_destroy(cpl_plugin * plugin)
-<a name="l00198"></a>00198 {
-<a name="l00199"></a>00199     cpl_recipe  *   recipe ;
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     cpl_parameterlist_delete(recipe->parameters) ;
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00217"></a>00217 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00218"></a>00218 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction(
-<a name="l00219"></a>00219         cpl_parameterlist   *   parlist,
-<a name="l00220"></a>00220         cpl_frameset        *   framelist)
-<a name="l00221"></a>00221 {
-<a name="l00222"></a>00222     cpl_frameset    *   std_stars_photom ;
-<a name="l00223"></a>00223     cpl_table       **  zpoint_tables;
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     <span class="comment">/* Initialise Output */</span>
-<a name="l00226"></a>00226     std_stars_photom = NULL ;
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00229"></a>00229     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00230"></a>00230         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00231"></a>00231         <span class="keywordflow">return</span> -1 ;
-<a name="l00232"></a>00232     }
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234     <span class="comment">/* Retrieve zpoint tables */</span>
-<a name="l00235"></a>00235     <span class="keywordflow">if</span> ((std_stars_photom = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>
-<a name="l00236"></a>00236             (framelist, HAWKI_CALPRO_ZPOINT_TAB)) == NULL)
-<a name="l00237"></a>00237     {
-<a name="l00238"></a>00238         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find std stars info (%s)"</span>,
-<a name="l00239"></a>00239                       HAWKI_CALPRO_ZPOINT_TAB);
-<a name="l00240"></a>00240         <span class="keywordflow">return</span> -1 ;
-<a name="l00241"></a>00241     }
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     <span class="comment">/* Compute the zpoint values */</span>
-<a name="l00244"></a>00244     cpl_msg_info(__func__, <span class="stringliteral">"Reduce the data"</span>) ;
-<a name="l00245"></a>00245     cpl_msg_indent_more() ;
-<a name="l00246"></a>00246     <span class="keywordflow">if</span> ((zpoint_tables = hawki_util_extinction_photom(std_stars_photom))==NULL)
-<a name="l00247"></a>00247     {
-<a name="l00248"></a>00248         cpl_msg_error(__func__, <span class="stringliteral">"Cannot compute photometric solution"</span>) ;
-<a name="l00249"></a>00249         cpl_frameset_delete(std_stars_photom) ;
-<a name="l00250"></a>00250         cpl_msg_indent_less() ;
-<a name="l00251"></a>00251         <span class="keywordflow">return</span> -1 ;
-<a name="l00252"></a>00252     }
-<a name="l00253"></a>00253     cpl_msg_indent_less() ;
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="comment">/* Save the products */</span>
-<a name="l00256"></a>00256     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>);
-<a name="l00257"></a>00257     cpl_msg_indent_more() ;
-<a name="l00258"></a>00258     <span class="keywordflow">if</span> (hawki_util_extinction_save_photsol
-<a name="l00259"></a>00259             (zpoint_tables, std_stars_photom,
-<a name="l00260"></a>00260              parlist, framelist) == -1)
-<a name="l00261"></a>00261     {
-<a name="l00262"></a>00262         cpl_msg_warning(__func__, <span class="stringliteral">"Data could not be saved. "</span>
-<a name="l00263"></a>00263                         <span class="stringliteral">"Check permisions or disk space"</span>) ;
-<a name="l00264"></a>00264         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables) ;
-<a name="l00265"></a>00265         cpl_frameset_delete(std_stars_photom);
-<a name="l00266"></a>00266         cpl_msg_indent_less() ;
-<a name="l00267"></a>00267         <span class="keywordflow">return</span> -1 ;
-<a name="l00268"></a>00268     }
-<a name="l00269"></a>00269     cpl_msg_indent_less() ;
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     <span class="comment">/* Free and return */</span>
-<a name="l00272"></a>00272     cpl_frameset_delete(std_stars_photom);
-<a name="l00273"></a>00273     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables);
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="comment">/* Return */</span>
-<a name="l00276"></a>00276     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;
-<a name="l00277"></a>00277     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00278"></a>00278 }
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00290"></a>00290 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00291"></a>00291 <span class="keyword">static</span> cpl_table ** hawki_util_extinction_photom
-<a name="l00292"></a>00292 (cpl_frameset *   std_stars_photom)
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294 {
-<a name="l00295"></a>00295     cpl_table **        photsol;
-<a name="l00296"></a>00296     <span class="keywordtype">int</span>                 nframes;
-<a name="l00297"></a>00297     <span class="keywordtype">double</span>              extinction;
-<a name="l00298"></a>00298     cpl_bivector    *   iqe_res ;
-<a name="l00299"></a>00299     <span class="keywordtype">int</span>                 iframe;
-<a name="l00300"></a>00300     <span class="keywordtype">int</span>                 idet;
-<a name="l00301"></a>00301     <span class="keywordtype">int</span>                 jdet;
-<a name="l00302"></a>00302     <span class="keywordtype">int</span>                 iext;
-<a name="l00303"></a>00303     <span class="keywordtype">int</span>                 ext_nb;
-<a name="l00304"></a>00304     cpl_frame       *   ref_frame;
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     <span class="comment">/* Test entries */</span>
-<a name="l00307"></a>00307     <span class="keywordflow">if</span> (std_stars_photom == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="comment">/* Initialise */</span>
-<a name="l00310"></a>00310     photsol = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*));
-<a name="l00311"></a>00311     nframes = cpl_frameset_get_size(std_stars_photom) ;
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     <span class="comment">/* Get reference */</span>
-<a name="l00314"></a>00314     ref_frame = cpl_frameset_get_first(std_stars_photom);
-<a name="l00315"></a>00315     nframes = cpl_frameset_get_size(std_stars_photom);
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317     <span class="comment">/* Loop on detectors */</span>
-<a name="l00318"></a>00318     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS; idet++)
-<a name="l00319"></a>00319     {
-<a name="l00320"></a>00320         cpl_table * merged_std_stars_photom;
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322         cpl_msg_info(cpl_func, <span class="stringliteral">"Working on detector %d"</span>, idet +1);
-<a name="l00323"></a>00323         cpl_msg_indent_more();
-<a name="l00324"></a>00324         <span class="comment">/* Get the extension */</span>
-<a name="l00325"></a>00325         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+1);
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327         <span class="comment">/* Load all the tables and merge them */</span>
-<a name="l00328"></a>00328         <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)
-<a name="l00329"></a>00329         {
-<a name="l00330"></a>00330             cpl_frame * this_frame;
-<a name="l00331"></a>00331             cpl_table * this_table;
-<a name="l00332"></a>00332             <span class="comment">/* Get the current image */</span>
-<a name="l00333"></a>00333             this_frame = cpl_frameset_get_frame(std_stars_photom, iframe);
-<a name="l00334"></a>00334             <span class="keywordflow">if</span>(iframe == 0)
-<a name="l00335"></a>00335                 merged_std_stars_photom = cpl_table_load
-<a name="l00336"></a>00336                     (cpl_frame_get_filename(this_frame),ext_nb, 1);
-<a name="l00337"></a>00337             <span class="keywordflow">else</span>
-<a name="l00338"></a>00338             {
-<a name="l00339"></a>00339                 cpl_table * this_table =
-<a name="l00340"></a>00340                         cpl_table_load(cpl_frame_get_filename(this_frame),ext_nb, 1);
-<a name="l00341"></a>00341                 cpl_table_insert(merged_std_stars_photom, this_table,
-<a name="l00342"></a>00342                                  cpl_table_get_nrow(merged_std_stars_photom));
-<a name="l00343"></a>00343                 cpl_table_delete(this_table);
-<a name="l00344"></a>00344             }
-<a name="l00345"></a>00345         }
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347         <span class="keywordflow">if</span>(cpl_table_get_nrow(merged_std_stars_photom) < 2)
-<a name="l00348"></a>00348         {
-<a name="l00349"></a>00349             cpl_msg_error(__func__, <span class="stringliteral">"%d stars found. At least 2 stars must be present"</span>,
-<a name="l00350"></a>00350                     cpl_table_get_nrow(merged_std_stars_photom));
-<a name="l00351"></a>00351             cpl_table_delete(merged_std_stars_photom);
-<a name="l00352"></a>00352             <span class="keywordflow">return</span> NULL;
-<a name="l00353"></a>00353         }
-<a name="l00354"></a>00354         cpl_msg_info(__func__,<span class="stringliteral">"Number of star measurements %d"</span>,
-<a name="l00355"></a>00355                      cpl_table_get_nrow(merged_std_stars_photom));
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357         <span class="keywordflow">if</span>((photsol[idet] = hawki_util_extinction_get_photomsol
-<a name="l00358"></a>00358                 (merged_std_stars_photom)) == NULL)
-<a name="l00359"></a>00359         {
-<a name="l00360"></a>00360             cpl_table_delete(merged_std_stars_photom);
-<a name="l00361"></a>00361             <span class="keywordflow">for</span>(jdet=0; jdet < idet; jdet++)
-<a name="l00362"></a>00362                 cpl_table_delete(photsol[jdet]);
-<a name="l00363"></a>00363             cpl_free(photsol);
-<a name="l00364"></a>00364             <span class="keywordflow">return</span> NULL;
-<a name="l00365"></a>00365         }
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367         cpl_table_delete(merged_std_stars_photom);
-<a name="l00368"></a>00368         cpl_msg_indent_less();
-<a name="l00369"></a>00369     }
-<a name="l00370"></a>00370     <span class="keywordflow">return</span> photsol;
-<a name="l00371"></a>00371 }
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373 <span class="keyword">static</span> cpl_table * hawki_util_extinction_get_photomsol
-<a name="l00374"></a>00374 (cpl_table * std_stars_photom)
-<a name="l00375"></a>00375 {
-<a name="l00376"></a>00376     <span class="keyword">const</span> <span class="keywordtype">double</span>    * instrmag;
-<a name="l00377"></a>00377     <span class="keyword">const</span> <span class="keywordtype">double</span>    * airmass;
-<a name="l00378"></a>00378     <span class="keyword">const</span> <span class="keywordtype">double</span>    * catmag;
-<a name="l00379"></a>00379     cpl_table       * photsol;
-<a name="l00380"></a>00380     <span class="keywordtype">double</span>            zeropoint;
-<a name="l00381"></a>00381     <span class="keywordtype">double</span>            extcoeff;
-<a name="l00382"></a>00382     cpl_matrix      * xpos;
-<a name="l00383"></a>00383     cpl_vector      * ypos;
-<a name="l00384"></a>00384     cpl_polynomial  * phot_coeff;
-<a name="l00385"></a>00385     <span class="keywordtype">int</span>               nstars;
-<a name="l00386"></a>00386     <span class="keywordtype">int</span>               istar;
-<a name="l00387"></a>00387     <span class="keyword">const</span> cpl_boolean sampsym = CPL_TRUE;
-<a name="l00388"></a>00388     <span class="keyword">const</span> cpl_size         mindeg1d = 0;
-<a name="l00389"></a>00389     <span class="keyword">const</span> cpl_size         maxdeg1d = 1;
-<a name="l00390"></a>00390     cpl_size               pows;
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     nstars = cpl_table_get_nrow(std_stars_photom);
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     photsol = cpl_table_new(1);
-<a name="l00396"></a>00396     instrmag = cpl_table_get_data_double_const
-<a name="l00397"></a>00397             (std_stars_photom, HAWKI_COL_ZPOINT_INSTRMAG);
-<a name="l00398"></a>00398     airmass = cpl_table_get_data_double_const
-<a name="l00399"></a>00399             (std_stars_photom, HAWKI_COL_ZPOINT_AIRMASS);
-<a name="l00400"></a>00400     catmag = cpl_table_get_data_double_const
-<a name="l00401"></a>00401             (std_stars_photom, HAWKI_COL_ZPOINT_STARMAG);
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     <span class="keywordflow">if</span>(instrmag == NULL || airmass == NULL || catmag == NULL)
-<a name="l00404"></a>00404     {
-<a name="l00405"></a>00405         cpl_msg_error(cpl_func, <span class="stringliteral">"Some of the following columns not found "</span>
-<a name="l00406"></a>00406                       <span class="stringliteral">"in table: %s, %s, %s"</span>, HAWKI_COL_ZPOINT_INSTRMAG,
-<a name="l00407"></a>00407                       HAWKI_COL_ZPOINT_AIRMASS, HAWKI_COL_ZPOINT_STARMAG);
-<a name="l00408"></a>00408         cpl_table_delete(photsol);
-<a name="l00409"></a>00409         <span class="keywordflow">return</span> NULL;
-<a name="l00410"></a>00410     }
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     cpl_table_new_column(photsol, HAWKI_COL_PHOT_FILTER, CPL_TYPE_STRING);
-<a name="l00413"></a>00413     cpl_table_new_column(photsol, HAWKI_COL_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00414"></a>00414     cpl_table_set_column_unit(photsol,HAWKI_COL_PHOT_ZEROPOINT,<span class="stringliteral">"mag"</span>);
-<a name="l00415"></a>00415     cpl_table_new_column(photsol, HAWKI_COL_PHOT_EXTCOEFF, CPL_TYPE_DOUBLE);
-<a name="l00416"></a>00416     cpl_table_set_column_unit(photsol,HAWKI_COL_PHOT_EXTCOEFF,<span class="stringliteral">"mag/airmass"</span>);
-<a name="l00417"></a>00417         
-<a name="l00418"></a>00418     <span class="comment">/* Make the fit to get the coefficients */</span>
-<a name="l00419"></a>00419     xpos = cpl_matrix_new(1, nstars);
-<a name="l00420"></a>00420     ypos = cpl_vector_new(nstars);
-<a name="l00421"></a>00421     <span class="keywordflow">for</span>(istar = 0; istar < nstars; ++istar)
-<a name="l00422"></a>00422     {
-<a name="l00423"></a>00423         <span class="keywordtype">double</span> y;
-<a name="l00424"></a>00424         cpl_matrix_set(xpos, 0, istar, airmass[istar]);
-<a name="l00425"></a>00425         y = catmag[istar] + instrmag[istar];
-<a name="l00426"></a>00426         cpl_vector_set(ypos, istar, y);
-<a name="l00427"></a>00427     }
-<a name="l00428"></a>00428     <span class="comment">/* phot_coeff[0] --> ZP</span>
-<a name="l00429"></a>00429 <span class="comment">     * phot_coeff[1] --> -extcoeff</span>
-<a name="l00430"></a>00430 <span class="comment">     */</span>
-<a name="l00431"></a>00431     phot_coeff = cpl_polynomial_new(1);
-<a name="l00432"></a>00432     <span class="keywordflow">if</span>(cpl_polynomial_fit(phot_coeff, xpos, NULL, ypos, NULL,
-<a name="l00433"></a>00433                           CPL_FALSE, &mindeg1d, &maxdeg1d) != CPL_ERROR_NONE)
-<a name="l00434"></a>00434     {
-<a name="l00435"></a>00435         cpl_msg_error(cpl_func,<span class="stringliteral">"Cannot get the photometric solution"</span>);
-<a name="l00436"></a>00436         cpl_table_delete(photsol);
-<a name="l00437"></a>00437         <span class="keywordflow">return</span> NULL;
-<a name="l00438"></a>00438     }
-<a name="l00439"></a>00439     cpl_matrix_delete(xpos);
-<a name="l00440"></a>00440     cpl_vector_delete(ypos);
-<a name="l00441"></a>00441     pows = 0;
-<a name="l00442"></a>00442     zeropoint = cpl_polynomial_get_coeff(phot_coeff, &pows);
-<a name="l00443"></a>00443     pows = 1;
-<a name="l00444"></a>00444     extcoeff  = -cpl_polynomial_get_coeff(phot_coeff, &pows);
-<a name="l00445"></a>00445     cpl_polynomial_delete(phot_coeff);
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     cpl_table_set_double(photsol, HAWKI_COL_PHOT_ZEROPOINT, 0,
-<a name="l00448"></a>00448                          zeropoint);
-<a name="l00449"></a>00449     cpl_table_set_double(photsol, HAWKI_COL_PHOT_EXTCOEFF, 0,
-<a name="l00450"></a>00450                          extcoeff);
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     <span class="comment">/* Output results */</span>
-<a name="l00453"></a>00453     cpl_msg_indent_more();
-<a name="l00454"></a>00454     cpl_msg_info(__func__, <span class="stringliteral">"Zero point: %f"</span>, zeropoint);
-<a name="l00455"></a>00455     cpl_msg_info(__func__, <span class="stringliteral">"Extinction coefficient: %f"</span>, extcoeff);
-<a name="l00456"></a>00456     cpl_msg_indent_less();
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="keywordflow">return</span> photsol;
-<a name="l00459"></a>00459 }
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00470"></a>00470 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00471"></a>00471 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_save_photsol
-<a name="l00472"></a>00472 (cpl_table           **  photsol_table,
-<a name="l00473"></a>00473  cpl_frameset        *   zpoint_frames,
-<a name="l00474"></a>00474  cpl_parameterlist   *   parlist,
-<a name="l00475"></a>00475  cpl_frameset        *   <span class="keyword">set</span>)
-<a name="l00476"></a>00476 {
-<a name="l00477"></a>00477     cpl_propertylist    **  qclists ;
-<a name="l00478"></a>00478     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   ref_filename;
-<a name="l00479"></a>00479     cpl_propertylist    *   inputlist ;
-<a name="l00480"></a>00480     <span class="keywordtype">int</span>                     ext_nb, nframes ;
-<a name="l00481"></a>00481     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_util_extinction"</span> ;
-<a name="l00482"></a>00482     <span class="keywordtype">int</span>                     idet;
-<a name="l00483"></a>00483     <span class="keywordtype">int</span>                     iframe;
-<a name="l00484"></a>00484     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="comment">/* Initialise */</span>
-<a name="l00488"></a>00488     nframes = cpl_frameset_get_size(<span class="keyword">set</span>) ;
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490     <span class="comment">/* Get the reference frame */</span>
-<a name="l00491"></a>00491     ref_filename = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <--> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">set</span>);
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493     <span class="comment">/* Create the QC lists for the extensions */</span>
-<a name="l00494"></a>00494     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;
-<a name="l00495"></a>00495     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00496"></a>00496     {
-<a name="l00497"></a>00497         <span class="keywordtype">int</span>            this_iframe = -1;
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499         qclists[idet] = cpl_propertylist_new() ;
-<a name="l00500"></a>00500         <span class="comment">/* These QC are common to all extensions */</span>
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503         <span class="comment">/* Propagate some keywords from input raw frame extensions */</span>
-<a name="l00504"></a>00504         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(ref_filename, idet+1);
-<a name="l00505"></a>00505         inputlist = cpl_propertylist_load_regexp(ref_filename, ext_nb,
-<a name="l00506"></a>00506                 HAWKI_HEADER_EXT_FORWARD, 0) ;
-<a name="l00507"></a>00507         cpl_propertylist_append(qclists[idet], inputlist) ;
-<a name="l00508"></a>00508         cpl_propertylist_delete(inputlist) ;
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     }
-<a name="l00511"></a>00511     
-<a name="l00512"></a>00512     <span class="comment">/* Write the photometric table  */</span>
-<a name="l00513"></a>00513     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,
-<a name="l00514"></a>00514                       parlist,
-<a name="l00515"></a>00515                       zpoint_frames,
-<a name="l00516"></a>00516                       (<span class="keyword">const</span> cpl_table **)photsol_table,
-<a name="l00517"></a>00517                       recipe_name,
-<a name="l00518"></a>00518                       HAWKI_CALPRO_PHOT_TAB,
-<a name="l00519"></a>00519                       HAWKI_PROTYPE_PHOT_TAB,
-<a name="l00520"></a>00520                       NULL,
-<a name="l00521"></a>00521                       (<span class="keyword">const</span> cpl_propertylist **)qclists,
-<a name="l00522"></a>00522                       <span class="stringliteral">"hawki_util_extinction.fits"</span>);
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     <span class="comment">/* Free */</span>
-<a name="l00525"></a>00525     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {
-<a name="l00526"></a>00526         cpl_propertylist_delete(qclists[idet]) ;
-<a name="l00527"></a>00527     }
-<a name="l00528"></a>00528     cpl_free(qclists) ;
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     <span class="comment">/* Free */</span>
-<a name="l00531"></a>00531     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))
-<a name="l00532"></a>00532     {
-<a name="l00533"></a>00533         cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00534"></a>00534         <span class="keywordflow">return</span> -1;
-<a name="l00535"></a>00535     }
-<a name="l00536"></a>00536     <span class="keywordflow">return</span>  0;
-<a name="l00537"></a>00537 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_util_extinction.c,v 1.4 2013/03/11 11:03:00 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/03/11 11:03:00 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include "irplib_strehl.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "irplib_stdstar.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "irplib_cat.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">#include "hawki_utils.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_calib.h"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include "hawki_save.h"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#include "hawki_alloc.h"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">                            Functions prototypes</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="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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">int</span> hawki_util_extinction_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction(cpl_parameterlist *, cpl_frameset *) ;</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> cpl_table ** hawki_util_extinction_reduce</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> (cpl_frameset    *   <span class="keyword">set</span>,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   stdstars,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   bpm,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>      *   flat,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>  cpl_table       **  raw_zpoint_stats,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="keywordtype">int</span>             *   star_labels,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  <span class="keywordtype">int</span>             *   det_labels,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  cpl_imagelist   **  images);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_save_photsol</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> (cpl_table           **  photsol_table,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  cpl_frameset        *   zpoint_frames,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>  cpl_frameset        *   <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keyword">static</span> cpl_table ** hawki_util_extinction_photom</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> (cpl_frameset *   std_stars_photom);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keyword">static</span> cpl_table * hawki_util_extinction_get_photomsol</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> (cpl_table * std_stars_photom);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_compute_keywords</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> (cpl_frameset * <span class="keyword">set</span>, </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>  <span class="keywordtype">int</span>          * det_labels);</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="comment">                            Static variables</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> </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="keyword">static</span> <span class="keywordtype">char</span> hawki_util_extinction_description[] =</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"hawki_util_extinction -- Zero point recipe with extinction\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"The input of the recipe files listed in the Set Of Frames (sof-file)\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"must be tagged as:\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"hawki_util_extinction.fits ("</span>HAWKI_CALPRO_ZPOINT_TAB<span class="stringliteral">"): Zero point solution table\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"The recipe creates as an output:\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"hawki_cal_photom.fits ("</span>HAWKI_CALPRO_PHOT_TAB<span class="stringliteral">"): Photometric solution\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"Return code:\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"esorex exits with an error code of 0 if the recipe completes successfully\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"or 1 otherwise"</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="l00106"></a><span class="lineno">  106</span> <span class="comment">                                Functions code</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="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="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     cpl_plugin  *   plugin = &recipe->interface ;</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>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     <span class="stringliteral">"hawki_util_extinction"</span>,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     <span class="stringliteral">"Zero point with extinction computation recipe"</span>,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     hawki_util_extinction_description,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     <span class="stringliteral">"cgarcia at eso.org"</span>,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                     hawki_util_extinction_create,</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                     hawki_util_extinction_exec,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                     hawki_util_extinction_destroy) ;</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_pluginlist_append(list, plugin) ;</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> 0;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_create(cpl_plugin * plugin)</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>     cpl_recipe      * recipe ;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">else</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</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">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordflow">else</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="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_util_extinction(recipe->parameters, recipe->frames) ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_destroy(cpl_plugin * plugin)</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_recipe  *   recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction(</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         cpl_frameset        *   framelist)</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_frameset    *   std_stars_photom ;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_table       **  zpoint_tables;</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">/* Initialise Output */</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     std_stars_photom = 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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve zpoint tables */</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordflow">if</span> ((std_stars_photom = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>             (framelist, HAWKI_CALPRO_ZPOINT_TAB)) == NULL)</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_msg_error(__func__, <span class="stringliteral">"Cannot find std stars info (%s)"</span>,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                       HAWKI_CALPRO_ZPOINT_TAB);</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> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="comment">/* Compute the zpoint values */</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_msg_info(__func__, <span class="stringliteral">"Reduce the data"</span>) ;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordflow">if</span> ((zpoint_tables = hawki_util_extinction_photom(std_stars_photom))==NULL)</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_msg_error(__func__, <span class="stringliteral">"Cannot compute photometric solution"</span>) ;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>         cpl_frameset_delete(std_stars_photom) ;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         <span class="keywordflow">return</span> -1 ;</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_msg_indent_less() ;</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">/* Save the products */</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_msg_info(__func__, <span class="stringliteral">"Save the products"</span>);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_msg_indent_more() ;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="keywordflow">if</span> (hawki_util_extinction_save_photsol</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>             (zpoint_tables, std_stars_photom,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>              parlist, framelist) == -1)</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_warning(__func__, <span class="stringliteral">"Data could not be saved. "</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                         <span class="stringliteral">"Check permisions or disk space"</span>) ;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables) ;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         cpl_frameset_delete(std_stars_photom);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         cpl_msg_indent_less() ;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         <span class="keywordflow">return</span> -1 ;</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_msg_indent_less() ;</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="comment">/* Free and return */</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_frameset_delete(std_stars_photom);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <a class="code" href="group__hawki__alloc.html#ga2c7746115db289a6cea907e2025d93bd" title="Deallocates a set of four tables.">hawki_table_delete</a>(zpoint_tables);</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">/* Return */</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_table ** hawki_util_extinction_photom</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> (cpl_frameset *   std_stars_photom)</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>     cpl_table **        photsol;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordtype">int</span>                 nframes;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="keywordtype">double</span>              extinction;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_bivector    *   iqe_res ;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordtype">int</span>                 iframe;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordtype">int</span>                 idet;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keywordtype">int</span>                 jdet;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordtype">int</span>                 iext;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordtype">int</span>                 ext_nb;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_frame       *   ref_frame;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keywordflow">if</span> (std_stars_photom == NULL) <span class="keywordflow">return</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     photsol = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*));</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     nframes = cpl_frameset_get_size(std_stars_photom) ;</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">/* Get reference */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     ref_frame = cpl_frameset_get_first(std_stars_photom);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     nframes = cpl_frameset_get_size(std_stars_photom);</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">/* Loop on detectors */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS; idet++)</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>         cpl_table * merged_std_stars_photom;</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_msg_info(cpl_func, <span class="stringliteral">"Working on detector %d"</span>, idet +1);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="comment">/* Get the extension */</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(cpl_frame_get_filename(ref_frame), idet+1);</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">/* Load all the tables and merge them */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>         <span class="keywordflow">for</span>( iframe = 0 ; iframe < nframes ; ++iframe)</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_frame * this_frame;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>             cpl_table * this_table;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>             <span class="comment">/* Get the current image */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>             this_frame = cpl_frameset_get_frame(std_stars_photom, iframe);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>             <span class="keywordflow">if</span>(iframe == 0)</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                 merged_std_stars_photom = cpl_table_load</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                     (cpl_frame_get_filename(this_frame),ext_nb, 1);</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>             {</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                 cpl_table * this_table =</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                         cpl_table_load(cpl_frame_get_filename(this_frame),ext_nb, 1);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                 cpl_table_insert(merged_std_stars_photom, this_table,</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                                  cpl_table_get_nrow(merged_std_stars_photom));</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                 cpl_table_delete(this_table);</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> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         <span class="keywordflow">if</span>(cpl_table_get_nrow(merged_std_stars_photom) < 2)</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_error(__func__, <span class="stringliteral">"%d stars found. At least 2 stars must be present"</span>,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                     cpl_table_get_nrow(merged_std_stars_photom));</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>             cpl_table_delete(merged_std_stars_photom);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>             <span class="keywordflow">return</span> 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>         cpl_msg_info(__func__,<span class="stringliteral">"Number of star measurements %d"</span>,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                      cpl_table_get_nrow(merged_std_stars_photom));</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>((photsol[idet] = hawki_util_extinction_get_photomsol</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                 (merged_std_stars_photom)) == 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>             cpl_table_delete(merged_std_stars_photom);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>             <span class="keywordflow">for</span>(jdet=0; jdet < idet; jdet++)</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                 cpl_table_delete(photsol[jdet]);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>             cpl_free(photsol);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>             <span class="keywordflow">return</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> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         cpl_table_delete(merged_std_stars_photom);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>         cpl_msg_indent_less();</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="keywordflow">return</span> photsol;</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> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="keyword">static</span> cpl_table * hawki_util_extinction_get_photomsol</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> (cpl_table * std_stars_photom)</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">double</span>    * instrmag;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>    * airmass;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> <span class="keywordtype">double</span>    * catmag;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_table       * photsol;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordtype">double</span>            zeropoint;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordtype">double</span>            extcoeff;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     cpl_matrix      * xpos;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cpl_vector      * ypos;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     cpl_polynomial  * phot_coeff;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="keywordtype">int</span>               nstars;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="keywordtype">int</span>               istar;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keyword">const</span> cpl_boolean sampsym = CPL_TRUE;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keyword">const</span> cpl_size         mindeg1d = 0;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keyword">const</span> cpl_size         maxdeg1d = 1;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_size               pows;</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>     nstars = cpl_table_get_nrow(std_stars_photom);</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>     photsol = cpl_table_new(1);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     instrmag = cpl_table_get_data_double_const</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             (std_stars_photom, HAWKI_COL_ZPOINT_INSTRMAG);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     airmass = cpl_table_get_data_double_const</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>             (std_stars_photom, HAWKI_COL_ZPOINT_AIRMASS);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     catmag = cpl_table_get_data_double_const</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>             (std_stars_photom, HAWKI_COL_ZPOINT_STARMAG);</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>(instrmag == NULL || airmass == NULL || catmag == 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>         cpl_msg_error(cpl_func, <span class="stringliteral">"Some of the following columns not found "</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                       <span class="stringliteral">"in table: %s, %s, %s"</span>, HAWKI_COL_ZPOINT_INSTRMAG,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                       HAWKI_COL_ZPOINT_AIRMASS, HAWKI_COL_ZPOINT_STARMAG);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         cpl_table_delete(photsol);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <span class="keywordflow">return</span> 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> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_table_new_column(photsol, HAWKI_COL_PHOT_FILTER, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_table_new_column(photsol, HAWKI_COL_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_table_set_column_unit(photsol,HAWKI_COL_PHOT_ZEROPOINT,<span class="stringliteral">"mag"</span>);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_table_new_column(photsol, HAWKI_COL_PHOT_EXTCOEFF, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_table_set_column_unit(photsol,HAWKI_COL_PHOT_EXTCOEFF,<span class="stringliteral">"mag/airmass"</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="comment">/* Make the fit to get the coefficients */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     xpos = cpl_matrix_new(1, nstars);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     ypos = cpl_vector_new(nstars);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">for</span>(istar = 0; istar < nstars; ++istar)</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="keywordtype">double</span> y;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         cpl_matrix_set(xpos, 0, istar, airmass[istar]);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         y = catmag[istar] + instrmag[istar];</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         cpl_vector_set(ypos, istar, y);</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">/* phot_coeff[0] --> ZP</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment">     * phot_coeff[1] --> -extcoeff</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>     phot_coeff = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordflow">if</span>(cpl_polynomial_fit(phot_coeff, xpos, NULL, ypos, NULL,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                           CPL_FALSE, &mindeg1d, &maxdeg1d) != CPL_ERROR_NONE)</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_msg_error(cpl_func,<span class="stringliteral">"Cannot get the photometric solution"</span>);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         cpl_table_delete(photsol);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         <span class="keywordflow">return</span> 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>     cpl_matrix_delete(xpos);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_vector_delete(ypos);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     pows = 0;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     zeropoint = cpl_polynomial_get_coeff(phot_coeff, &pows);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     pows = 1;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     extcoeff  = -cpl_polynomial_get_coeff(phot_coeff, &pows);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_polynomial_delete(phot_coeff);</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_table_set_double(photsol, HAWKI_COL_PHOT_ZEROPOINT, 0,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                          zeropoint);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_table_set_double(photsol, HAWKI_COL_PHOT_EXTCOEFF, 0,</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                          extcoeff);</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">/* Output results */</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     cpl_msg_info(__func__, <span class="stringliteral">"Zero point: %f"</span>, zeropoint);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_msg_info(__func__, <span class="stringliteral">"Extinction coefficient: %f"</span>, extcoeff);</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>     <span class="keywordflow">return</span> photsol;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_extinction_save_photsol</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> (cpl_table           **  photsol_table,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>  cpl_frameset        *   zpoint_frames,</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>  cpl_parameterlist   *   parlist,</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>  cpl_frameset        *   <span class="keyword">set</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    **  qclists ;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   ref_filename;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     cpl_propertylist    *   inputlist ;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordtype">int</span>                     ext_nb, nframes ;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_util_extinction"</span> ;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <span class="keywordtype">int</span>                     idet;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordtype">int</span>                     iframe;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</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">/* Get the reference frame */</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     ref_filename = <a class="code" href="group__hawki__save.html#gab9a3907dcbad413de986ee2e286a6536" title="Locate a filename where the extension <–> chip id relation can be derived.">hawki_get_extref_file</a>(<span class="keyword">set</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">/* Create the QC lists for the extensions */</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     qclists = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_propertylist*)) ;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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">int</span>            this_iframe = -1;</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>         qclists[idet] = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         <span class="comment">/* These QC are common to all extensions */</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="comment">/* Propagate some keywords from input raw frame extensions */</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         ext_nb=<a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(ref_filename, idet+1);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         inputlist = cpl_propertylist_load_regexp(ref_filename, ext_nb,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                 HAWKI_HEADER_EXT_FORWARD, 0) ;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         cpl_propertylist_append(qclists[idet], inputlist) ;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         cpl_propertylist_delete(inputlist) ;</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>     <span class="comment">/* Write the photometric table  */</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <a class="code" href="group__hawki__save.html#ga6c4661fb9fa1fe2e8335f2ebb4deeab9" title="Save a HAWKI_NB_DETECTORS extensions HAWKI table.">hawki_tables_save</a>(<span class="keyword">set</span>,</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                       parlist,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                       zpoint_frames,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                       (<span class="keyword">const</span> cpl_table **)photsol_table,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                       recipe_name,</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                       HAWKI_CALPRO_PHOT_TAB,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                       HAWKI_PROTYPE_PHOT_TAB,</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>                       NULL,</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>                       (<span class="keyword">const</span> cpl_propertylist **)qclists,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                       <span class="stringliteral">"hawki_util_extinction.fits"</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="comment">/* Free */</span></div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++) {</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         cpl_propertylist_delete(qclists[idet]) ;</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_free(qclists) ;</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">/* Free */</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate))</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_errorstate_set(CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         <span class="keywordflow">return</span> -1;</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">return</span>  0;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</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/hawki__util__gendist_8c_source.html b/html/hawki__util__gendist_8c_source.html
index 9ea2d68..5d978c9 100644
--- a/html/hawki__util__gendist_8c_source.html
+++ b/html/hawki__util__gendist_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_util_gendist.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,552 +40,558 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_util_gendist.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_util_gendist.c,v 1.22 2011/10/24 10:40:50 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 10:40:50 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.22 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_distortion.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_save.h"</span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 <span class="comment">                            Functions prototypes</span>
-<a name="l00050"></a>00050 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_create(cpl_plugin *) ;
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_exec(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_destroy(cpl_plugin *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist(cpl_parameterlist *, cpl_frameset *) ;
-<a name="l00056"></a>00056 <span class="keyword">static</span> cpl_table * hawki_util_gendist_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> *) ; 
-<a name="l00057"></a>00057 <span class="keyword">static</span> hawki_distortion * hawki_util_gendist_convert_to_images
-<a name="l00058"></a>00058 (<span class="keyword">const</span> cpl_table * dist_tab,
-<a name="l00059"></a>00059  <span class="keywordtype">int</span>               detector_nx,
-<a name="l00060"></a>00060  <span class="keywordtype">int</span>               detector_ny); 
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00063"></a>00063 <span class="comment">                            Static variables</span>
-<a name="l00064"></a>00064 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_util_gendist_description[] = 
-<a name="l00067"></a>00067 <span class="stringliteral">"hawki_util_gendist -- HAWK-I distortion calibration file creation.\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"The 4 files (chip 1 2 3 4) listed in the Set Of Frames (sof-file) \n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"must be tagged:\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"raw-file_chip1.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"raw-file_chip2.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"raw-file_chip3.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"raw-file_chip4.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span> ;
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00076"></a>00076 <span class="comment">                                Functions code</span>
-<a name="l00077"></a>00077 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00087"></a>00087 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<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                     HAWKI_BINARY_VERSION,
-<a name="l00096"></a>00096                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00097"></a>00097                     <span class="stringliteral">"hawki_util_gendist"</span>,
-<a name="l00098"></a>00098                     <span class="stringliteral">"Distortion map creation"</span>,
-<a name="l00099"></a>00099                     hawki_util_gendist_description,
-<a name="l00100"></a>00100                     <span class="stringliteral">"Yves Jung"</span>,
-<a name="l00101"></a>00101                     PACKAGE_BUGREPORT,  
-<a name="l00102"></a>00102                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00103"></a>00103                     hawki_util_gendist_create,
-<a name="l00104"></a>00104                     hawki_util_gendist_exec,
-<a name="l00105"></a>00105                     hawki_util_gendist_destroy) ;
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     cpl_pluginlist_append(list, plugin) ;
-<a name="l00108"></a>00108     
-<a name="l00109"></a>00109     <span class="keywordflow">return</span> 0;
-<a name="l00110"></a>00110 }
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00121"></a>00121 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00122"></a>00122 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_create(cpl_plugin * plugin)
-<a name="l00123"></a>00123 {
-<a name="l00124"></a>00124     cpl_recipe      * recipe ;
-<a name="l00125"></a>00125     cpl_parameter   * p ;
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00128"></a>00128     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00129"></a>00129         recipe = (cpl_recipe *)plugin ;
-<a name="l00130"></a>00130     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00133"></a>00133     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00134"></a>00134     <span class="keywordflow">if</span> (recipe->parameters == NULL)
-<a name="l00135"></a>00135         <span class="keywordflow">return</span> 1;
-<a name="l00136"></a>00136     
-<a name="l00137"></a>00137     <span class="comment">/* Fill the parameters list */</span>
-<a name="l00138"></a>00138     <span class="comment">/* --dim_x */</span>
-<a name="l00139"></a>00139     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_util_gendist.dim_x"</span>,
-<a name="l00140"></a>00140             CPL_TYPE_INT, <span class="stringliteral">"Dimension of distortion image in X"</span>,
-<a name="l00141"></a>00141             <span class="stringliteral">"hawki.hawki_util_gendist"</span>, HAWKI_DET_NPIX_X);
-<a name="l00142"></a>00142     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dim_x"</span>);
-<a name="l00143"></a>00143     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00144"></a>00144     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146     <span class="comment">/* --dim_y */</span>
-<a name="l00147"></a>00147     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_util_gendist.dim_y"</span>,
-<a name="l00148"></a>00148             CPL_TYPE_INT, <span class="stringliteral">"Dimension of distortion image in Y"</span>,
-<a name="l00149"></a>00149             <span class="stringliteral">"hawki.hawki_util_gendist"</span>, HAWKI_DET_NPIX_Y);
-<a name="l00150"></a>00150     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dim_y"</span>);
-<a name="l00151"></a>00151     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00152"></a>00152     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* Return */</span>
-<a name="l00156"></a>00156     <span class="keywordflow">return</span> 0;
-<a name="l00157"></a>00157 }
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00165"></a>00165 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00166"></a>00166 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_exec(cpl_plugin * plugin)
-<a name="l00167"></a>00167 {
-<a name="l00168"></a>00168     cpl_recipe  *   recipe ;
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     <span class="comment">/* Issue a banner */</span>
-<a name="l00176"></a>00176     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">return</span> hawki_util_gendist(recipe->parameters, recipe->frames) ;
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00187"></a>00187 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00188"></a>00188 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_destroy(cpl_plugin * plugin)
-<a name="l00189"></a>00189 {
-<a name="l00190"></a>00190     cpl_recipe  *   recipe ;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* Get the recipe out of the plugin */</span>
-<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> <span class="keywordflow">return</span> -1 ;
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     cpl_parameterlist_delete(recipe->parameters) ;
-<a name="l00198"></a>00198     <span class="keywordflow">return</span> 0 ;
-<a name="l00199"></a>00199 }
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00207"></a>00207 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00208"></a>00208 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist
-<a name="l00209"></a>00209 (cpl_parameterlist   *   parlist, 
-<a name="l00210"></a>00210  cpl_frameset        *   framelist)
-<a name="l00211"></a>00211 {
-<a name="l00212"></a>00212     cpl_frameset         * rawframes;
-<a name="l00213"></a>00213     <span class="keyword">const</span> cpl_frame      * cur_frame;
-<a name="l00214"></a>00214     <span class="keyword">const</span> <span class="keywordtype">char</span>           * dist_name;
-<a name="l00215"></a>00215     cpl_table           ** distortion_table;
-<a name="l00216"></a>00216     hawki_distortion    ** distortion_im;
-<a name="l00217"></a>00217     cpl_propertylist     * plist;
-<a name="l00218"></a>00218     cpl_propertylist     * plist_ext;
-<a name="l00219"></a>00219     <span class="keywordtype">char</span>                   sval[64];
-<a name="l00220"></a>00220     <span class="keyword">const</span> <span class="keywordtype">char</span>           * recipe_name = <span class="stringliteral">"hawki_util_gendist"</span>;
-<a name="l00221"></a>00221     <span class="keywordtype">int</span>                    iext;
-<a name="l00222"></a>00222     <span class="keywordtype">int</span>                    ichip;
-<a name="l00223"></a>00223     cpl_parameter        * par;
-<a name="l00224"></a>00224     <span class="keywordtype">int</span>                    dim_x;
-<a name="l00225"></a>00225     <span class="keywordtype">int</span>                    dim_y;
-<a name="l00226"></a>00226     
-<a name="l00227"></a>00227     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00228"></a>00228     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00229"></a>00229         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00230"></a>00230         <span class="keywordflow">return</span> -1 ;
-<a name="l00231"></a>00231     }
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00234"></a>00234     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,
-<a name="l00235"></a>00235                     HAWKI_UTIL_DISTMAP_RAW)) == NULL) {
-<a name="l00236"></a>00236         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list"</span>) ;
-<a name="l00237"></a>00237         <span class="keywordflow">return</span> -1 ;
-<a name="l00238"></a>00238     }
-<a name="l00239"></a>00239     
-<a name="l00240"></a>00240     <span class="comment">/* There should be HAWKI_NB_DETECTORS input frames ordered  */</span>
-<a name="l00241"></a>00241     <span class="keywordflow">if</span> (cpl_frameset_get_size(rawframes) != HAWKI_NB_DETECTORS) {
-<a name="l00242"></a>00242         cpl_msg_error(__func__, <span class="stringliteral">"%d frames expected"</span>, HAWKI_NB_DETECTORS) ;
-<a name="l00243"></a>00243         cpl_frameset_delete(rawframes) ;
-<a name="l00244"></a>00244         <span class="keywordflow">return</span> -1 ;
-<a name="l00245"></a>00245     }
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     <span class="comment">/* Retrieve parameters */</span>
-<a name="l00248"></a>00248     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_util_gendist.dim_x"</span>) ;
-<a name="l00249"></a>00249     dim_x = cpl_parameter_get_int(par);
-<a name="l00250"></a>00250     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_util_gendist.dim_y"</span>) ;
-<a name="l00251"></a>00251     dim_y = cpl_parameter_get_int(par);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/* Allocate holder for the tables */</span>
-<a name="l00254"></a>00254     distortion_table = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*)) ;
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     <span class="comment">/* Loop on the chips */</span>
-<a name="l00257"></a>00257     <span class="keywordflow">for</span> (ichip=0 ; ichip<HAWKI_NB_DETECTORS ; ichip++) {
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259         <span class="comment">/* Get the file name */</span>
-<a name="l00260"></a>00260         cur_frame = cpl_frameset_get_frame_const(rawframes, ichip) ;
-<a name="l00261"></a>00261         dist_name = cpl_frame_get_filename(cur_frame) ;
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263         <span class="comment">/* Create the output table */</span>
-<a name="l00264"></a>00264         cpl_msg_info(__func__, <span class="stringliteral">"Create the output table for chip %d"</span>, ichip+1) ;
-<a name="l00265"></a>00265         <span class="keywordflow">if</span> ((distortion_table[ichip] = hawki_util_gendist_convert(dist_name)) == NULL) {
-<a name="l00266"></a>00266             <span class="keywordtype">int</span> j;
-<a name="l00267"></a>00267             cpl_msg_error(__func__, <span class="stringliteral">"Cannot create the output table"</span>) ;
-<a name="l00268"></a>00268             cpl_frameset_delete(rawframes) ;
-<a name="l00269"></a>00269             <span class="keywordflow">for</span> (j=0 ; j<ichip ; j++) cpl_table_delete(distortion_table[j]) ;
-<a name="l00270"></a>00270             cpl_free(distortion_table) ;
-<a name="l00271"></a>00271             <span class="keywordflow">return</span> -1 ;
-<a name="l00272"></a>00272         }
-<a name="l00273"></a>00273     }
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="comment">/* Write the table */</span>
-<a name="l00276"></a>00276     plist = cpl_propertylist_new() ;
-<a name="l00277"></a>00277     cpl_propertylist_append_string(plist, <span class="stringliteral">"INSTRUME"</span>, <span class="stringliteral">"HAWKI"</span>) ;
-<a name="l00278"></a>00278     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,
-<a name="l00279"></a>00279                                    HAWKI_PROTYPE_DISTORTION) ;
-<a name="l00280"></a>00280     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,
-<a name="l00281"></a>00281                                    HAWKI_CALPRO_DISTORTION) ;
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     plist_ext = cpl_propertylist_new() ;
-<a name="l00284"></a>00284     cpl_propertylist_prepend_string(plist_ext, <span class="stringliteral">"EXTNAME"</span>, <span class="stringliteral">"CHIP1.INT1"</span>) ;
-<a name="l00285"></a>00285     <span class="keywordflow">if</span> (cpl_dfs_save_table(framelist, NULL, parlist, rawframes, NULL, 
-<a name="l00286"></a>00286                            distortion_table[0], plist_ext, recipe_name,
-<a name="l00287"></a>00287                            plist, NULL, PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00288"></a>00288                 <span class="stringliteral">"hawki_util_gendist.fits"</span>) != CPL_ERROR_NONE) {
-<a name="l00289"></a>00289         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the first extension table"</span>) ;
-<a name="l00290"></a>00290         cpl_propertylist_delete(plist_ext) ;
-<a name="l00291"></a>00291         cpl_propertylist_delete(plist) ;
-<a name="l00292"></a>00292         <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) 
-<a name="l00293"></a>00293             cpl_table_delete(distortion_table[iext]) ;
-<a name="l00294"></a>00294         cpl_free(distortion_table) ;
-<a name="l00295"></a>00295         cpl_frameset_delete(rawframes) ;
-<a name="l00296"></a>00296         <span class="keywordflow">return</span> -1 ;
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298     cpl_propertylist_delete(plist) ;
-<a name="l00299"></a>00299     cpl_propertylist_delete(plist_ext) ;
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     <span class="comment">/* Save the extensions */</span>
-<a name="l00302"></a>00302     <span class="keywordflow">for</span> (iext=1 ; iext<HAWKI_NB_DETECTORS; iext++) 
-<a name="l00303"></a>00303     {
-<a name="l00304"></a>00304         ichip = iext;
-<a name="l00305"></a>00305         <span class="comment">//This is the actual layout of the chips in raw HAWK-I images.</span>
-<a name="l00306"></a>00306         <span class="keywordflow">if</span>(iext == 2)
-<a name="l00307"></a>00307             ichip = 3;
-<a name="l00308"></a>00308         <span class="keywordflow">if</span>(iext == 3)
-<a name="l00309"></a>00309             ichip = 2;
-<a name="l00310"></a>00310         plist_ext = cpl_propertylist_new() ;
-<a name="l00311"></a>00311         sprintf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, ichip+1) ;
-<a name="l00312"></a>00312         cpl_propertylist_prepend_string(plist_ext, <span class="stringliteral">"EXTNAME"</span>, sval) ;
-<a name="l00313"></a>00313         cpl_table_save(distortion_table[ichip], NULL, plist_ext, 
-<a name="l00314"></a>00314                        <span class="stringliteral">"hawki_util_gendist.fits"</span>, CPL_IO_EXTEND);
-<a name="l00315"></a>00315         cpl_propertylist_delete(plist_ext) ;
-<a name="l00316"></a>00316     }
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     <span class="comment">/* Allocate holder for the distortion images */</span>
-<a name="l00319"></a>00319     distortion_im = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(hawki_distortion*));
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     <span class="comment">/* Loop on the chips */</span>
-<a name="l00322"></a>00322     <span class="keywordflow">for</span> (ichip=0 ; ichip<HAWKI_NB_DETECTORS ; ichip++) 
-<a name="l00323"></a>00323     {
-<a name="l00324"></a>00324         <span class="comment">/* Get the file name */</span>
-<a name="l00325"></a>00325         cur_frame = cpl_frameset_get_frame_const(rawframes, ichip) ;
-<a name="l00326"></a>00326         dist_name = cpl_frame_get_filename(cur_frame) ;
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328         <span class="comment">/* Create the output image */</span>
-<a name="l00329"></a>00329         cpl_msg_info(__func__, <span class="stringliteral">"Create the output images for extension %d"</span>, ichip+1) ;
-<a name="l00330"></a>00330         <span class="keywordflow">if</span> ((distortion_im[ichip] = hawki_util_gendist_convert_to_images
-<a name="l00331"></a>00331                 (distortion_table[ichip], dim_x, dim_y)) == NULL) 
-<a name="l00332"></a>00332         {
-<a name="l00333"></a>00333             <span class="keywordtype">int</span> j;
-<a name="l00334"></a>00334             cpl_msg_error(__func__,<span class="stringliteral">"Cannot create the output distortion images"</span>);
-<a name="l00335"></a>00335             cpl_frameset_delete(rawframes);
-<a name="l00336"></a>00336             <span class="keywordflow">for</span> (j=0 ;j < ichip; j++)
-<a name="l00337"></a>00337                 <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion_im[j]);
-<a name="l00338"></a>00338             cpl_free(distortion_im) ;
-<a name="l00339"></a>00339             <span class="keywordflow">return</span> -1 ;
-<a name="l00340"></a>00340         }
-<a name="l00341"></a>00341     }
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/* Write the distortion images */</span>
-<a name="l00344"></a>00344     plist = cpl_propertylist_new() ;
-<a name="l00345"></a>00345     cpl_propertylist_append_string(plist, <span class="stringliteral">"INSTRUME"</span>, <span class="stringliteral">"HAWKI"</span>);
-<a name="l00346"></a>00346     <span class="comment">//This two keywords are needed by QC. I do not why..</span>
-<a name="l00347"></a>00347     cpl_propertylist_append_string(plist, <span class="stringliteral">"MJD-OBS"</span>, <span class="stringliteral">"55128.5000000"</span>);
-<a name="l00348"></a>00348     cpl_propertylist_append_string(plist, <span class="stringliteral">"FOR_QC"</span>, <span class="stringliteral">"dummy.fits"</span>);
-<a name="l00349"></a>00349     cpl_propertylist_append_string(plist, <span class="stringliteral">"ORIGFILE"</span>, 
-<a name="l00350"></a>00350                                    <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>) ;
-<a name="l00351"></a>00351     <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>(framelist, parlist, rawframes,
-<a name="l00352"></a>00352                            <span class="stringliteral">"hawki_util_gendist"</span>,
-<a name="l00353"></a>00353                            HAWKI_CALPRO_DISTORTION_X,
-<a name="l00354"></a>00354                            HAWKI_PROTYPE_DISTORTION_X,
-<a name="l00355"></a>00355                            plist, <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>);
-<a name="l00356"></a>00356     cpl_propertylist_erase(plist, <span class="stringliteral">"ORIGFILE"</span>);
-<a name="l00357"></a>00357     cpl_propertylist_append_string(plist, <span class="stringliteral">"ORIGFILE"</span>, 
-<a name="l00358"></a>00358                                    <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>) ;
-<a name="l00359"></a>00359     <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>(framelist, parlist, rawframes,
-<a name="l00360"></a>00360                            <span class="stringliteral">"hawki_util_gendist"</span>,
-<a name="l00361"></a>00361                            HAWKI_CALPRO_DISTORTION_Y,
-<a name="l00362"></a>00362                            HAWKI_PROTYPE_DISTORTION_Y,
-<a name="l00363"></a>00363                            plist, <span class="stringliteral">"hawki_util_gendist_disty.fits"</span>);
-<a name="l00364"></a>00364     cpl_propertylist_delete(plist) ;
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="comment">/* Save the extensions */</span>
-<a name="l00367"></a>00367     <span class="comment">//There is kind of a hack here</span>
-<a name="l00368"></a>00368     <span class="comment">//We use the distortion table as a reference to save the distortion images</span>
-<a name="l00369"></a>00369     <span class="comment">//to have a proper layout of the detectors in the FITS file.</span>
-<a name="l00370"></a>00370     <span class="comment">//For that hawki_get_extref_file has been modified.</span>
-<a name="l00371"></a>00371     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS; iext++) {
-<a name="l00372"></a>00372         ichip = iext;
-<a name="l00373"></a>00373         <span class="comment">//This is the actual layout of the chips in raw HAWK-I images.</span>
-<a name="l00374"></a>00374         <span class="keywordflow">if</span>(iext == 2)
-<a name="l00375"></a>00375             ichip = 3;
-<a name="l00376"></a>00376         <span class="keywordflow">if</span>(iext == 3)
-<a name="l00377"></a>00377             ichip = 2;
-<a name="l00378"></a>00378         plist_ext = cpl_propertylist_new() ;
-<a name="l00379"></a>00379         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l00380"></a>00380                                        distortion_im[ichip]->x_crval);
-<a name="l00381"></a>00381         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRVAL2"</span>,
-<a name="l00382"></a>00382                                        distortion_im[ichip]->y_crval);
-<a name="l00383"></a>00383         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CDELT1"</span>, 
-<a name="l00384"></a>00384                                        distortion_im[ichip]->x_cdelt);
-<a name="l00385"></a>00385         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CDELT2"</span>,
-<a name="l00386"></a>00386                                        distortion_im[ichip]->y_cdelt);
-<a name="l00387"></a>00387         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRPIX1"</span>, 1);
-<a name="l00388"></a>00388         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRPIX2"</span>, 1);
-<a name="l00389"></a>00389         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">""</span>);
-<a name="l00390"></a>00390         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">""</span>);
-<a name="l00391"></a>00391         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CUNIT1"</span>, <span class="stringliteral">""</span>);
-<a name="l00392"></a>00392         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CUNIT2"</span>, <span class="stringliteral">""</span>);
-<a name="l00393"></a>00393         <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>(framelist, distortion_im[ichip]->dist_x, iext + 1,
-<a name="l00394"></a>00394                              plist_ext, <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>);
-<a name="l00395"></a>00395         <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>(framelist, distortion_im[ichip]->dist_y, iext + 1, 
-<a name="l00396"></a>00396                              plist_ext, <span class="stringliteral">"hawki_util_gendist_disty.fits"</span>);
-<a name="l00397"></a>00397         cpl_propertylist_delete(plist_ext);
-<a name="l00398"></a>00398     }
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) 
-<a name="l00401"></a>00401         cpl_table_delete(distortion_table[iext]);
-<a name="l00402"></a>00402     cpl_free(distortion_table) ;
-<a name="l00403"></a>00403    
-<a name="l00404"></a>00404     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++)
-<a name="l00405"></a>00405         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion_im[iext]);
-<a name="l00406"></a>00406     cpl_free(distortion_im) ;
-<a name="l00407"></a>00407     cpl_frameset_delete(rawframes) ;
-<a name="l00408"></a>00408 
-<a name="l00409"></a>00409     
-<a name="l00410"></a>00410     <span class="comment">/* Return */</span>
-<a name="l00411"></a>00411     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00412"></a>00412     {
-<a name="l00413"></a>00413         cpl_msg_error(__func__,
-<a name="l00414"></a>00414                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00415"></a>00415         <span class="keywordflow">return</span> -1 ;
-<a name="l00416"></a>00416     }
-<a name="l00417"></a>00417     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00418"></a>00418 }
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00445"></a>00445 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00446"></a>00446 <span class="keyword">static</span> cpl_table * hawki_util_gendist_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> * filename) 
-<a name="l00447"></a>00447 {
-<a name="l00448"></a>00448     cpl_table   *   out ;
-<a name="l00449"></a>00449     <span class="keywordtype">int</span>             nbentries ;
-<a name="l00450"></a>00450     FILE        *   in ;
-<a name="l00451"></a>00451     <span class="keywordtype">double</span>          dxgc, dygc ;
-<a name="l00452"></a>00452     <span class="keywordtype">int</span>             i, j ;
-<a name="l00453"></a>00453     <span class="keywordtype">char</span>            line[1024];
-<a name="l00454"></a>00454     
-<a name="l00455"></a>00455     <span class="comment">/* Check entries */</span>
-<a name="l00456"></a>00456     <span class="keywordflow">if</span> (filename == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="comment">/* Get the number of lines */</span>
-<a name="l00459"></a>00459     nbentries = 0 ;
-<a name="l00460"></a>00460     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {
-<a name="l00461"></a>00461         <span class="keywordflow">return</span> NULL ;
-<a name="l00462"></a>00462     }
-<a name="l00463"></a>00463     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {
-<a name="l00464"></a>00464         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) nbentries ++ ;
-<a name="l00465"></a>00465     }
-<a name="l00466"></a>00466     fclose(in) ;
-<a name="l00467"></a>00467     
-<a name="l00468"></a>00468    <span class="comment">/* Create the table */</span>
-<a name="l00469"></a>00469     out = cpl_table_new(nbentries);
-<a name="l00470"></a>00470     cpl_table_new_column(out, HAWKI_COL_DIST_DXGC, CPL_TYPE_DOUBLE);
-<a name="l00471"></a>00471     cpl_table_set_column_unit(out, HAWKI_COL_DIST_DXGC, <span class="stringliteral">"pixels"</span>);
-<a name="l00472"></a>00472     cpl_table_new_column(out, HAWKI_COL_DIST_DYGC, CPL_TYPE_DOUBLE);
-<a name="l00473"></a>00473     cpl_table_set_column_unit(out, HAWKI_COL_DIST_DYGC, <span class="stringliteral">"pixels"</span>);
-<a name="l00474"></a>00474     cpl_table_new_column(out, HAWKI_COL_DIST_I, CPL_TYPE_INT);
-<a name="l00475"></a>00475     cpl_table_set_column_unit(out, HAWKI_COL_DIST_I, <span class="stringliteral">"pixels"</span>);
-<a name="l00476"></a>00476     cpl_table_new_column(out, HAWKI_COL_DIST_J, CPL_TYPE_INT);
-<a name="l00477"></a>00477     cpl_table_set_column_unit(out, HAWKI_COL_DIST_J, <span class="stringliteral">"pixels"</span>);
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     <span class="comment">/* Parse the file */</span>
-<a name="l00480"></a>00480     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {
-<a name="l00481"></a>00481         cpl_table_delete(out) ;
-<a name="l00482"></a>00482         <span class="keywordflow">return</span> NULL ;
-<a name="l00483"></a>00483     }
-<a name="l00484"></a>00484     nbentries = 0 ;
-<a name="l00485"></a>00485     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {
-<a name="l00486"></a>00486         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) {
-<a name="l00487"></a>00487             <span class="keywordflow">if</span> (sscanf(line, <span class="stringliteral">"%lg %lg %d %d"</span>, 
-<a name="l00488"></a>00488                         &dxgc, &dygc, &i, &j) != 4) {
-<a name="l00489"></a>00489                 cpl_msg_error(__func__, <span class="stringliteral">"Bad line %d"</span>, nbentries+1) ;
-<a name="l00490"></a>00490                 cpl_table_delete(out) ;
-<a name="l00491"></a>00491                 <span class="keywordflow">return</span> NULL ;
-<a name="l00492"></a>00492             }
-<a name="l00493"></a>00493             cpl_table_set_double(out, HAWKI_COL_DIST_DXGC, nbentries, dxgc);
-<a name="l00494"></a>00494             cpl_table_set_double(out, HAWKI_COL_DIST_DYGC, nbentries, dygc);
-<a name="l00495"></a>00495             cpl_table_set_int(out, HAWKI_COL_DIST_I, nbentries, i);
-<a name="l00496"></a>00496             cpl_table_set_int(out, HAWKI_COL_DIST_J, nbentries, j);
-<a name="l00497"></a>00497             nbentries ++ ;
-<a name="l00498"></a>00498         }
-<a name="l00499"></a>00499     }
-<a name="l00500"></a>00500     fclose(in) ;
-<a name="l00501"></a>00501                 
-<a name="l00502"></a>00502     <span class="keywordflow">return</span> out ;
-<a name="l00503"></a>00503 }
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00523"></a>00523 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00524"></a>00524 <span class="keyword">static</span> hawki_distortion * hawki_util_gendist_convert_to_images
-<a name="l00525"></a>00525 (<span class="keyword">const</span> cpl_table * dist_tab,
-<a name="l00526"></a>00526  <span class="keywordtype">int</span>               detector_nx,
-<a name="l00527"></a>00527  <span class="keywordtype">int</span>               detector_ny) 
-<a name="l00528"></a>00528 {
-<a name="l00529"></a>00529     hawki_distortion * out ;
-<a name="l00530"></a>00530     <span class="keywordtype">int</span>                nbentries ;
-<a name="l00531"></a>00531     <span class="keywordtype">int</span>                ngrid;
-<a name="l00532"></a>00532     <span class="keyword">const</span> <span class="keywordtype">int</span>        * i_ptr;
-<a name="l00533"></a>00533     <span class="keyword">const</span> <span class="keywordtype">int</span>        * j_ptr;
-<a name="l00534"></a>00534     cpl_array        * i_vec;
-<a name="l00535"></a>00535     cpl_array        * j_vec;
-<a name="l00536"></a>00536     <span class="keywordtype">int</span>                irow;
-<a name="l00537"></a>00537     
-<a name="l00538"></a>00538     
-<a name="l00539"></a>00539     <span class="comment">/* Check entries */</span>
-<a name="l00540"></a>00540     <span class="keywordflow">if</span> (dist_tab == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     <span class="comment">/* Create the table */</span>
-<a name="l00543"></a>00543     nbentries = cpl_table_get_nrow(dist_tab);
-<a name="l00544"></a>00544     ngrid = sqrt(nbentries);
-<a name="l00545"></a>00545     <span class="keywordflow">if</span>(ngrid * ngrid != nbentries)
-<a name="l00546"></a>00546     {
-<a name="l00547"></a>00547         cpl_msg_error(__func__,<span class="stringliteral">"Only square grids are supported"</span>);
-<a name="l00548"></a>00548         <span class="keywordflow">return</span> NULL;
-<a name="l00549"></a>00549     }
-<a name="l00550"></a>00550     out = <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a>(detector_nx, detector_ny, ngrid);
-<a name="l00551"></a>00551     
-<a name="l00552"></a>00552     <span class="comment">/* Get the crval, cdelt */</span>
-<a name="l00553"></a>00553     i_ptr = cpl_table_get_data_int_const(dist_tab, HAWKI_COL_DIST_I);
-<a name="l00554"></a>00554     i_vec = cpl_array_wrap_int((<span class="keywordtype">int</span> *)i_ptr, nbentries);
-<a name="l00555"></a>00555     out->x_crval = cpl_array_get_min(i_vec);
-<a name="l00556"></a>00556     out->x_cdelt = (cpl_array_get_max(i_vec) - cpl_array_get_min(i_vec)) /
-<a name="l00557"></a>00557                    (ngrid - 1);
-<a name="l00558"></a>00558     cpl_array_unwrap(i_vec);
-<a name="l00559"></a>00559     j_ptr = cpl_table_get_data_int_const(dist_tab, HAWKI_COL_DIST_J);
-<a name="l00560"></a>00560     j_vec = cpl_array_wrap_int((<span class="keywordtype">int</span> *)j_ptr, nbentries);
-<a name="l00561"></a>00561     out->y_crval = cpl_array_get_min(j_vec);
-<a name="l00562"></a>00562     out->y_cdelt = (cpl_array_get_max(j_vec) - cpl_array_get_min(j_vec)) /
-<a name="l00563"></a>00563                    (ngrid - 1);
-<a name="l00564"></a>00564     cpl_array_unwrap(j_vec);
-<a name="l00565"></a>00565     
-<a name="l00566"></a>00566 
-<a name="l00567"></a>00567     <span class="comment">/* Fill the image */</span>
-<a name="l00568"></a>00568     <span class="keywordflow">for</span>(irow = 0; irow < nbentries; ++irow)
-<a name="l00569"></a>00569     {
-<a name="l00570"></a>00570         <span class="keywordtype">double</span> i_ima;
-<a name="l00571"></a>00571         <span class="keywordtype">double</span> j_ima;
-<a name="l00572"></a>00572         <span class="keywordtype">double</span> dx;
-<a name="l00573"></a>00573         <span class="keywordtype">double</span> dy;
-<a name="l00574"></a>00574         <span class="keywordtype">int</span>    null;
-<a name="l00575"></a>00575         
-<a name="l00576"></a>00576         i_ima = (cpl_table_get_int(dist_tab, HAWKI_COL_DIST_I, irow, &null) -
-<a name="l00577"></a>00577                  out->x_crval) / out->x_cdelt;
-<a name="l00578"></a>00578         <span class="keywordflow">if</span>(floor(i_ima) != i_ima)
-<a name="l00579"></a>00579         {
-<a name="l00580"></a>00580             cpl_msg_error(__func__, <span class="stringliteral">" The distortion tables must be defined "</span>
-<a name="l00581"></a>00581                           <span class="stringliteral">"in a regular grid"</span>);
-<a name="l00582"></a>00582             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(out);
-<a name="l00583"></a>00583             <span class="keywordflow">return</span> NULL;
-<a name="l00584"></a>00584         }
-<a name="l00585"></a>00585         j_ima = (cpl_table_get_int(dist_tab, HAWKI_COL_DIST_J, irow, &null) -
-<a name="l00586"></a>00586                  out->y_crval) / out->y_cdelt;
-<a name="l00587"></a>00587         <span class="keywordflow">if</span>(floor(j_ima) != j_ima)
-<a name="l00588"></a>00588         {
-<a name="l00589"></a>00589             cpl_msg_error(__func__, <span class="stringliteral">" The distortion tables must be defined "</span>
-<a name="l00590"></a>00590                           <span class="stringliteral">"in a regular grid"</span>);
-<a name="l00591"></a>00591             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(out);
-<a name="l00592"></a>00592             <span class="keywordflow">return</span> NULL;
-<a name="l00593"></a>00593         }
-<a name="l00594"></a>00594         dx = cpl_table_get_double(dist_tab, HAWKI_COL_DIST_DXGC, irow, &null); 
-<a name="l00595"></a>00595         dy = cpl_table_get_double(dist_tab, HAWKI_COL_DIST_DYGC, irow, &null);
-<a name="l00596"></a>00596         
-<a name="l00597"></a>00597         cpl_image_set(out->dist_x, (<span class="keywordtype">int</span>)i_ima + 1, (<span class="keywordtype">int</span>)j_ima + 1, dx);
-<a name="l00598"></a>00598         cpl_image_set(out->dist_y, (<span class="keywordtype">int</span>)i_ima + 1, (<span class="keywordtype">int</span>)j_ima + 1, dy);
-<a name="l00599"></a>00599     }
-<a name="l00600"></a>00600     
-<a name="l00601"></a>00601     <span class="keywordflow">return</span> out ;
-<a name="l00602"></a>00602 }
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_util_gendist.c,v 1.23 2013/03/11 11:03:00 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/03/11 11:03:00 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.23 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_dfs.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_distortion.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_save.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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">                            Functions prototypes</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> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list);</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist(cpl_parameterlist *, cpl_frameset *) ;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> cpl_table * hawki_util_gendist_convert(<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">static</span> hawki_distortion * hawki_util_gendist_convert_to_images</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> (<span class="keyword">const</span> cpl_table * dist_tab,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  <span class="keywordtype">int</span>               detector_nx,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  <span class="keywordtype">int</span>               detector_ny); </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">                            Static variables</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> <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_util_gendist_description[] = </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"hawki_util_gendist -- HAWK-I distortion calibration file creation.\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"The 4 files (chip 1 2 3 4) listed in the Set Of Frames (sof-file) \n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"must be tagged:\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"raw-file_chip1.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"raw-file_chip2.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"raw-file_chip3.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"raw-file_chip4.txt "</span>HAWKI_UTIL_DISTMAP_RAW<span class="stringliteral">"\n"</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">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="comment">                                Functions code</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="comment"> -----------------------------------------------------------------------------*/</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="l00092"></a><span class="lineno">   92</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>                     HAWKI_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">"hawki_util_gendist"</span>,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     <span class="stringliteral">"Distortion map creation"</span>,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     hawki_util_gendist_description,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     <span class="stringliteral">"Yves Jung"</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>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     hawki_util_gendist_create,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     hawki_util_gendist_exec,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     hawki_util_gendist_destroy) ;</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>     cpl_pluginlist_append(list, plugin) ;</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_create(cpl_plugin * plugin)</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_recipe      * recipe ;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     cpl_parameter   * p ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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="comment">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     recipe->parameters = cpl_parameterlist_new() ;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL)</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         <span class="keywordflow">return</span> 1;</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">/* Fill the parameters list */</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="comment">/* --dim_x */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_util_gendist.dim_x"</span>,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>             CPL_TYPE_INT, <span class="stringliteral">"Dimension of distortion image in X"</span>,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>             <span class="stringliteral">"hawki.hawki_util_gendist"</span>, HAWKI_DET_NPIX_X);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dim_x"</span>);</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_parameterlist_append(recipe->parameters, 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">/* --dim_y */</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     p = cpl_parameter_new_value(<span class="stringliteral">"hawki.hawki_util_gendist.dim_y"</span>,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>             CPL_TYPE_INT, <span class="stringliteral">"Dimension of distortion image in Y"</span>,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>             <span class="stringliteral">"hawki.hawki_util_gendist"</span>, HAWKI_DET_NPIX_Y);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dim_y"</span>);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_parameterlist_append(recipe->parameters, p);</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>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keywordflow">return</span> 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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_exec(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> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="comment">/* Get the recipe out of the plugin */</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> <span class="keywordflow">return</span> -1 ;</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="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();</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> hawki_util_gendist(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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist_destroy(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> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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>     cpl_parameterlist_delete(recipe->parameters) ;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordflow">return</span> 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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_gendist</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> (cpl_parameterlist   *   parlist, </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>  cpl_frameset        *   framelist)</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_frameset         * rawframes;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="keyword">const</span> cpl_frame      * cur_frame;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>           * dist_name;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_table           ** distortion_table;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     hawki_distortion    ** distortion_im;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_propertylist     * plist;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_propertylist     * plist_ext;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordtype">char</span>                   sval[64];</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>           * recipe_name = <span class="stringliteral">"hawki_util_gendist"</span>;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordtype">int</span>                    iext;</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="keywordtype">int</span>                    ichip;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_parameter        * par;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="keywordtype">int</span>                    dim_x;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     <span class="keywordtype">int</span>                    dim_y;</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">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         <span class="keywordflow">return</span> -1 ;</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">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                     HAWKI_UTIL_DISTMAP_RAW)) == NULL) {</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list"</span>) ;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>         <span class="keywordflow">return</span> -1 ;</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>     <span class="comment">/* There should be HAWKI_NB_DETECTORS input frames ordered  */</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordflow">if</span> (cpl_frameset_get_size(rawframes) != HAWKI_NB_DETECTORS) {</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>         cpl_msg_error(__func__, <span class="stringliteral">"%d frames expected"</span>, HAWKI_NB_DETECTORS) ;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         <span class="keywordflow">return</span> -1 ;</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="comment">/* Retrieve parameters */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_util_gendist.dim_x"</span>) ;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     dim_x = cpl_parameter_get_int(par);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     par = cpl_parameterlist_find(parlist, <span class="stringliteral">"hawki.hawki_util_gendist.dim_y"</span>) ;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     dim_y = cpl_parameter_get_int(par);</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">/* Allocate holder for the tables */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     distortion_table = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(cpl_table*)) ;</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">/* Loop on the chips */</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keywordflow">for</span> (ichip=0 ; ichip<HAWKI_NB_DETECTORS ; ichip++) {</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">/* Get the file name */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>         cur_frame = cpl_frameset_get_frame_const(rawframes, ichip) ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>         dist_name = cpl_frame_get_filename(cur_frame) ;</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">/* Create the output table */</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         cpl_msg_info(__func__, <span class="stringliteral">"Create the output table for chip %d"</span>, ichip+1) ;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         <span class="keywordflow">if</span> ((distortion_table[ichip] = hawki_util_gendist_convert(dist_name)) == NULL) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>             <span class="keywordtype">int</span> j;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot create the output table"</span>) ;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>             cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>             <span class="keywordflow">for</span> (j=0 ; j<ichip ; j++) cpl_table_delete(distortion_table[j]) ;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>             cpl_free(distortion_table) ;</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>     }</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">/* Write the table */</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     plist = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"INSTRUME"</span>, <span class="stringliteral">"HAWKI"</span>) ;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                                    HAWKI_PROTYPE_DISTORTION) ;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                    HAWKI_CALPRO_DISTORTION) ;</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>     plist_ext = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     cpl_propertylist_prepend_string(plist_ext, <span class="stringliteral">"EXTNAME"</span>, <span class="stringliteral">"CHIP1.INT1"</span>) ;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <span class="keywordflow">if</span> (cpl_dfs_save_table(framelist, NULL, parlist, rawframes, NULL, </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                            distortion_table[0], plist_ext, recipe_name,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                            plist, NULL, PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                 <span class="stringliteral">"hawki_util_gendist.fits"</span>) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot save the first extension table"</span>) ;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         cpl_propertylist_delete(plist_ext) ;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>         cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>         <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>             cpl_table_delete(distortion_table[iext]) ;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>         cpl_free(distortion_table) ;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         <span class="keywordflow">return</span> -1 ;</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>     cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_propertylist_delete(plist_ext) ;</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">/* Save the extensions */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">for</span> (iext=1 ; iext<HAWKI_NB_DETECTORS; iext++) </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>         ichip = iext;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         <span class="comment">//This is the actual layout of the chips in raw HAWK-I images.</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         <span class="keywordflow">if</span>(iext == 2)</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>             ichip = 3;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>         <span class="keywordflow">if</span>(iext == 3)</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>             ichip = 2;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         plist_ext = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         sprintf(sval, <span class="stringliteral">"CHIP%d.INT1"</span>, ichip+1) ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         cpl_propertylist_prepend_string(plist_ext, <span class="stringliteral">"EXTNAME"</span>, sval) ;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         cpl_table_save(distortion_table[ichip], NULL, plist_ext, </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                        <span class="stringliteral">"hawki_util_gendist.fits"</span>, CPL_IO_EXTEND);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         cpl_propertylist_delete(plist_ext) ;</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>     <span class="comment">/* Allocate holder for the distortion images */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     distortion_im = cpl_malloc(HAWKI_NB_DETECTORS * <span class="keyword">sizeof</span>(hawki_distortion*));</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">/* Loop on the chips */</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">for</span> (ichip=0 ; ichip<HAWKI_NB_DETECTORS ; ichip++) </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">/* Get the file name */</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         cur_frame = cpl_frameset_get_frame_const(rawframes, ichip) ;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>         dist_name = cpl_frame_get_filename(cur_frame) ;</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">/* Create the output image */</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>         cpl_msg_info(__func__, <span class="stringliteral">"Create the output images for extension %d"</span>, ichip+1) ;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         <span class="keywordflow">if</span> ((distortion_im[ichip] = hawki_util_gendist_convert_to_images</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                 (distortion_table[ichip], dim_x, dim_y)) == 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>             <span class="keywordtype">int</span> j;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>             cpl_msg_error(__func__,<span class="stringliteral">"Cannot create the output distortion images"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>             cpl_frameset_delete(rawframes);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>             <span class="keywordflow">for</span> (j=0 ;j < ichip; j++)</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                 <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion_im[j]);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             cpl_free(distortion_im) ;</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>     }</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">/* Write the distortion images */</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     plist = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"INSTRUME"</span>, <span class="stringliteral">"HAWKI"</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="comment">//This two keywords are needed by QC. I do not why..</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"MJD-OBS"</span>, <span class="stringliteral">"55128.5000000"</span>);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"FOR_QC"</span>, <span class="stringliteral">"dummy.fits"</span>);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"ORIGFILE"</span>, </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                                    <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>) ;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>(framelist, parlist, rawframes,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                            <span class="stringliteral">"hawki_util_gendist"</span>,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                            HAWKI_CALPRO_DISTORTION_X,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                            HAWKI_PROTYPE_DISTORTION_X,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                            plist, <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ORIGFILE"</span>);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cpl_propertylist_append_string(plist, <span class="stringliteral">"ORIGFILE"</span>, </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                    <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>) ;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <a class="code" href="group__hawki__save.html#gaebd68d7422dd13901e999db3c951bd54" title="Save a main header and prepare it to store additional data units later on.">hawki_main_header_save</a>(framelist, parlist, rawframes,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                            <span class="stringliteral">"hawki_util_gendist"</span>,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                            HAWKI_CALPRO_DISTORTION_Y,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                            HAWKI_PROTYPE_DISTORTION_Y,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                            plist, <span class="stringliteral">"hawki_util_gendist_disty.fits"</span>);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_propertylist_delete(plist) ;</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">/* Save the extensions */</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="comment">//There is kind of a hack here</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="comment">//We use the distortion table as a reference to save the distortion images</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="comment">//to have a proper layout of the detectors in the FITS file.</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="comment">//For that hawki_get_extref_file has been modified.</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS; iext++) {</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         ichip = iext;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         <span class="comment">//This is the actual layout of the chips in raw HAWK-I images.</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         <span class="keywordflow">if</span>(iext == 2)</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>             ichip = 3;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>         <span class="keywordflow">if</span>(iext == 3)</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>             ichip = 2;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         plist_ext = cpl_propertylist_new() ;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                                        distortion_im[ichip]->x_crval);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRVAL2"</span>,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                                        distortion_im[ichip]->y_crval);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CDELT1"</span>, </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>                                        distortion_im[ichip]->x_cdelt);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CDELT2"</span>,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                        distortion_im[ichip]->y_cdelt);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRPIX1"</span>, 1);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         cpl_propertylist_append_double(plist_ext, <span class="stringliteral">"CRPIX2"</span>, 1);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CUNIT1"</span>, <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         cpl_propertylist_append_string(plist_ext, <span class="stringliteral">"CUNIT2"</span>, <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>(framelist, distortion_im[ichip]->dist_x, iext + 1,</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                              plist_ext, <span class="stringliteral">"hawki_util_gendist_distx.fits"</span>);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         <a class="code" href="group__hawki__save.html#gab2873c1ec09ba834aaa284f003bc6acc" title="Save an image into a given extension.">hawki_image_ext_save</a>(framelist, distortion_im[ichip]->dist_y, iext + 1, </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                              plist_ext, <span class="stringliteral">"hawki_util_gendist_disty.fits"</span>);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         cpl_propertylist_delete(plist_ext);</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="keywordflow">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++) </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         cpl_table_delete(distortion_table[iext]);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_free(distortion_table) ;</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">for</span> (iext=0 ; iext<HAWKI_NB_DETECTORS ; iext++)</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(distortion_im[iext]);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_free(distortion_im) ;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_frameset_delete(rawframes) ;</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="comment">/* Return */</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>     {</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         cpl_msg_error(__func__,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         <span class="keywordflow">return</span> -1 ;</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">else</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="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> cpl_table * hawki_util_gendist_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> * filename) </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_table   *   out ;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     <span class="keywordtype">int</span>             nbentries ;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     FILE        *   in ;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="keywordtype">double</span>          dxgc, dygc ;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordtype">int</span>             i, j ;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordtype">char</span>            line[1024];</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">/* Check entries */</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">if</span> (filename == NULL) <span class="keywordflow">return</span> 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="comment">/* Get the number of lines */</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     nbentries = 0 ;</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {</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>     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) nbentries ++ ;</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>     fclose(in) ;</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">/* Create the table */</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     out = cpl_table_new(nbentries);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     cpl_table_new_column(out, HAWKI_COL_DIST_DXGC, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_table_set_column_unit(out, HAWKI_COL_DIST_DXGC, <span class="stringliteral">"pixels"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_table_new_column(out, HAWKI_COL_DIST_DYGC, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_table_set_column_unit(out, HAWKI_COL_DIST_DYGC, <span class="stringliteral">"pixels"</span>);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cpl_table_new_column(out, HAWKI_COL_DIST_I, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cpl_table_set_column_unit(out, HAWKI_COL_DIST_I, <span class="stringliteral">"pixels"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     cpl_table_new_column(out, HAWKI_COL_DIST_J, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     cpl_table_set_column_unit(out, HAWKI_COL_DIST_J, <span class="stringliteral">"pixels"</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">/* Parse the file */</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_table_delete(out) ;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         <span class="keywordflow">return</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>     nbentries = 0 ;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) {</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>             <span class="keywordflow">if</span> (sscanf(line, <span class="stringliteral">"%lg %lg %d %d"</span>, </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                         &dxgc, &dygc, &i, &j) != 4) {</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                 cpl_msg_error(__func__, <span class="stringliteral">"Bad line %d"</span>, nbentries+1) ;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>                 cpl_table_delete(out) ;</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>                 <span class="keywordflow">return</span> 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>             cpl_table_set_double(out, HAWKI_COL_DIST_DXGC, nbentries, dxgc);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             cpl_table_set_double(out, HAWKI_COL_DIST_DYGC, nbentries, dygc);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>             cpl_table_set_int(out, HAWKI_COL_DIST_I, nbentries, i);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             cpl_table_set_int(out, HAWKI_COL_DIST_J, nbentries, j);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             nbentries ++ ;</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>     fclose(in) ;</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">return</span> out ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> <span class="keyword">static</span> hawki_distortion * hawki_util_gendist_convert_to_images</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> (<span class="keyword">const</span> cpl_table * dist_tab,</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>  <span class="keywordtype">int</span>               detector_nx,</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>  <span class="keywordtype">int</span>               detector_ny) </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>     hawki_distortion * out ;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordtype">int</span>                nbentries ;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordtype">int</span>                ngrid;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keyword">const</span> <span class="keywordtype">int</span>        * i_ptr;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keyword">const</span> <span class="keywordtype">int</span>        * j_ptr;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     cpl_array        * i_vec;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cpl_array        * j_vec;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordtype">int</span>                irow;</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="l00544"></a><span class="lineno">  544</span>     <span class="comment">/* Check entries */</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">if</span> (dist_tab == NULL) <span class="keywordflow">return</span> 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">/* Create the table */</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     nbentries = cpl_table_get_nrow(dist_tab);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     ngrid = sqrt(nbentries);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">if</span>(ngrid * ngrid != nbentries)</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>         cpl_msg_error(__func__,<span class="stringliteral">"Only square grids are supported"</span>);</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="keywordflow">return</span> NULL;</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>     out = <a class="code" href="group__hawki__distortion.html#gae37defaaf5c0bd86686df3285b89763d" title="Allocate a new distortion solution.">hawki_distortion_grid_new</a>(detector_nx, detector_ny, ngrid);</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">/* Get the crval, cdelt */</span></div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     i_ptr = cpl_table_get_data_int_const(dist_tab, HAWKI_COL_DIST_I);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     i_vec = cpl_array_wrap_int((<span class="keywordtype">int</span> *)i_ptr, nbentries);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     out->x_crval = cpl_array_get_min(i_vec);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     out->x_cdelt = (cpl_array_get_max(i_vec) - cpl_array_get_min(i_vec)) /</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                    (ngrid - 1);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     cpl_array_unwrap(i_vec);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     j_ptr = cpl_table_get_data_int_const(dist_tab, HAWKI_COL_DIST_J);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     j_vec = cpl_array_wrap_int((<span class="keywordtype">int</span> *)j_ptr, nbentries);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     out->y_crval = cpl_array_get_min(j_vec);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     out->y_cdelt = (cpl_array_get_max(j_vec) - cpl_array_get_min(j_vec)) /</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                    (ngrid - 1);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     cpl_array_unwrap(j_vec);</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="comment">/* Fill the image */</span></div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">for</span>(irow = 0; irow < nbentries; ++irow)</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="keywordtype">double</span> i_ima;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         <span class="keywordtype">double</span> j_ima;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         <span class="keywordtype">double</span> dx;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         <span class="keywordtype">double</span> dy;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <span class="keywordtype">int</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>         i_ima = (cpl_table_get_int(dist_tab, HAWKI_COL_DIST_I, irow, &null) -</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>                  out->x_crval) / out->x_cdelt;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         <span class="keywordflow">if</span>(floor(i_ima) != i_ima)</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_msg_error(__func__, <span class="stringliteral">" The distortion tables must be defined "</span></div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                           <span class="stringliteral">"in a regular grid"</span>);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(out);</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>             <span class="keywordflow">return</span> NULL;</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>         j_ima = (cpl_table_get_int(dist_tab, HAWKI_COL_DIST_J, irow, &null) -</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>                  out->y_crval) / out->y_cdelt;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         <span class="keywordflow">if</span>(floor(j_ima) != j_ima)</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>             cpl_msg_error(__func__, <span class="stringliteral">" The distortion tables must be defined "</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>                           <span class="stringliteral">"in a regular grid"</span>);</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>             <a class="code" href="group__hawki__distortion.html#ga12a902f30ad5f4a6012b9df508d06712" title="Deallocates a hawki_distortion structure.">hawki_distortion_delete</a>(out);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>             <span class="keywordflow">return</span> 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>         dx = cpl_table_get_double(dist_tab, HAWKI_COL_DIST_DXGC, irow, &null); </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>         dy = cpl_table_get_double(dist_tab, HAWKI_COL_DIST_DYGC, irow, &null);</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_image_set(out->dist_x, (<span class="keywordtype">int</span>)i_ima + 1, (<span class="keywordtype">int</span>)j_ima + 1, dx);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         cpl_image_set(out->dist_y, (<span class="keywordtype">int</span>)i_ima + 1, (<span class="keywordtype">int</span>)j_ima + 1, dy);</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>     <span class="keywordflow">return</span> out ;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</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/hawki__util__stdstars_8c_source.html b/html/hawki__util__stdstars_8c_source.html
index a2bc08d..ff7ee6d 100644
--- a/html/hawki__util__stdstars_8c_source.html
+++ b/html/hawki__util__stdstars_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_util_stdstars.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,286 +40,287 @@
       <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_38d6ca2a11734cc7d27e97ffc4930ba5.html">recipes</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">hawki_util_stdstars.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_util_stdstars.c,v 1.16 2011/07/06 08:21: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/07/06 08:21:36 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.16 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</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 <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include "irplib_utils.h"</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include "irplib_stdstar.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_dfs.h"</span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00048"></a>00048 <span class="comment">                            Functions 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">int</span> hawki_util_stdstars_create(cpl_plugin *) ;
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_exec(cpl_plugin *) ;
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_destroy(cpl_plugin *) ;
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars(cpl_frameset *) ;
-<a name="l00055"></a>00055 <span class="keyword">static</span> cpl_table * hawki_util_stdstars_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> *) ; 
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00058"></a>00058 <span class="comment">                            Static variables</span>
-<a name="l00059"></a>00059 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_util_stdstars_description[] = 
-<a name="l00062"></a>00062 <span class="stringliteral">"hawki_util_stdstars -- HAWK-I standard stars catalog creation.\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"raw-file.txt "</span>HAWKI_UTIL_STDSTARS_RAW<span class="stringliteral">"\n"</span> ;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00067"></a>00067 <span class="comment">                                Functions code</span>
-<a name="l00068"></a>00068 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00078"></a>00078 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00079"></a>00079 <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)
-<a name="l00080"></a>00080 {
-<a name="l00081"></a>00081     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;
-<a name="l00082"></a>00082     cpl_plugin  *   plugin = &recipe->interface ;
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     cpl_plugin_init(plugin,
-<a name="l00085"></a>00085                     CPL_PLUGIN_API,
-<a name="l00086"></a>00086                     HAWKI_BINARY_VERSION,
-<a name="l00087"></a>00087                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00088"></a>00088                     <span class="stringliteral">"hawki_util_stdstars"</span>,
-<a name="l00089"></a>00089                     <span class="stringliteral">"Standard stars catalog creation"</span>,
-<a name="l00090"></a>00090                     hawki_util_stdstars_description,
-<a name="l00091"></a>00091                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,
-<a name="l00092"></a>00092                     PACKAGE_BUGREPORT,  
-<a name="l00093"></a>00093                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),
-<a name="l00094"></a>00094                     hawki_util_stdstars_create,
-<a name="l00095"></a>00095                     hawki_util_stdstars_exec,
-<a name="l00096"></a>00096                     hawki_util_stdstars_destroy) ;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098     cpl_pluginlist_append(list, plugin) ;
-<a name="l00099"></a>00099     
-<a name="l00100"></a>00100     <span class="keywordflow">return</span> 0;
-<a name="l00101"></a>00101 }
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00112"></a>00112 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00113"></a>00113 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_create(cpl_plugin * plugin)
-<a name="l00114"></a>00114 {
-<a name="l00115"></a>00115     cpl_recipe      * recipe ;
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00118"></a>00118     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00119"></a>00119         recipe = (cpl_recipe *)plugin ;
-<a name="l00120"></a>00120     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     <span class="comment">/* Create the parameters list in the cpl_recipe object */</span>
-<a name="l00123"></a>00123     recipe->parameters = cpl_parameterlist_new() ;
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="comment">/* Return */</span>
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_exec(cpl_plugin * plugin)
-<a name="l00137"></a>00137 {
-<a name="l00138"></a>00138     cpl_recipe  *   recipe ;
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00141"></a>00141     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00142"></a>00142         recipe = (cpl_recipe *)plugin ;
-<a name="l00143"></a>00143     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     <span class="comment">/* Issue a banner */</span>
-<a name="l00146"></a>00146     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>();
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="keywordflow">return</span> hawki_util_stdstars(recipe->frames) ;
-<a name="l00149"></a>00149 }
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00157"></a>00157 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00158"></a>00158 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_destroy(cpl_plugin * plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe  *   recipe ;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/* Get the recipe out of the plugin */</span>
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
-<a name="l00164"></a>00164         recipe = (cpl_recipe *)plugin ;
-<a name="l00165"></a>00165     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     cpl_parameterlist_delete(recipe->parameters) ;
-<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 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00177"></a>00177 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00178"></a>00178 <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars(
-<a name="l00179"></a>00179         cpl_frameset        *   framelist)
-<a name="l00180"></a>00180 {
-<a name="l00181"></a>00181     cpl_frameset        *   rawframes ;
-<a name="l00182"></a>00182     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_util_stdstars"</span> ;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     
-<a name="l00185"></a>00185     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span>
-<a name="l00186"></a>00186     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {
-<a name="l00187"></a>00187         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;
-<a name="l00188"></a>00188         <span class="keywordflow">return</span> -1 ;
-<a name="l00189"></a>00189     }
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     <span class="comment">/* Retrieve raw frames */</span>
-<a name="l00192"></a>00192     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,
-<a name="l00193"></a>00193                     HAWKI_UTIL_STDSTARS_RAW)) == NULL) {
-<a name="l00194"></a>00194         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list"</span>) ;
-<a name="l00195"></a>00195         <span class="keywordflow">return</span> -1 ;
-<a name="l00196"></a>00196     }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/* Write the catalog */</span>
-<a name="l00199"></a>00199     <span class="keywordflow">if</span> (irplib_stdstar_write_catalogs(framelist,
-<a name="l00200"></a>00200                 rawframes, 
-<a name="l00201"></a>00201                 recipe_name,
-<a name="l00202"></a>00202                 HAWKI_CALPRO_STDSTARS, 
-<a name="l00203"></a>00203                 HAWKI_PROTYPE_STDSTARS,
-<a name="l00204"></a>00204                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00205"></a>00205                 <span class="stringliteral">"HAWKI"</span>,
-<a name="l00206"></a>00206                 hawki_util_stdstars_convert) == -1) {
-<a name="l00207"></a>00207         cpl_msg_error(__func__, <span class="stringliteral">"Cannot write the catalogs"</span>) ;
-<a name="l00208"></a>00208         cpl_frameset_delete(rawframes) ;
-<a name="l00209"></a>00209         <span class="keywordflow">return</span> -1 ;
-<a name="l00210"></a>00210     }
-<a name="l00211"></a>00211     cpl_frameset_delete(rawframes) ;
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <span class="comment">/* Return */</span>
-<a name="l00214"></a>00214     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00215"></a>00215     {
-<a name="l00216"></a>00216         cpl_msg_error(__func__,
-<a name="l00217"></a>00217                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);
-<a name="l00218"></a>00218         <span class="keywordflow">return</span> -1 ;
-<a name="l00219"></a>00219     }
-<a name="l00220"></a>00220     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0 ;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00244"></a>00244 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00245"></a>00245 <span class="keyword">static</span> cpl_table * hawki_util_stdstars_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> * filename) 
-<a name="l00246"></a>00246 {
-<a name="l00247"></a>00247     cpl_table   *   out ;
-<a name="l00248"></a>00248     <span class="keywordtype">int</span>             nfilters ;
-<a name="l00249"></a>00249     <span class="keyword">const</span> <span class="keywordtype">char</span>  *   filters[4];
-<a name="l00250"></a>00250     <span class="keywordtype">double</span>          mags[4] ;
-<a name="l00251"></a>00251     <span class="keywordtype">int</span>             nbentries ;
-<a name="l00252"></a>00252     FILE        *   in ;
-<a name="l00253"></a>00253     <span class="keywordtype">char</span>            line[1024];
-<a name="l00254"></a>00254     <span class="keywordtype">double</span>          ra, dec ;
-<a name="l00255"></a>00255     <span class="keywordtype">char</span>            sname[512];
-<a name="l00256"></a>00256     <span class="keywordtype">char</span>            stype[512];
-<a name="l00257"></a>00257     <span class="keywordtype">int</span>             i ;
-<a name="l00258"></a>00258     
-<a name="l00259"></a>00259     <span class="comment">/* Check entries */</span>
-<a name="l00260"></a>00260     <span class="keywordflow">if</span> (filename == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     <span class="comment">/* Initialise */</span>
-<a name="l00263"></a>00263     nfilters = 4 ;
-<a name="l00264"></a>00264     filters[0] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_J) ;
-<a name="l00265"></a>00265     filters[1] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_H) ;
-<a name="l00266"></a>00266     filters[2] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_K) ;
-<a name="l00267"></a>00267     filters[3] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_Y) ;
-<a name="l00268"></a>00268    
-<a name="l00269"></a>00269     <span class="comment">/* Get the number of lines */</span>
-<a name="l00270"></a>00270     nbentries = 0 ;
-<a name="l00271"></a>00271     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {
-<a name="l00272"></a>00272         <span class="keywordflow">return</span> NULL ;
-<a name="l00273"></a>00273     }
-<a name="l00274"></a>00274     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {
-<a name="l00275"></a>00275         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) nbentries ++ ;
-<a name="l00276"></a>00276     }
-<a name="l00277"></a>00277     fclose(in) ;
-<a name="l00278"></a>00278     
-<a name="l00279"></a>00279    <span class="comment">/* Create the table */</span>
-<a name="l00280"></a>00280     out = cpl_table_new(nbentries);
-<a name="l00281"></a>00281     cpl_table_new_column(out, IRPLIB_STDSTAR_STAR_COL, CPL_TYPE_STRING);
-<a name="l00282"></a>00282     cpl_table_new_column(out, IRPLIB_STDSTAR_TYPE_COL, CPL_TYPE_STRING);
-<a name="l00283"></a>00283     cpl_table_new_column(out, IRPLIB_STDSTAR_RA_COL, CPL_TYPE_DOUBLE);
-<a name="l00284"></a>00284     cpl_table_new_column(out, IRPLIB_STDSTAR_DEC_COL, CPL_TYPE_DOUBLE);
-<a name="l00285"></a>00285     <span class="keywordflow">for</span> (i=0 ; i<nfilters ; i++)
-<a name="l00286"></a>00286         cpl_table_new_column(out, filters[i], CPL_TYPE_DOUBLE);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="comment">/* Parse the file */</span>
-<a name="l00289"></a>00289     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {
-<a name="l00290"></a>00290         cpl_table_delete(out) ;
-<a name="l00291"></a>00291         <span class="keywordflow">return</span> NULL ;
-<a name="l00292"></a>00292     }
-<a name="l00293"></a>00293     nbentries = 0 ;
-<a name="l00294"></a>00294     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {
-<a name="l00295"></a>00295         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) {
-<a name="l00296"></a>00296             <span class="keywordflow">if</span> (sscanf(line, <span class="stringliteral">"%s %lg %lg %s %lg %lg %lg %lg"</span>, 
-<a name="l00297"></a>00297                         sname, &ra, &dec, stype, &(mags[0]), &(mags[1]),
-<a name="l00298"></a>00298                         &(mags[2]), &(mags[3])) != 8) {
-<a name="l00299"></a>00299                 cpl_table_delete(out) ;
-<a name="l00300"></a>00300                 <span class="keywordflow">return</span> NULL ;
-<a name="l00301"></a>00301             }
-<a name="l00302"></a>00302             cpl_table_set_string(out, IRPLIB_STDSTAR_STAR_COL,nbentries, sname);
-<a name="l00303"></a>00303             cpl_table_set_string(out, IRPLIB_STDSTAR_TYPE_COL,nbentries, stype);
-<a name="l00304"></a>00304             cpl_table_set_double(out, IRPLIB_STDSTAR_RA_COL, nbentries, ra);
-<a name="l00305"></a>00305             cpl_table_set_double(out, IRPLIB_STDSTAR_DEC_COL, nbentries, dec);
-<a name="l00306"></a>00306             <span class="keywordflow">for</span> (i=0 ; i<nfilters ; i++)
-<a name="l00307"></a>00307                 cpl_table_set_double(out, filters[i], nbentries, mags[i]);
-<a name="l00308"></a>00308             nbentries ++ ;
-<a name="l00309"></a>00309         }
-<a name="l00310"></a>00310     }
-<a name="l00311"></a>00311     fclose(in) ;
-<a name="l00312"></a>00312                 
-<a name="l00313"></a>00313     <span class="keywordflow">return</span> out ;
-<a name="l00314"></a>00314 }
-<a name="l00315"></a>00315 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_util_stdstars.c,v 1.16 2011/07/06 08:21: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011/07/06 08:21:36 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                Includes</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> </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 <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 "irplib_utils.h"</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "irplib_stdstar.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include "hawki_load.h"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_dfs.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="l00048"></a><span class="lineno">   48</span> <span class="comment">                            Functions 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">int</span> hawki_util_stdstars_create(cpl_plugin *) ;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_exec(cpl_plugin *) ;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_destroy(cpl_plugin *) ;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars(cpl_frameset *) ;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> cpl_table * hawki_util_stdstars_convert(<span class="keyword">const</span> <span class="keywordtype">char</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="comment">                            Static variables</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> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">char</span> hawki_util_stdstars_description[] = </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"hawki_util_stdstars -- HAWK-I standard stars catalog creation.\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"The files listed in the Set Of Frames (sof-file) must be tagged:\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"raw-file.txt "</span>HAWKI_UTIL_STDSTARS_RAW<span class="stringliteral">"\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> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment">                                Functions code</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> </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="keywordtype">int</span> cpl_plugin_get_info(cpl_pluginlist * list)</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>     cpl_recipe  *   recipe = cpl_calloc(1, <span class="keyword">sizeof</span>(*recipe)) ;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     cpl_plugin  *   plugin = &recipe->interface ;</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_plugin_init(plugin,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     HAWKI_BINARY_VERSION,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <span class="stringliteral">"hawki_util_stdstars"</span>,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <span class="stringliteral">"Standard stars catalog creation"</span>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     hawki_util_stdstars_description,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <span class="stringliteral">"Cesar Enrique Garcia Dabo"</span>,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                     PACKAGE_BUGREPORT,  </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                     <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(),</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                     hawki_util_stdstars_create,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     hawki_util_stdstars_exec,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                     hawki_util_stdstars_destroy) ;</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_pluginlist_append(list, plugin) ;</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">return</span> 0;</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="comment">/*----------------------------------------------------------------------------*/</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> <span class="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_create(cpl_plugin * 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>     cpl_recipe      * recipe ;</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">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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">/* Create the parameters list in the cpl_recipe object */</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     recipe->parameters = cpl_parameterlist_new() ;</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">/* Return */</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_exec(cpl_plugin * plugin)</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 ;</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="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordflow">else</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>     <span class="comment">/* Issue a banner */</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</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>     <span class="keywordflow">return</span> hawki_util_stdstars(recipe->frames) ;</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="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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars_destroy(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> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/* Get the recipe out of the plugin */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         recipe = (cpl_recipe *)plugin ;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1 ;</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_parameterlist_delete(recipe->parameters) ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keyword">static</span> <span class="keywordtype">int</span> hawki_util_stdstars(</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_frameset        *   framelist)</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_frameset        *   rawframes ;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *   recipe_name = <span class="stringliteral">"hawki_util_stdstars"</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>     </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="comment">/* Identify the RAW and CALIB frames in the input frameset */</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">if</span> (<a class="code" href="group__hawki__dfs.html#ga6d79b77b5f9d13aa0ceeb461410bb03b" title="Set the group as RAW or CALIB in a frameset.">hawki_dfs_set_groups</a>(framelist)) {</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot identify RAW and CALIB frames"</span>) ;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>         <span class="keywordflow">return</span> -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="l00191"></a><span class="lineno">  191</span>     <span class="comment">/* Retrieve raw frames */</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">if</span> ((rawframes = <a class="code" href="group__hawki__load.html#ga080ffcf787c686caacf741989e6e796a" title="Extract the frames with the given tag from a frameset.">hawki_extract_frameset</a>(framelist,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                     HAWKI_UTIL_STDSTARS_RAW)) == NULL) {</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot find raw frames in the input list"</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> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="comment">/* Write the catalog */</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keywordflow">if</span> (irplib_stdstar_write_catalogs(framelist,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                 rawframes, </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                 recipe_name,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                 HAWKI_CALPRO_STDSTARS, </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                 HAWKI_PROTYPE_STDSTARS,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                 PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                 <span class="stringliteral">"HAWKI"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                 hawki_util_stdstars_convert) == -1) {</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot write the catalogs"</span>) ;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         cpl_frameset_delete(rawframes) ;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         <span class="keywordflow">return</span> -1 ;</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_frameset_delete(rawframes) ;</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">/* Return */</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</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_msg_error(__func__,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                       <span class="stringliteral">"HAWK-I pipeline could not recover from previous errors"</span>);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         <span class="keywordflow">return</span> -1 ;</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> <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 class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="comment">/*----------------------------------------------------------------------------*/</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">static</span> cpl_table * hawki_util_stdstars_convert(<span class="keyword">const</span> <span class="keywordtype">char</span> * filename) </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_table   *   out ;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordtype">int</span>             nfilters ;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *   filters[4];</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordtype">double</span>          mags[4] ;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordtype">int</span>             nbentries ;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     FILE        *   in ;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keywordtype">char</span>            line[1024];</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordtype">double</span>          ra, dec ;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordtype">char</span>            sname[512];</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keywordtype">char</span>            stype[512];</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordtype">int</span>             i ;</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="comment">/* Check entries */</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">if</span> (filename == NULL) <span class="keywordflow">return</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>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     nfilters = 4 ;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     filters[0] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_J) ;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     filters[1] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_H) ;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     filters[2] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_K) ;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     filters[3] = <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(HAWKI_BAND_Y) ;</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 the number of lines */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     nbentries = 0 ;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         <span class="keywordflow">return</span> NULL ;</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="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) nbentries ++ ;</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>     fclose(in) ;</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">/* Create the table */</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     out = cpl_table_new(nbentries);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cpl_table_new_column(out, IRPLIB_STDSTAR_STAR_COL, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_table_new_column(out, IRPLIB_STDSTAR_TYPE_COL, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_table_new_column(out, IRPLIB_STDSTAR_RA_COL, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_table_new_column(out, IRPLIB_STDSTAR_DEC_COL, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordflow">for</span> (i=0 ; i<nfilters ; i++)</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         cpl_table_new_column(out, filters[i], CPL_TYPE_DOUBLE);</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">/* Parse the file */</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">if</span> ((in = fopen(filename, <span class="stringliteral">"r"</span>)) == NULL) {</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         cpl_table_delete(out) ;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         <span class="keywordflow">return</span> NULL ;</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>     nbentries = 0 ;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordflow">while</span> (fgets(line, 1024, in) != NULL) {</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         <span class="keywordflow">if</span> (line[0] != <span class="charliteral">'#'</span>) {</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>             <span class="keywordflow">if</span> (sscanf(line, <span class="stringliteral">"%s %lg %lg %s %lg %lg %lg %lg"</span>, </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                         sname, &ra, &dec, stype, &(mags[0]), &(mags[1]),</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                         &(mags[2]), &(mags[3])) != 8) {</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                 cpl_table_delete(out) ;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                 <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>             cpl_table_set_string(out, IRPLIB_STDSTAR_STAR_COL,nbentries, sname);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>             cpl_table_set_string(out, IRPLIB_STDSTAR_TYPE_COL,nbentries, stype);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             cpl_table_set_double(out, IRPLIB_STDSTAR_RA_COL, nbentries, ra);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             cpl_table_set_double(out, IRPLIB_STDSTAR_DEC_COL, nbentries, dec);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>             <span class="keywordflow">for</span> (i=0 ; i<nfilters ; i++)</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                 cpl_table_set_double(out, filters[i], nbentries, mags[i]);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>             nbentries ++ ;</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>     fclose(in) ;</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> out ;</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><!-- 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/hawki__utils_8c_source.html b/html/hawki__utils_8c_source.html
index 0d16d6f..ad908e4 100644
--- a/html/hawki__utils_8c_source.html
+++ b/html/hawki__utils_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_utils.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,1119 +40,1120 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_utils.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_utils.c,v 1.54 2012/12/06 16:55:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/06 16:55:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.54 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "irplib_cat.h"</span>  
-<a name="l00042"></a>00042 <span class="preprocessor">#include "irplib_wcs.h"</span>  
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="preprocessor">#include "hawki_utils.h"</span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include "hawki_pfits.h"</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include "hawki_load.h"</span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00053"></a>00053 
-<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__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a">00065</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_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>  *   hawki_license = 
-<a name="l00068"></a>00068         <span class="stringliteral">"This file is part of the HAWKI 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\n"</span>
-<a name="l00083"></a>00083         <span class="stringliteral">"Foundation, Inc., 59 Temple Place, Suite 330, Boston, \n"</span>
-<a name="l00084"></a>00084         <span class="stringliteral">"MA  02111-1307  USA"</span> ;
-<a name="l00085"></a>00085     <span class="keywordflow">return</span> hawki_license ;
-<a name="l00086"></a>00086 }
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00092"></a>00092 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00093"></a><a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566">00093</a> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>(<span class="keywordtype">void</span>)
-<a name="l00094"></a>00094 {
-<a name="l00095"></a>00095     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);
-<a name="l00096"></a>00096     cpl_msg_info(__func__, <span class="stringliteral">"Welcome to HAWK-I Pipeline release %s"</span>,
-<a name="l00097"></a>00097                  <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>());
-<a name="l00098"></a>00098     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);
-<a name="l00099"></a>00099 }
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00105"></a>00105 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00106"></a><a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3">00106</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>(<span class="keywordtype">void</span>)
-<a name="l00107"></a>00107 {
-<a name="l00108"></a>00108     <span class="keywordflow">return</span> PACKAGE_VERSION;
-<a name="l00109"></a>00109 }
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00118"></a>00118 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00119"></a><a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb">00119</a> cpl_image * <a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a>(
-<a name="l00120"></a>00120         <span class="keyword">const</span> cpl_image     *   in,
-<a name="l00121"></a>00121         <span class="keywordtype">double</span>                  sigma)
-<a name="l00122"></a>00122 {
-<a name="l00123"></a>00123     <span class="keywordtype">double</span>                  med, stdev, threshold ;
-<a name="l00124"></a>00124     cpl_image           *   bpm ;
-<a name="l00125"></a>00125     cpl_image           *   bpm_int ;
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127     <span class="comment">/* Test entries */</span>
-<a name="l00128"></a>00128     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00129"></a>00129     <span class="keywordflow">if</span> (sigma <= 0) <span class="keywordflow">return</span> NULL ;
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     bpm = cpl_image_duplicate(in);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     <span class="comment">/* Compute the threshold */</span>
-<a name="l00134"></a>00134     med = cpl_image_get_median_dev(bpm, &stdev) ;
-<a name="l00135"></a>00135     threshold = med + sigma*stdev ;
-<a name="l00136"></a>00136     cpl_msg_info(__func__, <span class="stringliteral">"Threshold : %g = %g + %g * %g"</span>, 
-<a name="l00137"></a>00137             threshold, med, sigma, stdev) ;
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     <span class="comment">/* Compute the bpm */</span>
-<a name="l00140"></a>00140     cpl_image_threshold(bpm, threshold, threshold, 0.0, 1.0) ;
-<a name="l00141"></a>00141     
-<a name="l00142"></a>00142     <span class="comment">/* Convert */</span>
-<a name="l00143"></a>00143     bpm_int = cpl_image_cast(bpm, CPL_TYPE_INT) ;
-<a name="l00144"></a>00144     cpl_image_delete(bpm) ;
-<a name="l00145"></a>00145     
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> bpm_int ;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00162"></a>00162 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00163"></a>00163 cpl_image * <a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a>
-<a name="l00164"></a><a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877">00164</a> (<span class="keyword">const</span> cpl_image *   in,
-<a name="l00165"></a>00165  <span class="keywordtype">double</span>              sigma,
-<a name="l00166"></a>00166  <span class="keywordtype">double</span>              lowval,
-<a name="l00167"></a>00167  <span class="keywordtype">double</span>              highval)
-<a name="l00168"></a>00168 {
-<a name="l00169"></a>00169     cpl_mask            *   kernel ;
-<a name="l00170"></a>00170     cpl_image           *   filtered ;
-<a name="l00171"></a>00171     <span class="keywordtype">double</span>                  med, stdev, threshold ;
-<a name="l00172"></a>00172     cpl_image           *   bpm_sigma;
-<a name="l00173"></a>00173     cpl_image           *   bpm_lowhigh;
-<a name="l00174"></a>00174     cpl_image           *   bpm;
-<a name="l00175"></a>00175     cpl_image           *   bpm_int ;
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     <span class="comment">/* Test entries */</span>
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00179"></a>00179     <span class="keywordflow">if</span> (sigma <= 0) <span class="keywordflow">return</span> NULL ;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <span class="comment">/* Filter the input image */</span>
-<a name="l00182"></a>00182     kernel = cpl_mask_new(3, 3) ;
-<a name="l00183"></a>00183     cpl_mask_not(kernel) ;
-<a name="l00184"></a>00184     filtered = cpl_image_new(cpl_image_get_size_x(in), cpl_image_get_size_y(in),
-<a name="l00185"></a>00185                              cpl_image_get_type(in));
-<a name="l00186"></a>00186     cpl_image_filter_mask(filtered, in, kernel, CPL_FILTER_MEDIAN, 
-<a name="l00187"></a>00187                           CPL_BORDER_FILTER);
-<a name="l00188"></a>00188     cpl_mask_delete(kernel) ;
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="comment">/* Remove the low freq signal */</span>
-<a name="l00191"></a>00191     bpm_sigma = cpl_image_subtract_create(in, filtered) ;
-<a name="l00192"></a>00192     cpl_image_delete(filtered) ;
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194     <span class="comment">/* Compute the threshold */</span>
-<a name="l00195"></a>00195     med = cpl_image_get_median_dev(bpm_sigma, &stdev) ;
-<a name="l00196"></a>00196     threshold = med + sigma*stdev ;
-<a name="l00197"></a>00197     cpl_msg_info(__func__, <span class="stringliteral">"Threshold : %g = %g + %g * %g"</span>, 
-<a name="l00198"></a>00198             threshold, med, sigma, stdev) ;
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200     <span class="comment">/* Compute the bpm with the sigma values */</span>
-<a name="l00201"></a>00201     cpl_image_threshold(bpm_sigma, threshold, threshold, 0.0, 1.0) ;
-<a name="l00202"></a>00202     
-<a name="l00203"></a>00203     <span class="comment">/* Count the pixels below and above the lowval and highval */</span>
-<a name="l00204"></a>00204     bpm_lowhigh = cpl_image_duplicate(in);
-<a name="l00205"></a>00205     <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a>(bpm_lowhigh, lowval, highval, 0.0, 1.0);
-<a name="l00206"></a>00206     
-<a name="l00207"></a>00207     <span class="comment">/* Merge both masks */</span>
-<a name="l00208"></a>00208     bpm = cpl_image_add_create(bpm_sigma, bpm_lowhigh);
-<a name="l00209"></a>00209     cpl_image_threshold(bpm, 0.0, 1.0, 0.0, 1.0);
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="comment">/* Convert */</span>
-<a name="l00212"></a>00212     bpm_int = cpl_image_cast(bpm, CPL_TYPE_INT) ;
-<a name="l00213"></a>00213     cpl_image_delete(bpm) ;
-<a name="l00214"></a>00214     cpl_image_delete(bpm_sigma);
-<a name="l00215"></a>00215     cpl_image_delete(bpm_lowhigh);
-<a name="l00216"></a>00216     
-<a name="l00217"></a>00217     <span class="keywordflow">return</span> bpm_int ;
-<a name="l00218"></a>00218 }
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00239"></a>00239 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00240"></a>00240 cpl_error_code <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a>
-<a name="l00241"></a><a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0">00241</a> (cpl_image *    image_in,
-<a name="l00242"></a>00242  <span class="keywordtype">double</span>         lo_valid,
-<a name="l00243"></a>00243  <span class="keywordtype">double</span>         hi_valid,
-<a name="l00244"></a>00244  <span class="keywordtype">double</span>         assign_in_range,
-<a name="l00245"></a>00245  <span class="keywordtype">double</span>         assign_out_range)
-<a name="l00246"></a>00246 {
-<a name="l00247"></a>00247     <span class="keywordtype">int</span>   i;
-<a name="l00248"></a>00248     <span class="keywordtype">int</span>   npix;
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     cpl_ensure_code(image_in != NULL, CPL_ERROR_NULL_INPUT);
-<a name="l00251"></a>00251     cpl_ensure_code(lo_valid <= hi_valid, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/* Get number of pixels of image */</span>
-<a name="l00254"></a>00254     npix = cpl_image_get_size_x(image_in) *  cpl_image_get_size_y(image_in);
-<a name="l00255"></a>00255     
-<a name="l00256"></a>00256     <span class="comment">/* Switch on image type */</span>
-<a name="l00257"></a>00257     <span class="keywordflow">switch</span> (cpl_image_get_type(image_in)) 
-<a name="l00258"></a>00258     {
-<a name="l00259"></a>00259         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE: {
-<a name="l00260"></a>00260             <span class="keywordtype">double</span> * pdi = cpl_image_get_data_double(image_in);
-<a name="l00261"></a>00261             <span class="keywordflow">for</span> (i=0; i<npix; i++) {
-<a name="l00262"></a>00262                 <span class="keywordflow">if</span> ((pdi[i]>lo_valid) && (pdi[i]<hi_valid))
-<a name="l00263"></a>00263                     pdi[i] = (double)assign_in_range;
-<a name="l00264"></a>00264                 <span class="keywordflow">else</span>
-<a name="l00265"></a>00265                     pdi[i] = (double)assign_out_range;
-<a name="l00266"></a>00266             }
-<a name="l00267"></a>00267             <span class="keywordflow">break</span>;
-<a name="l00268"></a>00268         }
-<a name="l00269"></a>00269         <span class="keywordflow">case</span> CPL_TYPE_FLOAT: {
-<a name="l00270"></a>00270             <span class="keywordtype">float</span> * pdi = cpl_image_get_data_float(image_in);
-<a name="l00271"></a>00271             <span class="keywordflow">for</span> (i=0; i<npix; i++) {
-<a name="l00272"></a>00272                 <span class="keywordflow">if</span> ((pdi[i]>lo_valid) && (pdi[i]<hi_valid))
-<a name="l00273"></a>00273                     pdi[i] = (float)assign_in_range;
-<a name="l00274"></a>00274                 <span class="keywordflow">else</span>
-<a name="l00275"></a>00275                     pdi[i] = (float)assign_out_range;
-<a name="l00276"></a>00276             }
-<a name="l00277"></a>00277             <span class="keywordflow">break</span>;
-<a name="l00278"></a>00278         }
-<a name="l00279"></a>00279         <span class="keywordflow">case</span> CPL_TYPE_INT: {
-<a name="l00280"></a>00280             <span class="keywordtype">int</span> * pdi = cpl_image_get_data_int(image_in);
-<a name="l00281"></a>00281             <span class="keywordflow">for</span> (i=0; i<npix; i++) {
-<a name="l00282"></a>00282                 <span class="keywordflow">if</span> (((<span class="keywordtype">double</span>)pdi[i]>lo_valid) && ((<span class="keywordtype">double</span>)pdi[i]<hi_valid))
-<a name="l00283"></a>00283                     pdi[i] = (int)assign_in_range;
-<a name="l00284"></a>00284                 <span class="keywordflow">else</span>
-<a name="l00285"></a>00285                     pdi[i] = (int)assign_out_range;
-<a name="l00286"></a>00286             }
-<a name="l00287"></a>00287             <span class="keywordflow">break</span>;
-<a name="l00288"></a>00288         }
-<a name="l00289"></a>00289         <span class="keywordflow">default</span>:
-<a name="l00290"></a>00290           cpl_ensure_code(0, CPL_ERROR_INVALID_TYPE);
-<a name="l00291"></a>00291     }
-<a name="l00292"></a>00292     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00293"></a>00293 }
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00303"></a>00303 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00304"></a>00304 cpl_image * <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>
-<a name="l00305"></a><a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db">00305</a> (cpl_image   ** ima,
-<a name="l00306"></a>00306  <span class="keywordtype">double</span>      *  x,
-<a name="l00307"></a>00307  <span class="keywordtype">double</span>      *  y)
-<a name="l00308"></a>00308 {
-<a name="l00309"></a>00309     <span class="keywordtype">int</span>                     lx, ly ;
-<a name="l00310"></a>00310     cpl_image           *   ima_ext[HAWKI_NB_DETECTORS] ;
-<a name="l00311"></a>00311     cpl_imagelist       *   in ;
-<a name="l00312"></a>00312     cpl_bivector        *   offsets ;
-<a name="l00313"></a>00313     <span class="keywordtype">double</span>              *   offsets_x ;
-<a name="l00314"></a>00314     <span class="keywordtype">double</span>              *   offsets_y ;
-<a name="l00315"></a>00315     cpl_image           **  combined ;
-<a name="l00316"></a>00316     cpl_image           *   stitched ;
-<a name="l00317"></a>00317     <span class="keywordtype">int</span>                     i ;
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319     <span class="comment">/* Test entries */</span>
-<a name="l00320"></a>00320     <span class="keywordflow">if</span> (ima == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00321"></a>00321     <span class="keywordflow">if</span> (x   == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (y   == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="comment">/* Take the smallest size */</span>
-<a name="l00325"></a>00325     lx = cpl_image_get_size_x(ima[0]) ;
-<a name="l00326"></a>00326     ly = cpl_image_get_size_y(ima[0]) ;
-<a name="l00327"></a>00327     <span class="keywordflow">for</span> (i=1 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00328"></a>00328         <span class="keywordflow">if</span> (lx > cpl_image_get_size_x(ima[i]))
-<a name="l00329"></a>00329             lx = cpl_image_get_size_x(ima[i]) ;
-<a name="l00330"></a>00330         <span class="keywordflow">if</span> (ly > cpl_image_get_size_y(ima[i]))
-<a name="l00331"></a>00331             ly = cpl_image_get_size_y(ima[i]) ;
-<a name="l00332"></a>00332     }
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/* Create the image list */</span>
-<a name="l00335"></a>00335     in = cpl_imagelist_new() ;
-<a name="l00336"></a>00336     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {
-<a name="l00337"></a>00337         ima_ext[i] = cpl_image_extract(ima[i], 1, 1, lx, ly) ;
-<a name="l00338"></a>00338         cpl_imagelist_set(in, ima_ext[i], i) ;
-<a name="l00339"></a>00339     }
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     <span class="comment">/* Create the offsets */</span>
-<a name="l00342"></a>00342     offsets = cpl_bivector_new(HAWKI_NB_DETECTORS) ;
-<a name="l00343"></a>00343     offsets_x = cpl_bivector_get_x_data(offsets) ;
-<a name="l00344"></a>00344     offsets_y = cpl_bivector_get_y_data(offsets) ;
-<a name="l00345"></a>00345     offsets_x[0] = HAWKI_DET1_POSX ;
-<a name="l00346"></a>00346     offsets_y[0] = HAWKI_DET1_POSY ;
-<a name="l00347"></a>00347     offsets_x[1] = x[0] - x[1] + HAWKI_DET2_POSX ;
-<a name="l00348"></a>00348     offsets_y[1] = y[0] - y[1] + HAWKI_DET2_POSY ;
-<a name="l00349"></a>00349     offsets_x[2] = x[0] - x[2] + HAWKI_DET3_POSX ;
-<a name="l00350"></a>00350     offsets_y[2] = y[0] - y[2] + HAWKI_DET3_POSY ;
-<a name="l00351"></a>00351     offsets_x[3] = x[0] - x[3] + HAWKI_DET4_POSX ;
-<a name="l00352"></a>00352     offsets_y[3] = y[0] - y[3] + HAWKI_DET4_POSY ;
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     <span class="comment">/* Recombine the images */</span>
-<a name="l00355"></a>00355     <span class="keywordflow">if</span> ((combined = cpl_geom_img_offset_saa(in, offsets,
-<a name="l00356"></a>00356             CPL_KERNEL_DEFAULT, 0, 0, CPL_GEOM_UNION, NULL, NULL)) == NULL) 
-<a name="l00357"></a>00357     {
-<a name="l00358"></a>00358         cpl_msg_error(__func__, <span class="stringliteral">"Cannot recombine the images"</span>) ;
-<a name="l00359"></a>00359         cpl_bivector_delete(offsets) ;
-<a name="l00360"></a>00360         cpl_imagelist_delete(in) ;
-<a name="l00361"></a>00361         <span class="keywordflow">return</span> NULL ;
-<a name="l00362"></a>00362     }
-<a name="l00363"></a>00363     cpl_bivector_delete(offsets) ;
-<a name="l00364"></a>00364     cpl_imagelist_delete(in) ;
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="comment">/* Return  */</span>
-<a name="l00367"></a>00367     stitched = combined[0] ;
-<a name="l00368"></a>00368     cpl_image_delete(combined[1]) ;
-<a name="l00369"></a>00369     cpl_free(combined) ;
-<a name="l00370"></a>00370     <span class="keywordflow">return</span> stitched ;
-<a name="l00371"></a>00371 }
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00383"></a>00383 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00384"></a><a class="code" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96">00384</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96" title="Apply the harmonization.">hawki_apply_harmonization</a>(
-<a name="l00385"></a>00385         cpl_imagelist   *   in,
-<a name="l00386"></a>00386         <span class="keywordtype">double</span>              h1,
-<a name="l00387"></a>00387         <span class="keywordtype">double</span>              h2,
-<a name="l00388"></a>00388         <span class="keywordtype">double</span>              h3,
-<a name="l00389"></a>00389         <span class="keywordtype">double</span>              h4)
-<a name="l00390"></a>00390 {
-<a name="l00391"></a>00391     <span class="comment">/* Test entries */</span>
-<a name="l00392"></a>00392     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 0), h1) ;
-<a name="l00395"></a>00395     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 1), h2) ;
-<a name="l00396"></a>00396     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 2), h3) ;
-<a name="l00397"></a>00397     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 3), h4) ;
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     <span class="keywordflow">return</span> 0 ;
-<a name="l00400"></a>00400 }
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00421"></a>00421 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00422"></a><a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf">00422</a> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf" title="Compute the harmonization.">hawki_compute_harmonization</a>(
-<a name="l00423"></a>00423         <span class="keyword">const</span> cpl_imagelist *   in,
-<a name="l00424"></a>00424         <span class="keywordtype">double</span>              *   h1,
-<a name="l00425"></a>00425         <span class="keywordtype">double</span>              *   h2,
-<a name="l00426"></a>00426         <span class="keywordtype">double</span>              *   h3,
-<a name="l00427"></a>00427         <span class="keywordtype">double</span>              *   h4,
-<a name="l00428"></a>00428         <span class="keywordtype">double</span>              *   h)
-<a name="l00429"></a>00429 {
-<a name="l00430"></a>00430     <span class="keywordtype">int</span>                 width = 64 ;
-<a name="l00431"></a>00431     <span class="keywordtype">int</span>                 nx, ny ;
-<a name="l00432"></a>00432     <span class="keyword">const</span> cpl_image *   ima ;
-<a name="l00433"></a>00433     <span class="keywordtype">double</span>              avg1, avg2, avg3, avg4 ;
-<a name="l00434"></a>00434     <span class="keywordtype">double</span>              val1, val2 ;
-<a name="l00435"></a>00435     <span class="keywordtype">int</span>                 llx, lly, urx, ury ;
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     <span class="comment">/* Test entries */</span>
-<a name="l00438"></a>00438     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00439"></a>00439     <span class="keywordflow">if</span> (h1==NULL || h2==NULL || h3==NULL || h4==NULL || h==NULL) <span class="keywordflow">return</span> -1 ;
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     <span class="comment">/* Compute the avg1 */</span>
-<a name="l00442"></a>00442     ima = cpl_imagelist_get_const(in, 0) ;
-<a name="l00443"></a>00443     nx = cpl_image_get_size_x(ima) ;
-<a name="l00444"></a>00444     ny = cpl_image_get_size_y(ima) ;
-<a name="l00445"></a>00445     llx = 1 ; lly = ny - width + 1 ; urx = nx ; ury = ny ;
-<a name="l00446"></a>00446     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00447"></a>00447     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00448"></a>00448         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 1"</span>) ;
-<a name="l00449"></a>00449         <span class="keywordflow">return</span> -1 ;
-<a name="l00450"></a>00450     }
-<a name="l00451"></a>00451     llx = nx - width + 1 ; lly = 1 ; urx = nx ; ury = ny ;
-<a name="l00452"></a>00452     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00453"></a>00453     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00454"></a>00454         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 1"</span>) ;
-<a name="l00455"></a>00455         <span class="keywordflow">return</span> -1 ;
-<a name="l00456"></a>00456     }
-<a name="l00457"></a>00457     avg1 = (val1 + val2) / 2.0 ;
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="comment">/* Compute the avg2 */</span>
-<a name="l00460"></a>00460     ima = cpl_imagelist_get_const(in, 1) ;
-<a name="l00461"></a>00461     nx = cpl_image_get_size_x(ima) ;
-<a name="l00462"></a>00462     ny = cpl_image_get_size_y(ima) ;
-<a name="l00463"></a>00463     llx = 1 ; lly = 1 ; urx = width ; ury = ny ;
-<a name="l00464"></a>00464     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00466"></a>00466         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 2"</span>) ;
-<a name="l00467"></a>00467         <span class="keywordflow">return</span> -1 ;
-<a name="l00468"></a>00468     }
-<a name="l00469"></a>00469     llx = 1 ; lly = ny - width + 1 ; urx = nx ; ury = ny ;
-<a name="l00470"></a>00470     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00471"></a>00471     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00472"></a>00472         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 2"</span>) ;
-<a name="l00473"></a>00473         <span class="keywordflow">return</span> -1 ;
-<a name="l00474"></a>00474     }
-<a name="l00475"></a>00475     avg2 = (val1 + val2) / 2.0 ;
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477     <span class="comment">/* Compute the avg3 */</span>
-<a name="l00478"></a>00478     ima = cpl_imagelist_get_const(in, 2) ;
-<a name="l00479"></a>00479     nx = cpl_image_get_size_x(ima) ;
-<a name="l00480"></a>00480     ny = cpl_image_get_size_y(ima) ;
-<a name="l00481"></a>00481     llx = 1 ; lly = 1 ; urx = nx ; ury = width ;
-<a name="l00482"></a>00482     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00483"></a>00483     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00484"></a>00484         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 3"</span>) ;
-<a name="l00485"></a>00485         <span class="keywordflow">return</span> -1 ;
-<a name="l00486"></a>00486     }
-<a name="l00487"></a>00487     llx = nx - width + 1 ; lly = 1 ; urx = nx ; ury = ny ;
-<a name="l00488"></a>00488     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00489"></a>00489     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00490"></a>00490         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 3"</span>) ;
-<a name="l00491"></a>00491         <span class="keywordflow">return</span> -1 ;
-<a name="l00492"></a>00492     }
-<a name="l00493"></a>00493     avg3 = (val1 + val2) / 2.0 ;
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495     <span class="comment">/* Compute the avg4 */</span>
-<a name="l00496"></a>00496     ima = cpl_imagelist_get_const(in, 3) ;
-<a name="l00497"></a>00497     nx = cpl_image_get_size_x(ima) ;
-<a name="l00498"></a>00498     ny = cpl_image_get_size_y(ima) ;
-<a name="l00499"></a>00499     llx = 1 ; lly = 1 ; urx = width ; ury = ny ;
-<a name="l00500"></a>00500     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00502"></a>00502         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 4"</span>) ;
-<a name="l00503"></a>00503         <span class="keywordflow">return</span> -1 ;
-<a name="l00504"></a>00504     }
-<a name="l00505"></a>00505     llx = 1 ; lly = 1 ; urx = nx ; ury = width ;
-<a name="l00506"></a>00506     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;
-<a name="l00507"></a>00507     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00508"></a>00508         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 4"</span>) ;
-<a name="l00509"></a>00509         <span class="keywordflow">return</span> -1 ;
-<a name="l00510"></a>00510     }
-<a name="l00511"></a>00511     avg4 = (val1 + val2) / 2.0 ;
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     <span class="comment">/* Compute h */</span>
-<a name="l00514"></a>00514     *h = (avg1 + avg2 + avg3 + avg4) / 4.0 ;
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     *h1 = *h / avg1 ;
-<a name="l00517"></a>00517     *h2 = *h / avg2 ;
-<a name="l00518"></a>00518     *h3 = *h / avg3 ;
-<a name="l00519"></a>00519     *h4 = *h / avg4 ;
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521     <span class="keywordflow">return</span> 0 ;
-<a name="l00522"></a>00522 }
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00530"></a>00530 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00531"></a><a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd">00531</a> cpl_image * <a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd" title="Compute the large scale background.">hawki_compute_lsbg</a>(<span class="keyword">const</span> cpl_image * in)
-<a name="l00532"></a>00532 {
-<a name="l00533"></a>00533     cpl_image       *   out ;
-<a name="l00534"></a>00534     cpl_image       *   tmp ;
-<a name="l00535"></a>00535     cpl_image       *   filtered ;
-<a name="l00536"></a>00536     cpl_image       *   subsampled ;
-<a name="l00537"></a>00537     cpl_mask        *   kernel ;
-<a name="l00538"></a>00538     <span class="keywordtype">int</span>                 nscales ;
-<a name="l00539"></a>00539     cpl_polynomial  *   poly ;
-<a name="l00540"></a>00540     cpl_bivector    *   xy_pos ;
-<a name="l00541"></a>00541     cpl_vector      *   vals ;
-<a name="l00542"></a>00542     <span class="keywordtype">int</span>                 quad_sz, nbpoints, lx, ly, nx, ny ;
-<a name="l00543"></a>00543     <span class="keywordtype">double</span>          *   pxy_pos_x ;
-<a name="l00544"></a>00544     <span class="keywordtype">double</span>          *   pxy_pos_y ;
-<a name="l00545"></a>00545     <span class="keywordtype">double</span>          *   pvals ;
-<a name="l00546"></a>00546     <span class="keywordtype">float</span>           *   pima ;
-<a name="l00547"></a>00547     <span class="keywordtype">int</span>                 i, j ;
-<a name="l00548"></a>00548 
-<a name="l00549"></a>00549     <span class="comment">/* Check entries */</span>
-<a name="l00550"></a>00550     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00551"></a>00551     nx = cpl_image_get_size_x(in) ;
-<a name="l00552"></a>00552     ny = cpl_image_get_size_y(in) ;
-<a name="l00553"></a>00553     
-<a name="l00554"></a>00554     <span class="comment">/* Initialise */</span>
-<a name="l00555"></a>00555     nscales = 7 ;
-<a name="l00556"></a>00556     tmp = (cpl_image *)in ;
-<a name="l00557"></a>00557     subsampled = NULL ;
-<a name="l00558"></a>00558     
-<a name="l00559"></a>00559     <span class="comment">/* Check entries */</span>
-<a name="l00560"></a>00560     quad_sz = pow(2, (<span class="keywordtype">double</span>)nscales) ;
-<a name="l00561"></a>00561     lx = nx / quad_sz ;
-<a name="l00562"></a>00562     ly = ny / quad_sz ;
-<a name="l00563"></a>00563     nbpoints = lx * ly ;
-<a name="l00564"></a>00564     <span class="keywordflow">if</span> (quad_sz >= nx || quad_sz >= ny) <span class="keywordflow">return</span> NULL ;
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566     <span class="comment">/* Create filter kernel */</span>
-<a name="l00567"></a>00567     kernel = cpl_mask_new(3, 3) ;
-<a name="l00568"></a>00568     cpl_mask_not(kernel) ;
-<a name="l00569"></a>00569 
-<a name="l00570"></a>00570     <span class="comment">/* Loop nscales times */</span>
-<a name="l00571"></a>00571     <span class="keywordflow">for</span> (i=0 ; i<nscales ; i++) {
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573         <span class="comment">/* Filter the image */</span>
-<a name="l00574"></a>00574         filtered = cpl_image_new(cpl_image_get_size_x(tmp),
-<a name="l00575"></a>00575                                  cpl_image_get_size_y(tmp),
-<a name="l00576"></a>00576                                  cpl_image_get_type(tmp));
-<a name="l00577"></a>00577         cpl_image_filter_mask(filtered, in, kernel, CPL_FILTER_MEDIAN, 
-<a name="l00578"></a>00578                               CPL_BORDER_FILTER);
-<a name="l00579"></a>00579         <span class="keywordflow">if</span> (i>0) cpl_image_delete(tmp) ;
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581         <span class="comment">/* Subsample the image */</span>
-<a name="l00582"></a>00582         subsampled = cpl_image_extract_subsample(filtered, 2, 2) ;
-<a name="l00583"></a>00583         cpl_image_delete(filtered) ;
-<a name="l00584"></a>00584     
-<a name="l00585"></a>00585         tmp = subsampled ;
-<a name="l00586"></a>00586     }
-<a name="l00587"></a>00587     cpl_mask_delete(kernel) ;
-<a name="l00588"></a>00588 
-<a name="l00589"></a>00589     <span class="comment">/* Check nbpoints */</span>
-<a name="l00590"></a>00590     <span class="keywordflow">if</span> (nbpoints != 
-<a name="l00591"></a>00591             cpl_image_get_size_x(subsampled)*cpl_image_get_size_y(subsampled)) {
-<a name="l00592"></a>00592         cpl_msg_error(__func__, <span class="stringliteral">"Invalid size"</span>) ;
-<a name="l00593"></a>00593         cpl_image_delete(subsampled) ;
-<a name="l00594"></a>00594         <span class="keywordflow">return</span> NULL ;
-<a name="l00595"></a>00595     }
-<a name="l00596"></a>00596     
-<a name="l00597"></a>00597     <span class="comment">/* Create anchor points for the fit */</span>
-<a name="l00598"></a>00598     xy_pos = cpl_bivector_new(nbpoints) ;
-<a name="l00599"></a>00599     vals = cpl_vector_new(nbpoints) ;
-<a name="l00600"></a>00600     pxy_pos_x = cpl_bivector_get_x_data(xy_pos) ;
-<a name="l00601"></a>00601     pxy_pos_y = cpl_bivector_get_y_data(xy_pos) ;
-<a name="l00602"></a>00602     pvals = cpl_vector_get_data(vals) ;
-<a name="l00603"></a>00603     pima = cpl_image_get_data_float(subsampled) ;
-<a name="l00604"></a>00604     <span class="keywordflow">for</span> (j=0 ; j<ly ; j++) {
-<a name="l00605"></a>00605         <span class="keywordflow">for</span> (i=0 ; i<lx ; i++) {
-<a name="l00606"></a>00606             pxy_pos_x[i+j*lx] = i * quad_sz + quad_sz/2 ;
-<a name="l00607"></a>00607             pxy_pos_y[i+j*lx] = j * quad_sz + quad_sz/2 ;
-<a name="l00608"></a>00608             pvals[i+j*lx] = (double)pima[i+j*lx];
-<a name="l00609"></a>00609         }
-<a name="l00610"></a>00610     }
-<a name="l00611"></a>00611     cpl_image_delete(subsampled) ;
-<a name="l00612"></a>00612 
-<a name="l00613"></a>00613     <span class="comment">/* Fit the polynomial */</span>
-<a name="l00614"></a>00614     <span class="keywordflow">if</span> ((poly = cpl_polynomial_fit_2d_create(xy_pos, vals, 3, NULL)) == NULL) {
-<a name="l00615"></a>00615         cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit the polynomial"</span>) ;
-<a name="l00616"></a>00616         cpl_bivector_delete(xy_pos) ;
-<a name="l00617"></a>00617         cpl_vector_delete(vals) ;
-<a name="l00618"></a>00618         <span class="keywordflow">return</span> NULL ;
-<a name="l00619"></a>00619     }
-<a name="l00620"></a>00620     cpl_bivector_delete(xy_pos) ;
-<a name="l00621"></a>00621     cpl_vector_delete(vals) ;
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     <span class="comment">/* Regenerate the big bgd image */</span>
-<a name="l00624"></a>00624     out = cpl_image_duplicate(in) ;
-<a name="l00625"></a>00625     cpl_image_fill_polynomial(out, poly, 1.0, 1.0, 1.0, 1.0) ;
-<a name="l00626"></a>00626     cpl_polynomial_delete(poly) ;
-<a name="l00627"></a>00627     
-<a name="l00628"></a>00628     <span class="keywordflow">return</span> out ;
-<a name="l00629"></a>00629 }
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00638"></a>00638 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00639"></a><a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9">00639</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(
-<a name="l00640"></a>00640         <span class="keyword">const</span> cpl_frameset  *   in,
-<a name="l00641"></a>00641         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   tag)
-<a name="l00642"></a>00642 {
-<a name="l00643"></a>00643     <span class="keyword">const</span> cpl_frame     *   cur_frame ;
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="comment">/* Get the frame  */</span>
-<a name="l00646"></a>00646     <span class="keywordflow">if</span> ((cur_frame = cpl_frameset_find_const(in, tag)) == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00647"></a>00647     <span class="keywordflow">return</span> cpl_frame_get_filename(cur_frame) ;
-<a name="l00648"></a>00648 }
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00656"></a>00656 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00657"></a><a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade">00657</a> hawki_band <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * f)
-<a name="l00658"></a>00658 {
-<a name="l00659"></a>00659     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"J"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_J ;
-<a name="l00660"></a>00660     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"H"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_H ;
-<a name="l00661"></a>00661     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"K"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_K ;
-<a name="l00662"></a>00662     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"Ks"</span>))           <span class="keywordflow">return</span> HAWKI_BAND_K ;
-<a name="l00663"></a>00663     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"Y"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_Y ;
-<a name="l00664"></a>00664     <span class="keywordflow">return</span> HAWKI_BAND_UNKNOWN ;
-<a name="l00665"></a>00665 }
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667 <span class="comment">/*-------------------------------------------------------------------------*/</span>
-<a name="l00673"></a>00673 <span class="comment">/*--------------------------------------------------------------------------*/</span>
-<a name="l00674"></a><a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4">00674</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(hawki_band band)
-<a name="l00675"></a>00675 {
-<a name="l00676"></a>00676     <span class="keywordflow">switch</span> (band) {
-<a name="l00677"></a>00677         <span class="keywordflow">case</span> HAWKI_BAND_J:        <span class="keywordflow">return</span> <span class="stringliteral">"J"</span> ;
-<a name="l00678"></a>00678         <span class="keywordflow">case</span> HAWKI_BAND_H:        <span class="keywordflow">return</span> <span class="stringliteral">"H"</span> ;
-<a name="l00679"></a>00679         <span class="keywordflow">case</span> HAWKI_BAND_K:        <span class="keywordflow">return</span> <span class="stringliteral">"K"</span> ;
-<a name="l00680"></a>00680         <span class="keywordflow">case</span> HAWKI_BAND_Y:        <span class="keywordflow">return</span> <span class="stringliteral">"Y"</span> ;
-<a name="l00681"></a>00681         <span class="keywordflow">default</span>:            <span class="keywordflow">return</span> <span class="stringliteral">"Unknown"</span> ;
-<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="l00694"></a>00694 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00695"></a><a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd">00695</a> cpl_bivector * <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(<span class="keyword">const</span> cpl_frameset * fset)
-<a name="l00696"></a>00696 {
-<a name="l00697"></a>00697     cpl_bivector        *   offsets ;
-<a name="l00698"></a>00698     <span class="keywordtype">double</span>              *   offsets_x ;
-<a name="l00699"></a>00699     <span class="keywordtype">double</span>              *   offsets_y ;
-<a name="l00700"></a>00700     <span class="keyword">const</span> cpl_frame     *   frame ;
-<a name="l00701"></a>00701     cpl_propertylist    *   plist ;
-<a name="l00702"></a>00702     <span class="keywordtype">int</span>                     nfiles ;
-<a name="l00703"></a>00703     <span class="keywordtype">int</span>                     i ;
-<a name="l00704"></a>00704     cpl_errorstate          error_prevstate = cpl_errorstate_get();
-<a name="l00705"></a>00705     
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707     <span class="comment">/* Test entries */</span>
-<a name="l00708"></a>00708     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00709"></a>00709 
-<a name="l00710"></a>00710     <span class="comment">/* Create the offsets bi vector */</span>
-<a name="l00711"></a>00711     nfiles = cpl_frameset_get_size(fset) ;
-<a name="l00712"></a>00712     offsets = cpl_bivector_new(nfiles) ;
-<a name="l00713"></a>00713     offsets_x = cpl_bivector_get_x_data(offsets) ;
-<a name="l00714"></a>00714     offsets_y = cpl_bivector_get_y_data(offsets) ;
-<a name="l00715"></a>00715     <span class="keywordflow">for</span> (i=0 ; i<nfiles ; i++) {
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717         <span class="comment">/* X and Y offsets */</span>
-<a name="l00718"></a>00718         frame = cpl_frameset_get_frame_const(fset, i) ;
-<a name="l00719"></a>00719         plist=cpl_propertylist_load(cpl_frame_get_filename(frame),0);
-<a name="l00720"></a>00720         offsets_x[i] = <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(plist) ;
-<a name="l00721"></a>00721         offsets_y[i] = <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(plist) ;
-<a name="l00722"></a>00722         cpl_propertylist_delete(plist) ;
-<a name="l00723"></a>00723         <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))
-<a name="l00724"></a>00724         {
-<a name="l00725"></a>00725             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get offsets from header"</span>) ;
-<a name="l00726"></a>00726             cpl_bivector_delete(offsets) ;
-<a name="l00727"></a>00727             <span class="keywordflow">return</span> NULL ;
-<a name="l00728"></a>00728         }
-<a name="l00729"></a>00729     }
-<a name="l00730"></a>00730     <span class="keywordflow">return</span> offsets ;
-<a name="l00731"></a>00731 }
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00739"></a>00739 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00740"></a><a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46">00740</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(cpl_frameset *   <span class="keyword">set</span>)
-<a name="l00741"></a>00741 {
-<a name="l00742"></a>00742     <span class="keywordtype">int</span>                     nframes;
-<a name="l00743"></a>00743     cpl_frame           *   cur_frame;
-<a name="l00744"></a>00744     cpl_propertylist    *   plist;
-<a name="l00745"></a>00745     <span class="keywordtype">int</span>                     iframe;
-<a name="l00746"></a>00746     <span class="keywordtype">double</span>                  mean_airmass = 0.0;
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     <span class="comment">/* Test inputs  */</span>
-<a name="l00749"></a>00749     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -1;
-<a name="l00750"></a>00750 
-<a name="l00751"></a>00751     <span class="comment">/* Initialize */</span>
-<a name="l00752"></a>00752     nframes = cpl_frameset_get_size(<span class="keyword">set</span>);
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) 
-<a name="l00755"></a>00755     {
-<a name="l00756"></a>00756         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, iframe);
-<a name="l00757"></a>00757         plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0);
-<a name="l00758"></a>00758         mean_airmass +=   <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) +
-<a name="l00759"></a>00759                           <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist); 
-<a name="l00760"></a>00760         cpl_propertylist_delete(plist);
-<a name="l00761"></a>00761     }
-<a name="l00762"></a>00762     mean_airmass /= 2. * nframes;
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     <span class="comment">/* Free and return */</span>
-<a name="l00765"></a>00765     <span class="keywordflow">return</span> mean_airmass;
-<a name="l00766"></a>00766 }
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00780"></a>00780 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00781"></a>00781 <span class="keywordtype">int</span> * <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a>
-<a name="l00782"></a><a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884">00782</a> (<span class="keyword">const</span> cpl_frameset * in)
-<a name="l00783"></a>00783 {
-<a name="l00784"></a>00784     <span class="keywordtype">int</span>             *   labels ;
-<a name="l00785"></a>00785     cpl_bivector    *   offsets ;
-<a name="l00786"></a>00786     <span class="keywordtype">int</span>                 nframes ;
-<a name="l00787"></a>00787     <span class="keywordtype">double</span>          *   poff_x ;
-<a name="l00788"></a>00788     <span class="keywordtype">double</span>          *   poff_y ;
-<a name="l00789"></a>00789     <span class="keywordtype">double</span>              off_x_mean;
-<a name="l00790"></a>00790     <span class="keywordtype">double</span>              off_y_mean;
-<a name="l00791"></a>00791     <span class="keywordtype">int</span>                 i ;
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="comment">/* Check entries */</span>
-<a name="l00794"></a>00794     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     <span class="comment">/* Initialise */</span>
-<a name="l00797"></a>00797     nframes = cpl_frameset_get_size(in) ;
-<a name="l00798"></a>00798 
-<a name="l00799"></a>00799     <span class="comment">/* Get the offsets */</span>
-<a name="l00800"></a>00800     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>((cpl_frameset *)in)) == NULL) {
-<a name="l00801"></a>00801         cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the offsets"</span>) ;
-<a name="l00802"></a>00802         <span class="keywordflow">return</span> NULL ;
-<a name="l00803"></a>00803     }
-<a name="l00804"></a>00804     poff_x = cpl_bivector_get_x_data(offsets) ;
-<a name="l00805"></a>00805     poff_y = cpl_bivector_get_y_data(offsets) ;
-<a name="l00806"></a>00806 
-<a name="l00807"></a>00807     <span class="comment">/* Get the mean offsets */</span>
-<a name="l00808"></a>00808     off_x_mean = cpl_vector_get_mean(cpl_bivector_get_x(offsets));
-<a name="l00809"></a>00809     off_y_mean = cpl_vector_get_mean(cpl_bivector_get_y(offsets));
-<a name="l00810"></a>00810     
-<a name="l00811"></a>00811     <span class="comment">/* Allocate labels */</span>
-<a name="l00812"></a>00812     labels = cpl_malloc(nframes * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)) ;
-<a name="l00813"></a>00813     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {
-<a name="l00814"></a>00814         <span class="keywordflow">if</span> (poff_x[i] - off_x_mean <= 0 && poff_y[i] - off_y_mean <= 0)
-<a name="l00815"></a>00815             labels[i] = 1 ;
-<a name="l00816"></a>00816         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean >= 0 && poff_y[i] - off_y_mean <= 0) 
-<a name="l00817"></a>00817             labels[i] = 2 ;
-<a name="l00818"></a>00818         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean >= 0 && poff_y[i] - off_y_mean >= 0) 
-<a name="l00819"></a>00819             labels[i] = 3 ;
-<a name="l00820"></a>00820         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean <= 0 && poff_y[i] - off_y_mean >= 0) 
-<a name="l00821"></a>00821             labels[i] = 4 ;
-<a name="l00822"></a>00822         <span class="keywordflow">else</span> labels[i] = 0 ;
-<a name="l00823"></a>00823     }
-<a name="l00824"></a>00824     cpl_bivector_delete(offsets) ;
-<a name="l00825"></a>00825     <span class="keywordflow">return</span> labels ;
-<a name="l00826"></a>00826 }
-<a name="l00827"></a>00827 
-<a name="l00828"></a>00828 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00835"></a>00835 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00836"></a>00836 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a>
-<a name="l00837"></a><a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0">00837</a> (<span class="keyword">const</span> cpl_frameset * in,
-<a name="l00838"></a>00838  <span class="keywordtype">double</span>               star_ra,
-<a name="l00839"></a>00839  <span class="keywordtype">double</span>               star_dec,
-<a name="l00840"></a>00840  <span class="keywordtype">int</span>                * labels)
-<a name="l00841"></a>00841 {
-<a name="l00842"></a>00842     <span class="keywordtype">int</span>     nframes;
-<a name="l00843"></a>00843     <span class="keywordtype">int</span>     idet, iframe;
-<a name="l00844"></a>00844 
-<a name="l00845"></a>00845     <span class="comment">/* Check entries */</span>
-<a name="l00846"></a>00846     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1;
-<a name="l00847"></a>00847 
-<a name="l00848"></a>00848     <span class="comment">/* Initialise */</span>
-<a name="l00849"></a>00849     nframes = cpl_frameset_get_size(in) ;
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     <span class="comment">/* Allocate labels */</span>
-<a name="l00852"></a>00852     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) 
-<a name="l00853"></a>00853     {
-<a name="l00854"></a>00854         <span class="keyword">const</span> <span class="keywordtype">char</span> * filename;
-<a name="l00855"></a>00855         filename = cpl_frame_get_filename
-<a name="l00856"></a>00856             (cpl_frameset_get_frame_const(in, iframe));
-<a name="l00857"></a>00857         
-<a name="l00858"></a>00858         <span class="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)
-<a name="l00859"></a>00859         {
-<a name="l00860"></a>00860             cpl_propertylist * main_header;
-<a name="l00861"></a>00861             cpl_propertylist * ext_header;
-<a name="l00862"></a>00862             cpl_wcs          * wcs;
-<a name="l00863"></a>00863             <span class="keywordtype">double</span>             naxis1, naxis2;
-<a name="l00864"></a>00864             <span class="keywordtype">double</span>             star_x, star_y;
-<a name="l00865"></a>00865         
-<a name="l00866"></a>00866             <span class="comment">/* Get the headers */</span>
-<a name="l00867"></a>00867             main_header = cpl_propertylist_load(filename, 0);
-<a name="l00868"></a>00868             ext_header  = cpl_propertylist_load
-<a name="l00869"></a>00869                 (filename, <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename,idet + 1));
-<a name="l00870"></a>00870             
-<a name="l00871"></a>00871             <span class="comment">/* Get the position of the star in pixels */</span>
-<a name="l00872"></a>00872             wcs = cpl_wcs_new_from_propertylist(ext_header);
-<a name="l00873"></a>00873             <span class="keywordflow">if</span>(wcs == NULL)
-<a name="l00874"></a>00874             {
-<a name="l00875"></a>00875                 cpl_msg_error(__func__, <span class="stringliteral">"Could not get WCS info"</span>);
-<a name="l00876"></a>00876                 cpl_propertylist_delete(ext_header);
-<a name="l00877"></a>00877                 cpl_propertylist_delete(main_header);
-<a name="l00878"></a>00878                 <span class="keywordflow">return</span> -1;
-<a name="l00879"></a>00879             }
-<a name="l00880"></a>00880             <span class="keywordflow">if</span>(irplib_wcs_radectoxy(wcs, star_ra, star_dec, &star_x, &star_y)
-<a name="l00881"></a>00881                     != CPL_ERROR_NONE)
-<a name="l00882"></a>00882             {
-<a name="l00883"></a>00883                 cpl_errorstate_set(CPL_ERROR_NONE);
-<a name="l00884"></a>00884             }
-<a name="l00885"></a>00885             
-<a name="l00886"></a>00886             <span class="comment">/* Check for the limits */</span>
-<a name="l00887"></a>00887             naxis1 = (double)<a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(ext_header);
-<a name="l00888"></a>00888             naxis2 = (double)<a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(ext_header);
-<a name="l00889"></a>00889             <span class="keywordflow">if</span>(star_x > 0 && star_x < naxis1 && star_y > 0 && star_y < naxis2)
-<a name="l00890"></a>00890             {
-<a name="l00891"></a>00891                 labels[iframe] = idet + 1;
-<a name="l00892"></a>00892             }
-<a name="l00893"></a>00893             
-<a name="l00894"></a>00894             <span class="comment">/* Free */</span>
-<a name="l00895"></a>00895             cpl_propertylist_delete(ext_header);
-<a name="l00896"></a>00896             cpl_propertylist_delete(main_header);
-<a name="l00897"></a>00897             cpl_wcs_delete(wcs);
-<a name="l00898"></a>00898         }
-<a name="l00899"></a>00899         <span class="keywordflow">if</span>(labels[iframe] == 0)
-<a name="l00900"></a>00900         {
-<a name="l00901"></a>00901             cpl_msg_error(__func__,<span class="stringliteral">"Frame %d does not contain the star in any "</span>
-<a name="l00902"></a>00902                           <span class="stringliteral">"detector"</span>, iframe + 1);
-<a name="l00903"></a>00903         }
-<a name="l00904"></a>00904     }
-<a name="l00905"></a>00905     <span class="keywordflow">return</span> 0;
-<a name="l00906"></a>00906 }
-<a name="l00907"></a>00907 
-<a name="l00908"></a>00908 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00916"></a>00916 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00917"></a>00917 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a>
-<a name="l00918"></a><a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04">00918</a> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid)
-<a name="l00919"></a>00919 {
-<a name="l00920"></a>00920     <span class="keywordtype">double</span> max_val = DBL_MIN;
-<a name="l00921"></a>00921     <span class="keywordtype">int</span>    initialized = 0;
-<a name="l00922"></a>00922     <span class="keywordtype">int</span>    ival;
-<a name="l00923"></a>00923     <span class="keywordtype">int</span>    nvals;
-<a name="l00924"></a>00924     
-<a name="l00925"></a>00925     nvals = cpl_vector_get_size(<span class="keyword">self</span>);
-<a name="l00926"></a>00926     <span class="keywordflow">for</span>(ival = 0; ival < nvals; ++ival)
-<a name="l00927"></a>00927     {
-<a name="l00928"></a>00928         <span class="keywordflow">if</span>(cpl_vector_get(valid, ival) >= -0.5) 
-<a name="l00929"></a>00929         {
-<a name="l00930"></a>00930             <span class="keywordflow">if</span>(!initialized)
-<a name="l00931"></a>00931             {
-<a name="l00932"></a>00932                 max_val = cpl_vector_get(<span class="keyword">self</span>, ival);
-<a name="l00933"></a>00933                 initialized = 1;
-<a name="l00934"></a>00934             }
-<a name="l00935"></a>00935             <span class="keywordflow">if</span>(cpl_vector_get(<span class="keyword">self</span>, ival) > max_val)
-<a name="l00936"></a>00936                 max_val = cpl_vector_get(<span class="keyword">self</span>, ival);
-<a name="l00937"></a>00937         }
-<a name="l00938"></a>00938     }
-<a name="l00939"></a>00939     <span class="keywordflow">return</span> max_val;
-<a name="l00940"></a>00940 }
-<a name="l00941"></a>00941 
-<a name="l00942"></a>00942 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00950"></a>00950 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00951"></a>00951 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a>
-<a name="l00952"></a><a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846">00952</a> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid)
-<a name="l00953"></a>00953 {
-<a name="l00954"></a>00954     <span class="keywordtype">double</span> min_val = DBL_MAX;
-<a name="l00955"></a>00955     <span class="keywordtype">int</span>    initialized = 0;
-<a name="l00956"></a>00956     <span class="keywordtype">int</span>    ival;
-<a name="l00957"></a>00957     <span class="keywordtype">int</span>    nvals;
-<a name="l00958"></a>00958     
-<a name="l00959"></a>00959     nvals = cpl_vector_get_size(<span class="keyword">self</span>);
-<a name="l00960"></a>00960     <span class="keywordflow">for</span>(ival = 0; ival < nvals; ++ival)
-<a name="l00961"></a>00961     {
-<a name="l00962"></a>00962         <span class="keywordflow">if</span>(cpl_vector_get(valid, ival) >= -0.5) 
-<a name="l00963"></a>00963         {
-<a name="l00964"></a>00964             <span class="keywordflow">if</span>(!initialized)
-<a name="l00965"></a>00965             {
-<a name="l00966"></a>00966                 min_val = cpl_vector_get(<span class="keyword">self</span>, ival);
-<a name="l00967"></a>00967                 initialized = 1;
-<a name="l00968"></a>00968             }
-<a name="l00969"></a>00969             <span class="keywordflow">if</span>(cpl_vector_get(<span class="keyword">self</span>, ival) < min_val)
-<a name="l00970"></a>00970                 min_val = cpl_vector_get(<span class="keyword">self</span>, ival);
-<a name="l00971"></a>00971         }
-<a name="l00972"></a>00972     }
-<a name="l00973"></a>00973     <span class="keywordflow">return</span> min_val;
-<a name="l00974"></a>00974 }
-<a name="l00975"></a>00975 
-<a name="l00976"></a>00976 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00982"></a>00982 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00983"></a><a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886">00983</a> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(cpl_vector * vec)
-<a name="l00984"></a>00984 {
-<a name="l00985"></a>00985     <span class="keywordtype">int</span>                 nb ;
-<a name="l00986"></a>00986     <span class="keywordtype">int</span>                 nbins ;
-<a name="l00987"></a>00987     <span class="keywordtype">double</span>              min, max ;
-<a name="l00988"></a>00988     <span class="keywordtype">double</span>              bin_size ;
-<a name="l00989"></a>00989     cpl_bivector    *   hist ;
-<a name="l00990"></a>00990     cpl_vector      *   hist_x ;
-<a name="l00991"></a>00991     cpl_vector      *   hist_y ;
-<a name="l00992"></a>00992     <span class="keywordtype">double</span>              cur_val ;
-<a name="l00993"></a>00993     <span class="keywordtype">int</span>                 cur_bin ;
-<a name="l00994"></a>00994     <span class="keywordtype">double</span>              max_val ;
-<a name="l00995"></a>00995     <span class="keywordtype">int</span>                 max_bin ;
-<a name="l00996"></a>00996     <span class="keywordtype">double</span>              mode ;
-<a name="l00997"></a>00997     <span class="keywordtype">int</span>                 i ;
-<a name="l00998"></a>00998 
-<a name="l00999"></a>00999     <span class="comment">/* Test entries  */</span>
-<a name="l01000"></a>01000     <span class="keywordflow">if</span> (vec == NULL) <span class="keywordflow">return</span> -1.0 ;
-<a name="l01001"></a>01001     
-<a name="l01002"></a>01002     <span class="comment">/* Initialise */</span>
-<a name="l01003"></a>01003     nb = cpl_vector_get_size(vec) ;
-<a name="l01004"></a>01004 
-<a name="l01005"></a>01005     <span class="comment">/* Create the histogram */</span>
-<a name="l01006"></a>01006     nbins = 10 ;
-<a name="l01007"></a>01007     min = cpl_vector_get_min(vec) ;
-<a name="l01008"></a>01008     max = cpl_vector_get_max(vec) ;
-<a name="l01009"></a>01009     bin_size = (max-min)/nbins ;
-<a name="l01010"></a>01010     hist = cpl_bivector_new(nbins) ;
-<a name="l01011"></a>01011     hist_x = cpl_bivector_get_x(hist) ;
-<a name="l01012"></a>01012     hist_y = cpl_bivector_get_y(hist) ;
-<a name="l01013"></a>01013     cpl_vector_fill(hist_x, 0.0) ;
-<a name="l01014"></a>01014     cpl_vector_fill(hist_y, 0.0) ;
-<a name="l01015"></a>01015     <span class="keywordflow">for</span> (i=0 ; i<nbins ; i++) {
-<a name="l01016"></a>01016         cpl_vector_set(hist_x, i, min + i * bin_size) ;
-<a name="l01017"></a>01017     }
-<a name="l01018"></a>01018     <span class="keywordflow">for</span> (i=0 ; i<nb ; i++) {
-<a name="l01019"></a>01019         cur_val = cpl_vector_get(vec, i) ;
-<a name="l01020"></a>01020         cur_bin = (int)((cur_val - min) / bin_size) ;
-<a name="l01021"></a>01021         <span class="keywordflow">if</span> (cur_bin >= nbins) cur_bin -= 1.0 ;
-<a name="l01022"></a>01022         cur_val = cpl_vector_get(hist_y, cur_bin) ;
-<a name="l01023"></a>01023         cur_val += 1.0 ;
-<a name="l01024"></a>01024         cpl_vector_set(hist_y, cur_bin, cur_val) ;
-<a name="l01025"></a>01025     }
-<a name="l01026"></a>01026     
-<a name="l01027"></a>01027     <span class="comment">/* Get the mode of the histogram */</span>
-<a name="l01028"></a>01028     max_val = cpl_vector_get(hist_y, 0) ;
-<a name="l01029"></a>01029     max_bin = 0 ;
-<a name="l01030"></a>01030     <span class="keywordflow">for</span> (i=0 ; i<nbins ; i++) {
-<a name="l01031"></a>01031         cur_val = cpl_vector_get(hist_y, i) ;
-<a name="l01032"></a>01032         <span class="keywordflow">if</span> (cur_val > max_val) {
-<a name="l01033"></a>01033             max_val = cur_val ;
-<a name="l01034"></a>01034             max_bin = i ;
-<a name="l01035"></a>01035         }
-<a name="l01036"></a>01036     }
-<a name="l01037"></a>01037     mode = cpl_vector_get(hist_x, max_bin) ;
-<a name="l01038"></a>01038     cpl_bivector_delete(hist) ;
-<a name="l01039"></a>01039     <span class="keywordflow">return</span> mode ;
-<a name="l01040"></a>01040 }
-<a name="l01041"></a>01041 
-<a name="l01042"></a>01042 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01050"></a>01050 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01051"></a>01051 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>
-<a name="l01052"></a><a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7">01052</a> (cpl_frameset * frames, <span class="keywordtype">double</span> (*func)(<span class="keyword">const</span> cpl_propertylist *))
-<a name="l01053"></a>01053 {
-<a name="l01054"></a>01054     <span class="keywordtype">int</span>                iframe;
-<a name="l01055"></a>01055     <span class="keywordtype">double</span>             value = 0;
-<a name="l01056"></a>01056     
-<a name="l01057"></a>01057     <span class="keywordflow">if</span>(cpl_frameset_get_size(frames) < 2)
-<a name="l01058"></a>01058        <span class="keywordflow">return</span> 1;
-<a name="l01059"></a>01059 
-<a name="l01060"></a>01060     <span class="keywordflow">for</span>(iframe = 0; iframe < cpl_frameset_get_size(frames); ++iframe)
-<a name="l01061"></a>01061     {
-<a name="l01062"></a>01062         cpl_propertylist * header;
-<a name="l01063"></a>01063         header = cpl_propertylist_load(
-<a name="l01064"></a>01064                      cpl_frame_get_filename(
-<a name="l01065"></a>01065                      cpl_frameset_get_frame_const(frames, iframe)),0);
-<a name="l01066"></a>01066         <span class="keywordflow">if</span>(iframe == 0)
-<a name="l01067"></a>01067             value = (func)(header);
-<a name="l01068"></a>01068         <span class="keywordflow">else</span>
-<a name="l01069"></a>01069             <span class="keywordflow">if</span>(value != (func)(header))
-<a name="l01070"></a>01070             {
-<a name="l01071"></a>01071                 cpl_propertylist_delete(header);
-<a name="l01072"></a>01072                 <span class="keywordflow">return</span> 0;
-<a name="l01073"></a>01073             }
-<a name="l01074"></a>01074         cpl_propertylist_delete(header);
-<a name="l01075"></a>01075     }
-<a name="l01076"></a>01076     <span class="keywordflow">return</span> 1;
-<a name="l01077"></a>01077 }
-<a name="l01078"></a>01078 
-<a name="l01079"></a>01079 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01087"></a>01087 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01088"></a>01088 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>
-<a name="l01089"></a><a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663">01089</a> (cpl_frameset * frames, <span class="keywordtype">int</span> (*func)(<span class="keyword">const</span> cpl_propertylist *))
-<a name="l01090"></a>01090 {
-<a name="l01091"></a>01091     <span class="keywordtype">int</span>                iframe;
-<a name="l01092"></a>01092     <span class="keywordtype">int</span>                value = 0;
-<a name="l01093"></a>01093     
-<a name="l01094"></a>01094     <span class="keywordflow">if</span>(cpl_frameset_get_size(frames) < 2)
-<a name="l01095"></a>01095        <span class="keywordflow">return</span> 1;
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097     <span class="keywordflow">for</span>(iframe = 0; iframe < cpl_frameset_get_size(frames); ++iframe)
-<a name="l01098"></a>01098     {
-<a name="l01099"></a>01099         cpl_propertylist * header;
-<a name="l01100"></a>01100         header = cpl_propertylist_load(
-<a name="l01101"></a>01101                      cpl_frame_get_filename(
-<a name="l01102"></a>01102                      cpl_frameset_get_frame_const(frames, iframe)),0);
-<a name="l01103"></a>01103         <span class="keywordflow">if</span>(iframe == 0)
-<a name="l01104"></a>01104             value = (func)(header);
-<a name="l01105"></a>01105         <span class="keywordflow">else</span>
-<a name="l01106"></a>01106             <span class="keywordflow">if</span>(value != (func)(header))
-<a name="l01107"></a>01107             {
-<a name="l01108"></a>01108                 cpl_propertylist_delete(header);
-<a name="l01109"></a>01109                 <span class="keywordflow">return</span> 0;
-<a name="l01110"></a>01110             }
-<a name="l01111"></a>01111         cpl_propertylist_delete(header);
-<a name="l01112"></a>01112     }
-<a name="l01113"></a>01113     <span class="keywordflow">return</span> 1;
-<a name="l01114"></a>01114 }
-<a name="l01115"></a>01115 
-<a name="l01116"></a>01116 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01126"></a>01126 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01127"></a><a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3">01127</a> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(<span class="keywordtype">char</ [...]
-<a name="l01128"></a>01128 {
-<a name="l01129"></a>01129     <span class="keywordtype">double</span> a,b;
-<a name="l01130"></a>01130     <span class="keywordtype">double</span> seconds;
-<a name="l01131"></a>01131     <span class="keywordtype">char</span> tstring[64];
-<a name="l01132"></a>01132     <span class="keywordtype">int</span> hours;
-<a name="l01133"></a>01133     <span class="keywordtype">int</span> minutes;
-<a name="l01134"></a>01134     <span class="keywordtype">int</span> ltstr;
-<a name="l01135"></a>01135     <span class="keywordtype">double</span> dsgn;
-<a name="l01136"></a>01136 
-<a name="l01137"></a>01137     <span class="comment">/* Keep RA between 0 and 360 */</span>
-<a name="l01138"></a>01138     <span class="keywordflow">if</span> (ra < 0.0 ) 
-<a name="l01139"></a>01139     {
-<a name="l01140"></a>01140         ra = -ra;
-<a name="l01141"></a>01141         dsgn = -1.0;
-<a name="l01142"></a>01142     }
-<a name="l01143"></a>01143     <span class="keywordflow">else</span>
-<a name="l01144"></a>01144         dsgn = 1.0;
-<a name="l01145"></a>01145     ra = fmod(ra, 360.0);
-<a name="l01146"></a>01146     ra *= dsgn;
-<a name="l01147"></a>01147     <span class="keywordflow">if</span> (ra < 0.0)
-<a name="l01148"></a>01148         ra = ra + 360.0;
-<a name="l01149"></a>01149 
-<a name="l01150"></a>01150     a = ra / 15.0;
-<a name="l01151"></a>01151 
-<a name="l01152"></a>01152     <span class="comment">/* Convert to hours */</span>
-<a name="l01153"></a>01153     hours = (int) a;
-<a name="l01154"></a>01154 
-<a name="l01155"></a>01155     <span class="comment">/* Compute minutes */</span>
-<a name="l01156"></a>01156     b =  (a - (double)hours) * 60.0;
-<a name="l01157"></a>01157     minutes = (int) b;
-<a name="l01158"></a>01158 
-<a name="l01159"></a>01159     <span class="comment">/* Compute seconds */</span>
-<a name="l01160"></a>01160     seconds = (b - (double)minutes) * 60.0;
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162     <span class="keywordflow">if</span> (seconds > 59.99) 
-<a name="l01163"></a>01163     {
-<a name="l01164"></a>01164         seconds = 0.0;
-<a name="l01165"></a>01165         minutes = minutes + 1;
-<a name="l01166"></a>01166     }
-<a name="l01167"></a>01167     <span class="keywordflow">if</span> (minutes > 59) 
-<a name="l01168"></a>01168     {
-<a name="l01169"></a>01169         minutes = 0;
-<a name="l01170"></a>01170         hours = hours + 1;
-<a name="l01171"></a>01171     }
-<a name="l01172"></a>01172     hours = hours % 24;
-<a name="l01173"></a>01173     (void) sprintf (tstring,<span class="stringliteral">"%02d:%02d:%05.2f"</span>,hours,minutes,seconds);
-<a name="l01174"></a>01174 
-<a name="l01175"></a>01175     <span class="comment">/* Move formatted string to returned string */</span>
-<a name="l01176"></a>01176     ltstr = (int) strlen (tstring);
-<a name="l01177"></a>01177     <span class="keywordflow">if</span> (ltstr < length_str-1)
-<a name="l01178"></a>01178         strcpy (str, tstring);
-<a name="l01179"></a>01179     <span class="keywordflow">else</span> 
-<a name="l01180"></a>01180     {
-<a name="l01181"></a>01181         strncpy (str, tstring, length_str-1);
-<a name="l01182"></a>01182         str[length_str-1] = 0;
-<a name="l01183"></a>01183     }
-<a name="l01184"></a>01184     <span class="keywordflow">return</span>;
-<a name="l01185"></a>01185 }
-<a name="l01186"></a>01186 
-<a name="l01187"></a>01187 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01197"></a>01197 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01198"></a><a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6">01198</a> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> length_str, <span class="keywordtype"> [...]
-<a name="l01199"></a>01199 {
-<a name="l01200"></a>01200     <span class="keywordtype">double</span> a, b, dsgn, deg1;
-<a name="l01201"></a>01201     <span class="keywordtype">double</span> seconds;
-<a name="l01202"></a>01202     <span class="keywordtype">char</span> sign;
-<a name="l01203"></a>01203     <span class="keywordtype">int</span> degrees;
-<a name="l01204"></a>01204     <span class="keywordtype">int</span> minutes;
-<a name="l01205"></a>01205     <span class="keywordtype">int</span> ltstr;
-<a name="l01206"></a>01206     <span class="keywordtype">char</span> tstring[64];
-<a name="l01207"></a>01207 
-<a name="l01208"></a>01208     <span class="comment">/* Keep angle between -180 and 360 degrees */</span>
-<a name="l01209"></a>01209     deg1 = dec;
-<a name="l01210"></a>01210     <span class="keywordflow">if</span> (deg1 < 0.0 ) 
-<a name="l01211"></a>01211     {
-<a name="l01212"></a>01212         deg1 = -deg1;
-<a name="l01213"></a>01213         dsgn = -1.0;
-<a name="l01214"></a>01214     }
-<a name="l01215"></a>01215     <span class="keywordflow">else</span>
-<a name="l01216"></a>01216         dsgn = 1.0;
-<a name="l01217"></a>01217     deg1 = fmod(deg1, 360.0);
-<a name="l01218"></a>01218     deg1 *= dsgn;
-<a name="l01219"></a>01219     <span class="keywordflow">if</span> (deg1 <= -180.0)
-<a name="l01220"></a>01220         deg1 = deg1 + 360.0;
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222     a = deg1;
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224     <span class="comment">/* Set sign and do all the rest with a positive */</span>
-<a name="l01225"></a>01225     <span class="keywordflow">if</span> (a < 0) 
-<a name="l01226"></a>01226     {
-<a name="l01227"></a>01227         sign = <span class="charliteral">'-'</span>;
-<a name="l01228"></a>01228         a = -a;
-<a name="l01229"></a>01229     }
-<a name="l01230"></a>01230     <span class="keywordflow">else</span>
-<a name="l01231"></a>01231         sign = <span class="charliteral">'+'</span>;
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233     <span class="comment">/* Convert to degrees */</span>
-<a name="l01234"></a>01234     degrees = (int) a;
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236     <span class="comment">/* Compute minutes */</span>
-<a name="l01237"></a>01237     b =  (a - (double)degrees) * 60.0;
-<a name="l01238"></a>01238     minutes = (int) b;
-<a name="l01239"></a>01239 
-<a name="l01240"></a>01240     <span class="comment">/* Compute seconds */</span>
-<a name="l01241"></a>01241     seconds = (b - (double)minutes) * 60.0;
-<a name="l01242"></a>01242 
-<a name="l01243"></a>01243     <span class="keywordflow">if</span> (seconds > 59.99) 
-<a name="l01244"></a>01244     {
-<a name="l01245"></a>01245         seconds = 0.0;
-<a name="l01246"></a>01246         minutes = minutes + 1;
-<a name="l01247"></a>01247     }
-<a name="l01248"></a>01248     <span class="keywordflow">if</span> (minutes > 59) 
-<a name="l01249"></a>01249     {
-<a name="l01250"></a>01250         minutes = 0;
-<a name="l01251"></a>01251         degrees = degrees + 1;
-<a name="l01252"></a>01252     }
-<a name="l01253"></a>01253     (void) sprintf (tstring,<span class="stringliteral">"%c%02d:%02d:%05.2f"</span>,sign,degrees,minutes,seconds);
-<a name="l01254"></a>01254 
-<a name="l01255"></a>01255     <span class="comment">/* Move formatted string to returned string */</span>
-<a name="l01256"></a>01256     ltstr = (int) strlen (tstring);
-<a name="l01257"></a>01257     <span class="keywordflow">if</span> (ltstr < length_str-1)
-<a name="l01258"></a>01258         strcpy (str, tstring);
-<a name="l01259"></a>01259     <span class="keywordflow">else</span> 
-<a name="l01260"></a>01260     {
-<a name="l01261"></a>01261         strncpy (str, tstring, length_str-1);
-<a name="l01262"></a>01262         str[length_str-1] = 0;
-<a name="l01263"></a>01263     }
-<a name="l01264"></a>01264     <span class="keywordflow">return</span>;
-<a name="l01265"></a>01265 }
-<a name="l01266"></a>01266 
-<a name="l01275"></a>01275 cpl_error_code
-<a name="l01276"></a><a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c">01276</a> <a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c" title="Insert all frames of other in self. To be removed after the same functionality exists in CPL...">hawki_frameset_append</a>(cpl_frameset *<span class="keyword">self</span>, <span class="keyword">const</span> cpl_frameset *other)
-<a name="l01277"></a>01277 {
-<a name="l01278"></a>01278     cpl_size iframe;
-<a name="l01279"></a>01279     cpl_size nframes;
-<a name="l01280"></a>01280 
-<a name="l01281"></a>01281     nframes = cpl_frameset_get_size(other);
-<a name="l01282"></a>01282 
-<a name="l01283"></a>01283     <span class="keywordflow">for</span>(iframe = 0; iframe<nframes; ++iframe)
-<a name="l01284"></a>01284     {
-<a name="l01285"></a>01285         cpl_frame * newframe;
-<a name="l01286"></a>01286         newframe = cpl_frame_duplicate
-<a name="l01287"></a>01287             (cpl_frameset_get_frame_const(other, iframe));
-<a name="l01288"></a>01288         <span class="keywordflow">if</span>(cpl_frameset_insert(<span class="keyword">self</span>, newframe) != CPL_ERROR_NONE)
-<a name="l01289"></a>01289         {
-<a name="l01290"></a>01290             cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l01291"></a>01291             <span class="keywordflow">return</span> CPL_ERROR_ILLEGAL_INPUT;
-<a name="l01292"></a>01292         }
-<a name="l01293"></a>01293     }
-<a name="l01294"></a>01294     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l01295"></a>01295 }
-<a name="l01296"></a>01296 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_utils.c,v 1.54 2012/12/06 16:55: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/06 16:55:32 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.54 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "irplib_cat.h"</span>  </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include "irplib_wcs.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 "hawki_utils.h"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include "hawki_pfits.h"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include "hawki_load.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="comment">/*----------------------------------------------------------------------------*/</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> </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__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a">   65</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_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>  *   hawki_license = </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>         <span class="stringliteral">"This file is part of the HAWKI 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\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="stringliteral">"Foundation, Inc., 59 Temple Place, Suite 330, Boston, \n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         <span class="stringliteral">"MA  02111-1307  USA"</span> ;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     <span class="keywordflow">return</span> hawki_license ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566">   93</a></span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>(<span class="keywordtype">void</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_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_msg_info(__func__, <span class="stringliteral">"Welcome to HAWK-I Pipeline release %s"</span>,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                  <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>());</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</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> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</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"><a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3">  106</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>(<span class="keywordtype">void</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">return</span> PACKAGE_VERSION;</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> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb">  119</a></span> cpl_image * <a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a>(</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         <span class="keyword">const</span> cpl_image     *   in,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         <span class="keywordtype">double</span>                  sigma)</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">double</span>                  med, stdev, threshold ;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_image           *   bpm ;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_image           *   bpm_int ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="keywordflow">if</span> (sigma <= 0) <span class="keywordflow">return</span> 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>     bpm = cpl_image_duplicate(in);</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="comment">/* Compute the threshold */</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     med = cpl_image_get_median_dev(bpm, &stdev) ;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     threshold = med + sigma*stdev ;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_msg_info(__func__, <span class="stringliteral">"Threshold : %g = %g + %g * %g"</span>, </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>             threshold, med, sigma, stdev) ;</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">/* Compute the bpm */</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_image_threshold(bpm, threshold, threshold, 0.0, 1.0) ;</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">/* Convert */</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     bpm_int = cpl_image_cast(bpm, CPL_TYPE_INT) ;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_image_delete(bpm) ;</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> bpm_int ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> cpl_image * <a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a></div>
+<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877">  164</a></span> (<span class="keyword">const</span> cpl_image *   in,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>  <span class="keywordtype">double</span>              sigma,</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>  <span class="keywordtype">double</span>              lowval,</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>  <span class="keywordtype">double</span>              highval)</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_mask            *   kernel ;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     cpl_image           *   filtered ;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordtype">double</span>                  med, stdev, threshold ;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_image           *   bpm_sigma;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_image           *   bpm_lowhigh;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_image           *   bpm;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     cpl_image           *   bpm_int ;</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">/* Test entries */</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordflow">if</span> (sigma <= 0) <span class="keywordflow">return</span> NULL ;</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">/* Filter the input image */</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     kernel = cpl_mask_new(3, 3) ;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     cpl_mask_not(kernel) ;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     filtered = cpl_image_new(cpl_image_get_size_x(in), cpl_image_get_size_y(in),</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                              cpl_image_get_type(in));</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_image_filter_mask(filtered, in, kernel, CPL_FILTER_MEDIAN, </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                           CPL_BORDER_FILTER);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_mask_delete(kernel) ;</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">/* Remove the low freq signal */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     bpm_sigma = cpl_image_subtract_create(in, filtered) ;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     cpl_image_delete(filtered) ;</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">/* Compute the threshold */</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     med = cpl_image_get_median_dev(bpm_sigma, &stdev) ;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     threshold = med + sigma*stdev ;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_msg_info(__func__, <span class="stringliteral">"Threshold : %g = %g + %g * %g"</span>, </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>             threshold, med, sigma, stdev) ;</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">/* Compute the bpm with the sigma values */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_image_threshold(bpm_sigma, threshold, threshold, 0.0, 1.0) ;</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">/* Count the pixels below and above the lowval and highval */</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     bpm_lowhigh = cpl_image_duplicate(in);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a>(bpm_lowhigh, lowval, highval, 0.0, 1.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>     <span class="comment">/* Merge both masks */</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     bpm = cpl_image_add_create(bpm_sigma, bpm_lowhigh);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_image_threshold(bpm, 0.0, 1.0, 0.0, 1.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="comment">/* Convert */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     bpm_int = cpl_image_cast(bpm, CPL_TYPE_INT) ;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_image_delete(bpm) ;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_image_delete(bpm_sigma);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_image_delete(bpm_lowhigh);</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">return</span> bpm_int ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> cpl_error_code <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a></div>
+<div class="line"><a name="l00241"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0">  241</a></span> (cpl_image *    image_in,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>  <span class="keywordtype">double</span>         lo_valid,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>  <span class="keywordtype">double</span>         hi_valid,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>  <span class="keywordtype">double</span>         assign_in_range,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>  <span class="keywordtype">double</span>         assign_out_range)</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="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordtype">int</span>   npix;</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_ensure_code(image_in != NULL, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_ensure_code(lo_valid <= hi_valid, CPL_ERROR_ILLEGAL_INPUT);</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">/* Get number of pixels of image */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     npix = cpl_image_get_size_x(image_in) *  cpl_image_get_size_y(image_in);</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">/* Switch on image type */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">switch</span> (cpl_image_get_type(image_in)) </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">case</span> CPL_TYPE_DOUBLE: {</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>             <span class="keywordtype">double</span> * pdi = cpl_image_get_data_double(image_in);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>             <span class="keywordflow">for</span> (i=0; i<npix; i++) {</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                 <span class="keywordflow">if</span> ((pdi[i]>lo_valid) && (pdi[i]<hi_valid))</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                     pdi[i] = (double)assign_in_range;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                     pdi[i] = (double)assign_out_range;</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">break</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="keywordflow">case</span> CPL_TYPE_FLOAT: {</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>             <span class="keywordtype">float</span> * pdi = cpl_image_get_data_float(image_in);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>             <span class="keywordflow">for</span> (i=0; i<npix; i++) {</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                 <span class="keywordflow">if</span> ((pdi[i]>lo_valid) && (pdi[i]<hi_valid))</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                     pdi[i] = (float)assign_in_range;</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>                     pdi[i] = (float)assign_out_range;</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">break</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">case</span> CPL_TYPE_INT: {</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>             <span class="keywordtype">int</span> * pdi = cpl_image_get_data_int(image_in);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>             <span class="keywordflow">for</span> (i=0; i<npix; i++) {</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                 <span class="keywordflow">if</span> (((<span class="keywordtype">double</span>)pdi[i]>lo_valid) && ((<span class="keywordtype">double</span>)pdi[i]<hi_valid))</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>                     pdi[i] = (int)assign_in_range;</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>                     pdi[i] = (int)assign_out_range;</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">break</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">default</span>:</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>           cpl_ensure_code(0, CPL_ERROR_INVALID_TYPE);</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> CPL_ERROR_NONE;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> cpl_image * <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a></div>
+<div class="line"><a name="l00305"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db">  305</a></span> (cpl_image   ** ima,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>  <span class="keywordtype">double</span>      *  x,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>  <span class="keywordtype">double</span>      *  y)</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="keywordtype">int</span>                     lx, ly ;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_image           *   ima_ext[HAWKI_NB_DETECTORS] ;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     cpl_imagelist       *   in ;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_bivector        *   offsets ;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">double</span>              *   offsets_x ;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordtype">double</span>              *   offsets_y ;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_image           **  combined ;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_image           *   stitched ;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordtype">int</span>                     i ;</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="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keywordflow">if</span> (ima == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="keywordflow">if</span> (x   == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">if</span> (y   == NULL) <span class="keywordflow">return</span> 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">/* Take the smallest size */</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     lx = cpl_image_get_size_x(ima[0]) ;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     ly = cpl_image_get_size_y(ima[0]) ;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">for</span> (i=1 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         <span class="keywordflow">if</span> (lx > cpl_image_get_size_x(ima[i]))</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             lx = cpl_image_get_size_x(ima[i]) ;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         <span class="keywordflow">if</span> (ly > cpl_image_get_size_y(ima[i]))</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>             ly = cpl_image_get_size_y(ima[i]) ;</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">/* Create the image list */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     in = cpl_imagelist_new() ;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordflow">for</span> (i=0 ; i<HAWKI_NB_DETECTORS ; i++) {</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         ima_ext[i] = cpl_image_extract(ima[i], 1, 1, lx, ly) ;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>         cpl_imagelist_set(in, ima_ext[i], i) ;</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>     <span class="comment">/* Create the offsets */</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     offsets = cpl_bivector_new(HAWKI_NB_DETECTORS) ;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     offsets_x = cpl_bivector_get_x_data(offsets) ;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     offsets_y = cpl_bivector_get_y_data(offsets) ;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     offsets_x[0] = HAWKI_DET1_POSX ;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     offsets_y[0] = HAWKI_DET1_POSY ;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     offsets_x[1] = x[0] - x[1] + HAWKI_DET2_POSX ;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     offsets_y[1] = y[0] - y[1] + HAWKI_DET2_POSY ;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     offsets_x[2] = x[0] - x[2] + HAWKI_DET3_POSX ;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     offsets_y[2] = y[0] - y[2] + HAWKI_DET3_POSY ;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     offsets_x[3] = x[0] - x[3] + HAWKI_DET4_POSX ;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     offsets_y[3] = y[0] - y[3] + HAWKI_DET4_POSY ;</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">/* Recombine the images */</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordflow">if</span> ((combined = cpl_geom_img_offset_saa(in, offsets,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>             CPL_KERNEL_DEFAULT, 0, 0, CPL_GEOM_UNION, NULL, NULL)) == NULL) </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>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot recombine the images"</span>) ;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         cpl_imagelist_delete(in) ;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>         <span class="keywordflow">return</span> 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>     cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     cpl_imagelist_delete(in) ;</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">/* Return  */</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     stitched = combined[0] ;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_image_delete(combined[1]) ;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_free(combined) ;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">return</span> stitched ;</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="comment">/*----------------------------------------------------------------------------*/</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__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96">  384</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96" title="Apply the harmonization.">hawki_apply_harmonization</a>(</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         cpl_imagelist   *   in,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         <span class="keywordtype">double</span>              h1,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         <span class="keywordtype">double</span>              h2,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         <span class="keywordtype">double</span>              h3,</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         <span class="keywordtype">double</span>              h4)</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">/* Test entries */</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1 ;</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_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 0), h1) ;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 1), h2) ;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 2), h3) ;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_image_multiply_scalar((cpl_image *)cpl_imagelist_get(in, 3), h4) ;</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 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="l00421"></a><span class="lineno">  421</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf">  422</a></span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf" title="Compute the harmonization.">hawki_compute_harmonization</a>(</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keyword">const</span> cpl_imagelist *   in,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         <span class="keywordtype">double</span>              *   h1,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         <span class="keywordtype">double</span>              *   h2,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         <span class="keywordtype">double</span>              *   h3,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         <span class="keywordtype">double</span>              *   h4,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordtype">double</span>              *   h)</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">int</span>                 width = 64 ;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keywordtype">int</span>                 nx, ny ;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keyword">const</span> cpl_image *   ima ;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordtype">double</span>              avg1, avg2, avg3, avg4 ;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keywordtype">double</span>              val1, val2 ;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">int</span>                 llx, lly, urx, ury ;</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>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1 ;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordflow">if</span> (h1==NULL || h2==NULL || h3==NULL || h4==NULL || h==NULL) <span class="keywordflow">return</span> -1 ;</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">/* Compute the avg1 */</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     ima = cpl_imagelist_get_const(in, 0) ;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     nx = cpl_image_get_size_x(ima) ;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     ny = cpl_image_get_size_y(ima) ;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     llx = 1 ; lly = ny - width + 1 ; urx = nx ; ury = ny ;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 1"</span>) ;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         <span class="keywordflow">return</span> -1 ;</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>     llx = nx - width + 1 ; lly = 1 ; urx = nx ; ury = ny ;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 1"</span>) ;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>         <span class="keywordflow">return</span> -1 ;</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>     avg1 = (val1 + val2) / 2.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="comment">/* Compute the avg2 */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     ima = cpl_imagelist_get_const(in, 1) ;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     nx = cpl_image_get_size_x(ima) ;</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     ny = cpl_image_get_size_y(ima) ;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     llx = 1 ; lly = 1 ; urx = width ; ury = ny ;</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 2"</span>) ;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         <span class="keywordflow">return</span> -1 ;</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>     llx = 1 ; lly = ny - width + 1 ; urx = nx ; ury = ny ;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 2"</span>) ;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         <span class="keywordflow">return</span> -1 ;</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>     avg2 = (val1 + val2) / 2.0 ;</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="comment">/* Compute the avg3 */</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     ima = cpl_imagelist_get_const(in, 2) ;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     nx = cpl_image_get_size_x(ima) ;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     ny = cpl_image_get_size_y(ima) ;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     llx = 1 ; lly = 1 ; urx = nx ; ury = width ;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 3"</span>) ;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         <span class="keywordflow">return</span> -1 ;</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>     llx = nx - width + 1 ; lly = 1 ; urx = nx ; ury = ny ;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 3"</span>) ;</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         <span class="keywordflow">return</span> -1 ;</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>     avg3 = (val1 + val2) / 2.0 ;</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">/* Compute the avg4 */</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     ima = cpl_imagelist_get_const(in, 3) ;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     nx = cpl_image_get_size_x(ima) ;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     ny = cpl_image_get_size_y(ima) ;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     llx = 1 ; lly = 1 ; urx = width ; ury = ny ;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     val1 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 4"</span>) ;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         <span class="keywordflow">return</span> -1 ;</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>     llx = 1 ; lly = 1 ; urx = nx ; ury = width ;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     val2 = cpl_image_get_mean_window(ima, llx, lly, urx, ury) ;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot get statistics from chip 4"</span>) ;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         <span class="keywordflow">return</span> -1 ;</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>     avg4 = (val1 + val2) / 2.0 ;</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">/* Compute h */</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     *h = (avg1 + avg2 + avg3 + avg4) / 4.0 ;</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>     *h1 = *h / avg1 ;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     *h2 = *h / avg2 ;</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     *h3 = *h / avg3 ;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     *h4 = *h / avg4 ;</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">return</span> 0 ;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd">  531</a></span> cpl_image * <a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd" title="Compute the large scale background.">hawki_compute_lsbg</a>(<span class="keyword">const</span> cpl_image * in)</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_image       *   out ;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     cpl_image       *   tmp ;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     cpl_image       *   filtered ;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     cpl_image       *   subsampled ;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cpl_mask        *   kernel ;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keywordtype">int</span>                 nscales ;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     cpl_polynomial  *   poly ;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cpl_bivector    *   xy_pos ;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     cpl_vector      *   vals ;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     <span class="keywordtype">int</span>                 quad_sz, nbpoints, lx, ly, nx, ny ;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordtype">double</span>          *   pxy_pos_x ;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     <span class="keywordtype">double</span>          *   pxy_pos_y ;</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordtype">double</span>          *   pvals ;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordtype">float</span>           *   pima ;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keywordtype">int</span>                 i, j ;</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="comment">/* Check entries */</span></div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     nx = cpl_image_get_size_x(in) ;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     ny = cpl_image_get_size_y(in) ;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     nscales = 7 ;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     tmp = (cpl_image *)in ;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     subsampled = NULL ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     quad_sz = pow(2, (<span class="keywordtype">double</span>)nscales) ;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     lx = nx / quad_sz ;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     ly = ny / quad_sz ;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     nbpoints = lx * ly ;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordflow">if</span> (quad_sz >= nx || quad_sz >= ny) <span class="keywordflow">return</span> 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>     <span class="comment">/* Create filter kernel */</span></div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     kernel = cpl_mask_new(3, 3) ;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     cpl_mask_not(kernel) ;</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="comment">/* Loop nscales times */</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">for</span> (i=0 ; i<nscales ; i++) {</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="comment">/* Filter the image */</span></div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         filtered = cpl_image_new(cpl_image_get_size_x(tmp),</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>                                  cpl_image_get_size_y(tmp),</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                                  cpl_image_get_type(tmp));</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         cpl_image_filter_mask(filtered, in, kernel, CPL_FILTER_MEDIAN, </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                               CPL_BORDER_FILTER);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <span class="keywordflow">if</span> (i>0) cpl_image_delete(tmp) ;</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">/* Subsample the image */</span></div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         subsampled = cpl_image_extract_subsample(filtered, 2, 2) ;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         cpl_image_delete(filtered) ;</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>         tmp = subsampled ;</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_mask_delete(kernel) ;</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">/* Check nbpoints */</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keywordflow">if</span> (nbpoints != </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>             cpl_image_get_size_x(subsampled)*cpl_image_get_size_y(subsampled)) {</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         cpl_msg_error(__func__, <span class="stringliteral">"Invalid size"</span>) ;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         cpl_image_delete(subsampled) ;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>         <span class="keywordflow">return</span> 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>     </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="comment">/* Create anchor points for the fit */</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     xy_pos = cpl_bivector_new(nbpoints) ;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     vals = cpl_vector_new(nbpoints) ;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     pxy_pos_x = cpl_bivector_get_x_data(xy_pos) ;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     pxy_pos_y = cpl_bivector_get_y_data(xy_pos) ;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     pvals = cpl_vector_get_data(vals) ;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     pima = cpl_image_get_data_float(subsampled) ;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="keywordflow">for</span> (j=0 ; j<ly ; j++) {</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         <span class="keywordflow">for</span> (i=0 ; i<lx ; i++) {</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>             pxy_pos_x[i+j*lx] = i * quad_sz + quad_sz/2 ;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>             pxy_pos_y[i+j*lx] = j * quad_sz + quad_sz/2 ;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>             pvals[i+j*lx] = (double)pima[i+j*lx];</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>     cpl_image_delete(subsampled) ;</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="comment">/* Fit the polynomial */</span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordflow">if</span> ((poly = cpl_polynomial_fit_2d_create(xy_pos, vals, 3, NULL)) == NULL) {</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot fit the polynomial"</span>) ;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_bivector_delete(xy_pos) ;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         cpl_vector_delete(vals) ;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         <span class="keywordflow">return</span> 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_bivector_delete(xy_pos) ;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_vector_delete(vals) ;</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="comment">/* Regenerate the big bgd image */</span></div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     out = cpl_image_duplicate(in) ;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     cpl_image_fill_polynomial(out, poly, 1.0, 1.0, 1.0, 1.0) ;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     cpl_polynomial_delete(poly) ;</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">return</span> out ;</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">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9">  639</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>(</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         <span class="keyword">const</span> cpl_frameset  *   in,</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   tag)</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="keyword">const</span> cpl_frame     *   cur_frame ;</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">/* Get the frame  */</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keywordflow">if</span> ((cur_frame = cpl_frameset_find_const(in, tag)) == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keywordflow">return</span> cpl_frame_get_filename(cur_frame) ;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade">  657</a></span> hawki_band <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * f)</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> (!strcmp(f, <span class="stringliteral">"J"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_J ;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"H"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_H ;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"K"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_K ;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"Ks"</span>))           <span class="keywordflow">return</span> HAWKI_BAND_K ;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordflow">if</span> (!strcmp(f, <span class="stringliteral">"Y"</span>))            <span class="keywordflow">return</span> HAWKI_BAND_Y ;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     <span class="keywordflow">return</span> HAWKI_BAND_UNKNOWN ;</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="comment">/*-------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span> <span class="comment">/*--------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00674"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4">  674</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>(hawki_band band)</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="keywordflow">switch</span> (band) {</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>         <span class="keywordflow">case</span> HAWKI_BAND_J:        <span class="keywordflow">return</span> <span class="stringliteral">"J"</span> ;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>         <span class="keywordflow">case</span> HAWKI_BAND_H:        <span class="keywordflow">return</span> <span class="stringliteral">"H"</span> ;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         <span class="keywordflow">case</span> HAWKI_BAND_K:        <span class="keywordflow">return</span> <span class="stringliteral">"K"</span> ;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         <span class="keywordflow">case</span> HAWKI_BAND_Y:        <span class="keywordflow">return</span> <span class="stringliteral">"Y"</span> ;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>         <span class="keywordflow">default</span>:            <span class="keywordflow">return</span> <span class="stringliteral">"Unknown"</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="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd">  695</a></span> cpl_bivector * <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>(<span class="keyword">const</span> cpl_frameset * fset)</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>     cpl_bivector        *   offsets ;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordtype">double</span>              *   offsets_x ;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     <span class="keywordtype">double</span>              *   offsets_y ;</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keyword">const</span> cpl_frame     *   frame ;</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     cpl_propertylist    *   plist ;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keywordtype">int</span>                     nfiles ;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keywordtype">int</span>                     i ;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     cpl_errorstate          error_prevstate = cpl_errorstate_get();</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> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     <span class="keywordflow">if</span> (fset == NULL) <span class="keywordflow">return</span> 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>     <span class="comment">/* Create the offsets bi vector */</span></div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     nfiles = cpl_frameset_get_size(fset) ;</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     offsets = cpl_bivector_new(nfiles) ;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     offsets_x = cpl_bivector_get_x_data(offsets) ;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     offsets_y = cpl_bivector_get_y_data(offsets) ;</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     <span class="keywordflow">for</span> (i=0 ; i<nfiles ; i++) {</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">/* X and Y offsets */</span></div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>         frame = cpl_frameset_get_frame_const(fset, i) ;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         plist=cpl_propertylist_load(cpl_frame_get_filename(frame),0);</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         offsets_x[i] = <a class="code" href="group__hawki__pfits.html#ga8074b7ef4524abfeb10bef68c4cfdf5e" title="find out the cumulative offset in X">hawki_pfits_get_cumoffsetx</a>(plist) ;</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         offsets_y[i] = <a class="code" href="group__hawki__pfits.html#ga21f640e98b8f695ac6229e9f15d46aca" title="find out the cumulative offset in Y">hawki_pfits_get_cumoffsety</a>(plist) ;</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         cpl_propertylist_delete(plist) ;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         <span class="keywordflow">if</span>(!cpl_errorstate_is_equal(error_prevstate ))</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>             cpl_msg_error(__func__, <span class="stringliteral">"Cannot get offsets from header"</span>) ;</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>             cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>             <span class="keywordflow">return</span> 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>     }</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <span class="keywordflow">return</span> offsets ;</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="comment">/*----------------------------------------------------------------------------*/</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"><a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46">  740</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(cpl_frameset *   <span class="keyword">set</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">int</span>                     nframes;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_frame           *   cur_frame;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     cpl_propertylist    *   plist;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordtype">int</span>                     iframe;</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     <span class="keywordtype">double</span>                  mean_airmass = 0.0;</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">/* Test inputs  */</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     <span class="keywordflow">if</span> (<span class="keyword">set</span> == NULL) <span class="keywordflow">return</span> -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>     <span class="comment">/* Initialize */</span></div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     nframes = cpl_frameset_get_size(<span class="keyword">set</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">for</span> (iframe=0 ; iframe<nframes ; iframe++) </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>         cur_frame = cpl_frameset_get_frame(<span class="keyword">set</span>, iframe);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         mean_airmass +=   <a class="code" href="group__hawki__pfits.html#ga4e7f03745ede13d9d2db3eddccd857df" title="find out airmass start">hawki_pfits_get_airmass_start</a>(plist) +</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                           <a class="code" href="group__hawki__pfits.html#gafccabad8d0fcc65a0ed27d1dff7ae8e3" title="find out airmass end">hawki_pfits_get_airmass_end</a>(plist); </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         cpl_propertylist_delete(plist);</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>     mean_airmass /= 2. * nframes;</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">/* Free and return */</span></div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     <span class="keywordflow">return</span> mean_airmass;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> * <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a></div>
+<div class="line"><a name="l00782"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884">  782</a></span> (<span class="keyword">const</span> cpl_frameset * in)</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="keywordtype">int</span>             *   labels ;</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     cpl_bivector    *   offsets ;</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     <span class="keywordtype">int</span>                 nframes ;</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     <span class="keywordtype">double</span>          *   poff_x ;</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     <span class="keywordtype">double</span>          *   poff_y ;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     <span class="keywordtype">double</span>              off_x_mean;</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <span class="keywordtype">double</span>              off_y_mean;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     <span class="keywordtype">int</span>                 i ;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     nframes = cpl_frameset_get_size(in) ;</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="comment">/* Get the offsets */</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     <span class="keywordflow">if</span> ((offsets = <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>((cpl_frameset *)in)) == NULL) {</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>         cpl_msg_error(__func__, <span class="stringliteral">"Cannot read the offsets"</span>) ;</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>         <span class="keywordflow">return</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>     poff_x = cpl_bivector_get_x_data(offsets) ;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     poff_y = cpl_bivector_get_y_data(offsets) ;</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="comment">/* Get the mean offsets */</span></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     off_x_mean = cpl_vector_get_mean(cpl_bivector_get_x(offsets));</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     off_y_mean = cpl_vector_get_mean(cpl_bivector_get_y(offsets));</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">/* Allocate labels */</span></div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     labels = cpl_malloc(nframes * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)) ;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     <span class="keywordflow">for</span> (i=0 ; i<nframes ; i++) {</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>         <span class="keywordflow">if</span> (poff_x[i] - off_x_mean <= 0 && poff_y[i] - off_y_mean <= 0)</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>             labels[i] = 1 ;</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean >= 0 && poff_y[i] - off_y_mean <= 0) </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             labels[i] = 2 ;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean >= 0 && poff_y[i] - off_y_mean >= 0) </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>             labels[i] = 3 ;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (poff_x[i] - off_x_mean <= 0 && poff_y[i] - off_y_mean >= 0) </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>             labels[i] = 4 ;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         <span class="keywordflow">else</span> labels[i] = 0 ;</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>     cpl_bivector_delete(offsets) ;</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     <span class="keywordflow">return</span> labels ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a></div>
+<div class="line"><a name="l00837"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0">  837</a></span> (<span class="keyword">const</span> cpl_frameset * in,</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>  <span class="keywordtype">double</span>               star_ra,</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>  <span class="keywordtype">double</span>               star_dec,</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>  <span class="keywordtype">int</span>                * labels)</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="keywordtype">int</span>     nframes;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     <span class="keywordtype">int</span>     idet, iframe;</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">/* Check entries */</span></div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> -1;</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">/* Initialise */</span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>     nframes = cpl_frameset_get_size(in) ;</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">/* Allocate labels */</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     <span class="keywordflow">for</span> (iframe=0 ; iframe<nframes ; iframe++) </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="keyword">const</span> <span class="keywordtype">char</span> * filename;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>         filename = cpl_frame_get_filename</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             (cpl_frameset_get_frame_const(in, iframe));</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="keywordflow">for</span> (idet=0 ; idet<HAWKI_NB_DETECTORS ; idet++)</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_propertylist * main_header;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             cpl_propertylist * ext_header;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>             cpl_wcs          * wcs;</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>             <span class="keywordtype">double</span>             naxis1, naxis2;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>             <span class="keywordtype">double</span>             star_x, star_y;</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">/* Get the headers */</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>             main_header = cpl_propertylist_load(filename, 0);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             ext_header  = cpl_propertylist_load</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                 (filename, <a class="code" href="group__hawki__load.html#gac0cd4814dd4a106963bb5e639132aac1" title="Get the extension corresponding to the wished chip.">hawki_get_ext_from_detector</a>(filename,idet + 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>             <span class="comment">/* Get the position of the star in pixels */</span></div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>             wcs = cpl_wcs_new_from_propertylist(ext_header);</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>             <span class="keywordflow">if</span>(wcs == 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>                 cpl_msg_error(__func__, <span class="stringliteral">"Could not get WCS info"</span>);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                 cpl_propertylist_delete(ext_header);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                 cpl_propertylist_delete(main_header);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>                 <span class="keywordflow">return</span> -1;</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="keywordflow">if</span>(irplib_wcs_radectoxy(wcs, star_ra, star_dec, &star_x, &star_y)</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                     != CPL_ERROR_NONE)</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_errorstate_set(CPL_ERROR_NONE);</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>             </div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>             <span class="comment">/* Check for the limits */</span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>             naxis1 = (double)<a class="code" href="group__hawki__pfits.html#ga509576593bbfc282745eae7d29a89102" title="Get the number of pixels in axis 1.">hawki_pfits_get_naxis1</a>(ext_header);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>             naxis2 = (double)<a class="code" href="group__hawki__pfits.html#gaabcefe7bbad8cb43ad652970057d0356" title="Get the number of pixels in axis 2.">hawki_pfits_get_naxis2</a>(ext_header);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>             <span class="keywordflow">if</span>(star_x > 0 && star_x < naxis1 && star_y > 0 && star_y < naxis2)</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>                 labels[iframe] = idet + 1;</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>             <span class="comment">/* Free */</span></div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>             cpl_propertylist_delete(ext_header);</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>             cpl_propertylist_delete(main_header);</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             cpl_wcs_delete(wcs);</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="keywordflow">if</span>(labels[iframe] == 0)</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_msg_error(__func__,<span class="stringliteral">"Frame %d does not contain the star in any "</span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                           <span class="stringliteral">"detector"</span>, iframe + 1);</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>     <span class="keywordflow">return</span> 0;</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="l00916"></a><span class="lineno">  916</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a></div>
+<div class="line"><a name="l00918"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04">  918</a></span> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid)</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="keywordtype">double</span> max_val = DBL_MIN;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>     <span class="keywordtype">int</span>    initialized = 0;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>     <span class="keywordtype">int</span>    ival;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     <span class="keywordtype">int</span>    nvals;</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>     nvals = cpl_vector_get_size(<span class="keyword">self</span>);</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     <span class="keywordflow">for</span>(ival = 0; ival < nvals; ++ival)</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>(cpl_vector_get(valid, ival) >= -0.5) </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>(!initialized)</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>                 max_val = cpl_vector_get(<span class="keyword">self</span>, ival);</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>                 initialized = 1;</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">if</span>(cpl_vector_get(<span class="keyword">self</span>, ival) > max_val)</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>                 max_val = cpl_vector_get(<span class="keyword">self</span>, ival);</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>     }</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     <span class="keywordflow">return</span> max_val;</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> </div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a></div>
+<div class="line"><a name="l00952"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846">  952</a></span> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid)</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="keywordtype">double</span> min_val = DBL_MAX;</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     <span class="keywordtype">int</span>    initialized = 0;</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>     <span class="keywordtype">int</span>    ival;</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>     <span class="keywordtype">int</span>    nvals;</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>     nvals = cpl_vector_get_size(<span class="keyword">self</span>);</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     <span class="keywordflow">for</span>(ival = 0; ival < nvals; ++ival)</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">if</span>(cpl_vector_get(valid, ival) >= -0.5) </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>(!initialized)</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>                 min_val = cpl_vector_get(<span class="keyword">self</span>, ival);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>                 initialized = 1;</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_vector_get(<span class="keyword">self</span>, ival) < min_val)</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>                 min_val = cpl_vector_get(<span class="keyword">self</span>, ival);</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>     <span class="keywordflow">return</span> min_val;</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> </div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00983"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886">  983</a></span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(cpl_vector * vec)</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="keywordtype">int</span>                 nb ;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>     <span class="keywordtype">int</span>                 nbins ;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>     <span class="keywordtype">double</span>              min, max ;</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>     <span class="keywordtype">double</span>              bin_size ;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>     cpl_bivector    *   hist ;</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>     cpl_vector      *   hist_x ;</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>     cpl_vector      *   hist_y ;</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>     <span class="keywordtype">double</span>              cur_val ;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>     <span class="keywordtype">int</span>                 cur_bin ;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>     <span class="keywordtype">double</span>              max_val ;</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>     <span class="keywordtype">int</span>                 max_bin ;</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>     <span class="keywordtype">double</span>              mode ;</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>     <span class="keywordtype">int</span>                 i ;</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>     <span class="comment">/* Test entries  */</span></div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>     <span class="keywordflow">if</span> (vec == NULL) <span class="keywordflow">return</span> -1.0 ;</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="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>     nb = cpl_vector_get_size(vec) ;</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>     <span class="comment">/* Create the histogram */</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>     nbins = 10 ;</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     min = cpl_vector_get_min(vec) ;</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>     max = cpl_vector_get_max(vec) ;</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     bin_size = (max-min)/nbins ;</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>     hist = cpl_bivector_new(nbins) ;</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>     hist_x = cpl_bivector_get_x(hist) ;</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>     hist_y = cpl_bivector_get_y(hist) ;</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>     cpl_vector_fill(hist_x, 0.0) ;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     cpl_vector_fill(hist_y, 0.0) ;</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>     <span class="keywordflow">for</span> (i=0 ; i<nbins ; i++) {</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         cpl_vector_set(hist_x, i, min + i * bin_size) ;</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">for</span> (i=0 ; i<nb ; i++) {</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         cur_val = cpl_vector_get(vec, i) ;</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>         cur_bin = (int)((cur_val - min) / bin_size) ;</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         <span class="keywordflow">if</span> (cur_bin >= nbins) cur_bin -= 1.0 ;</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         cur_val = cpl_vector_get(hist_y, cur_bin) ;</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>         cur_val += 1.0 ;</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>         cpl_vector_set(hist_y, cur_bin, cur_val) ;</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">/* Get the mode of the histogram */</span></div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>     max_val = cpl_vector_get(hist_y, 0) ;</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>     max_bin = 0 ;</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>     <span class="keywordflow">for</span> (i=0 ; i<nbins ; i++) {</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         cur_val = cpl_vector_get(hist_y, i) ;</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         <span class="keywordflow">if</span> (cur_val > max_val) {</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>             max_val = cur_val ;</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>             max_bin = i ;</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</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>     mode = cpl_vector_get(hist_x, max_bin) ;</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>     cpl_bivector_delete(hist) ;</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     <span class="keywordflow">return</span> mode ;</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> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a></div>
+<div class="line"><a name="l01052"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7"> 1052</a></span> (cpl_frameset * frames, <span class="keywordtype">double</span> (*func)(<span class="keyword">const</span> cpl_propertylist *))</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="keywordtype">int</span>                iframe;</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>     <span class="keywordtype">double</span>             value = 0;</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>(cpl_frameset_get_size(frames) < 2)</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>        <span class="keywordflow">return</span> 1;</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>     <span class="keywordflow">for</span>(iframe = 0; iframe < cpl_frameset_get_size(frames); ++iframe)</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>         cpl_propertylist * header;</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>         header = cpl_propertylist_load(</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>                      cpl_frame_get_filename(</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>                      cpl_frameset_get_frame_const(frames, iframe)),0);</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>         <span class="keywordflow">if</span>(iframe == 0)</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>             value = (func)(header);</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>             <span class="keywordflow">if</span>(value != (func)(header))</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_propertylist_delete(header);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>                 <span class="keywordflow">return</span> 0;</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>         cpl_propertylist_delete(header);</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">return</span> 1;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a></div>
+<div class="line"><a name="l01089"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663"> 1089</a></span> (cpl_frameset * frames, <span class="keywordtype">int</span> (*func)(<span class="keyword">const</span> cpl_propertylist *))</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="keywordtype">int</span>                iframe;</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>     <span class="keywordtype">int</span>                value = 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>(cpl_frameset_get_size(frames) < 2)</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>        <span class="keywordflow">return</span> 1;</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">for</span>(iframe = 0; iframe < cpl_frameset_get_size(frames); ++iframe)</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_propertylist * header;</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>         header = cpl_propertylist_load(</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>                      cpl_frame_get_filename(</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                      cpl_frameset_get_frame_const(frames, iframe)),0);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>         <span class="keywordflow">if</span>(iframe == 0)</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>             value = (func)(header);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>             <span class="keywordflow">if</span>(value != (func)(header))</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_propertylist_delete(header);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>                 <span class="keywordflow">return</span> 0;</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>         cpl_propertylist_delete(header);</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">return</span> 1;</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> </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01127"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3"> 1127</a></span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawk [...]
+<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>     <span class="keywordtype">double</span> a,b;</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>     <span class="keywordtype">double</span> seconds;</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>     <span class="keywordtype">char</span> tstring[64];</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>     <span class="keywordtype">int</span> hours;</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>     <span class="keywordtype">int</span> minutes;</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     <span class="keywordtype">int</span> ltstr;</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>     <span class="keywordtype">double</span> dsgn;</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="comment">/* Keep RA between 0 and 360 */</span></div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>     <span class="keywordflow">if</span> (ra < 0.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>         ra = -ra;</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>         dsgn = -1.0;</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="keywordflow">else</span></div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>         dsgn = 1.0;</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     ra = fmod(ra, 360.0);</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>     ra *= dsgn;</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>     <span class="keywordflow">if</span> (ra < 0.0)</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>         ra = ra + 360.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>     a = ra / 15.0;</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">/* Convert to hours */</span></div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>     hours = (int) a;</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>     <span class="comment">/* Compute minutes */</span></div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     b =  (a - (double)hours) * 60.0;</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>     minutes = (int) b;</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="comment">/* Compute seconds */</span></div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>     seconds = (b - (double)minutes) * 60.0;</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> (seconds > 59.99) </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>         seconds = 0.0;</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         minutes = minutes + 1;</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> (minutes > 59) </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>         minutes = 0;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>         hours = hours + 1;</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>     hours = hours % 24;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>     (void) sprintf (tstring,<span class="stringliteral">"%02d:%02d:%05.2f"</span>,hours,minutes,seconds);</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">/* Move formatted string to returned string */</span></div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>     ltstr = (int) strlen (tstring);</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     <span class="keywordflow">if</span> (ltstr < length_str-1)</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>         strcpy (str, tstring);</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>     <span class="keywordflow">else</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>         strncpy (str, tstring, length_str-1);</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         str[length_str-1] = 0;</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>     <span class="keywordflow">return</span>;</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> </div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01198"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6"> 1198</a></span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtype [...]
+<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="keywordtype">double</span> a, b, dsgn, deg1;</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     <span class="keywordtype">double</span> seconds;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordtype">char</span> sign;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordtype">int</span> degrees;</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>     <span class="keywordtype">int</span> minutes;</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <span class="keywordtype">int</span> ltstr;</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>     <span class="keywordtype">char</span> tstring[64];</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="comment">/* Keep angle between -180 and 360 degrees */</span></div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>     deg1 = dec;</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>     <span class="keywordflow">if</span> (deg1 < 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>         deg1 = -deg1;</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>         dsgn = -1.0;</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">else</span></div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         dsgn = 1.0;</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     deg1 = fmod(deg1, 360.0);</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>     deg1 *= dsgn;</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     <span class="keywordflow">if</span> (deg1 <= -180.0)</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>         deg1 = deg1 + 360.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>     a = deg1;</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">/* Set sign and do all the rest with a positive */</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>     <span class="keywordflow">if</span> (a < 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>         sign = <span class="charliteral">'-'</span>;</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>         a = -a;</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">else</span></div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>         sign = <span class="charliteral">'+'</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="comment">/* Convert to degrees */</span></div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     degrees = (int) a;</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="comment">/* Compute minutes */</span></div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     b =  (a - (double)degrees) * 60.0;</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>     minutes = (int) b;</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">/* Compute seconds */</span></div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     seconds = (b - (double)minutes) * 60.0;</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> (seconds > 59.99) </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>         seconds = 0.0;</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>         minutes = minutes + 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> (minutes > 59) </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>         minutes = 0;</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>         degrees = degrees + 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>     (void) sprintf (tstring,<span class="stringliteral">"%c%02d:%02d:%05.2f"</span>,sign,degrees,minutes,seconds);</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>     <span class="comment">/* Move formatted string to returned string */</span></div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>     ltstr = (int) strlen (tstring);</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     <span class="keywordflow">if</span> (ltstr < length_str-1)</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>         strcpy (str, tstring);</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>     {</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>         strncpy (str, tstring, length_str-1);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>         str[length_str-1] = 0;</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">return</span>;</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span> }</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span> </div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span> cpl_error_code</div>
+<div class="line"><a name="l01276"></a><span class="lineno"><a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c"> 1276</a></span> <a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c" title="Insert all frames of other in self. To be removed after the same functionality exists in CPL...">hawki_frameset_append</a>(cpl_frameset *<span class="keyword">self</span>, <span class="keyword">const</span> cpl_frameset *other)</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>     cpl_size iframe;</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>     cpl_size nframes;</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>     nframes = cpl_frameset_get_size(other);</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">for</span>(iframe = 0; iframe<nframes; ++iframe)</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>         cpl_frame * newframe;</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>         newframe = cpl_frame_duplicate</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>             (cpl_frameset_get_frame_const(other, iframe));</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>         <span class="keywordflow">if</span>(cpl_frameset_insert(<span class="keyword">self</span>, newframe) != CPL_ERROR_NONE)</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>             cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>             <span class="keywordflow">return</span> CPL_ERROR_ILLEGAL_INPUT;</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="keywordflow">return</span> CPL_ERROR_NONE;</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><!-- 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/hawki__utils_8h_source.html b/html/hawki__utils_8h_source.html
index 4617db5..f72042f 100644
--- a/html/hawki__utils_8h_source.html
+++ b/html/hawki__utils_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_utils.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,175 +40,176 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_utils.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_utils.h,v 1.43 2012/12/06 16:55:32 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/12/06 16:55:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.43 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_UTILS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_UTILS_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                New types</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keyword">typedef</span> <span class="keyword">enum</span> _HAWKI_BAND_ {
-<a name="l00042"></a>00042     HAWKI_BAND_J,
-<a name="l00043"></a>00043     HAWKI_BAND_H,
-<a name="l00044"></a>00044     HAWKI_BAND_K,
-<a name="l00045"></a>00045     HAWKI_BAND_Y,
-<a name="l00046"></a>00046     HAWKI_BAND_UNKNOWN
-<a name="l00047"></a>00047 } hawki_band ;
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00050"></a>00050 <span class="comment">                                Define</span>
-<a name="l00051"></a>00051 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="preprocessor">#define HAWKI_NB_DETECTORS          4</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PHOT_STAR_RADIUS      30.0</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET_NPIX_X            2048</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET_NPIX_Y            2048</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span>
-<a name="l00058"></a>00058 <span class="comment">/* Input from commissionning 1 report */</span>
-<a name="l00059"></a>00059 <span class="preprocessor">#define HAWKI_DET1_POSX             0</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET1_POSY             0</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET2_POSX             2048 + 153</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET2_POSY             0 + 3</span>
-<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET3_POSX             2048 + 157</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET3_POSY             2048 + 144</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET4_POSX             0 + 5</span>
-<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET4_POSY             2048 + 142</span>
-<a name="l00067"></a>00067 <span class="preprocessor"></span>
-<a name="l00068"></a>00068 <span class="preprocessor">#define HAWKI_NB_VC                 32</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span>
-<a name="l00070"></a>00070 <span class="preprocessor">#define HAWKI_HEADER_EXT_FORWARD    "DET CHIP|DET WIN NX|DET WIN NY|DET WIN STARTX|DET WIN STARTY"</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 <span class="preprocessor">#define HAWKI_HEADER_WCS            "CTYPE1|CTYPE2|CRVAL1|CRVAL2|CRPIX1|CRPIX2|CD1_1|CD1_2|CD2_1|CD2_2"</span>
-<a name="l00073"></a>00073 <span class="preprocessor"></span>
-<a name="l00074"></a>00074 <span class="preprocessor">#define HAWKI_HEADER_COMB_OFFSETS   "ESO QC COMBINED"</span>
-<a name="l00075"></a>00075 <span class="preprocessor"></span>
-<a name="l00076"></a>00076 <span class="preprocessor">#define HAWKI_HEADER_PRI_TOPAF      "^(ARCFILE|MJD-OBS|INSTRUME|ESO TPL ID|ESO TPL NEXP|ESO DPR CATG|ESO DPR TECH|ESO DPR TYPE|DATE-OBS|ESO INS GRAT NAME|ESO INS GRAT WLEN|ESO INS OPTI1 ID|ESO OBS ID|ESO DET MINDIT|ESO DET RSPEED|ESO DET DIT|ESO DET NDIT|ESO DET NCORRS NAME|ESO INS FILT1 NAME|ESO INS FILT2 NAME|ESO MODE NAME|ESO NDSAMPLES)$" </span>
-<a name="l00077"></a>00077 <span class="preprocessor"></span>
-<a name="l00078"></a>00078 <span class="preprocessor">#define HAWKI_HEADER_EXT_TOPAF      "ESO DET CHIP ID|ESO DET CHIP NO|ESO DET CHIP LIVE"</span>
-<a name="l00079"></a>00079 <span class="preprocessor"></span>
-<a name="l00080"></a>00080 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00081"></a>00081 <span class="comment">                                    Prototypes</span>
-<a name="l00082"></a>00082 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 CPL_BEGIN_DECLS
-<a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>(<span class="keywordtype">void</span>);
-<a name="l00086"></a>00086 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(<span class="keywordtype">void</span>);
-<a name="l00087"></a>00087 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>(<span class="keywordtype">void</span>);
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 cpl_image * <a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd" title="Compute the large scale background.">hawki_compute_lsbg</a>
-<a name="l00090"></a>00090 (<span class="keyword">const</span> cpl_image *     in);
-<a name="l00091"></a>00091 cpl_image * <a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a>
-<a name="l00092"></a>00092 (<span class="keyword">const</span> cpl_image *     in,
-<a name="l00093"></a>00093  <span class="keywordtype">double</span>                sigma);
-<a name="l00094"></a>00094 cpl_image * <a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a>
-<a name="l00095"></a>00095 (<span class="keyword">const</span> cpl_image *   in,
-<a name="l00096"></a>00096  <span class="keywordtype">double</span>              sigma,
-<a name="l00097"></a>00097  <span class="keywordtype">double</span>              lowval,
-<a name="l00098"></a>00098  <span class="keywordtype">double</span>              highval);
-<a name="l00099"></a>00099 cpl_error_code <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a>
-<a name="l00100"></a>00100 (cpl_image *    image_in,
-<a name="l00101"></a>00101  <span class="keywordtype">double</span>         lo_valid,
-<a name="l00102"></a>00102  <span class="keywordtype">double</span>         hi_valid,
-<a name="l00103"></a>00103  <span class="keywordtype">double</span>         assign_in_range,
-<a name="l00104"></a>00104  <span class="keywordtype">double</span>         assign_out_range);
-<a name="l00105"></a>00105 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96" title="Apply the harmonization.">hawki_apply_harmonization</a>
-<a name="l00106"></a>00106 (cpl_imagelist *       in,
-<a name="l00107"></a>00107  <span class="keywordtype">double</span>                h1,
-<a name="l00108"></a>00108  <span class="keywordtype">double</span>                h2,
-<a name="l00109"></a>00109  <span class="keywordtype">double</span>                h3,
-<a name="l00110"></a>00110  <span class="keywordtype">double</span>                h4);
-<a name="l00111"></a>00111 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf" title="Compute the harmonization.">hawki_compute_harmonization</a>
-<a name="l00112"></a>00112 (<span class="keyword">const</span> cpl_imagelist * in,
-<a name="l00113"></a>00113  <span class="keywordtype">double</span> *              h1,
-<a name="l00114"></a>00114  <span class="keywordtype">double</span> *              h2,
-<a name="l00115"></a>00115  <span class="keywordtype">double</span> *              h3,
-<a name="l00116"></a>00116  <span class="keywordtype">double</span> *              h4,
-<a name="l00117"></a>00117  <span class="keywordtype">double</span> *              h);
-<a name="l00118"></a>00118 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a>
-<a name="l00119"></a>00119 (<span class="keyword">const</span> cpl_frameset *  in,
-<a name="l00120"></a>00120  <span class="keyword">const</span> <span class="keywordtype">char</span> *          tag);
-<a name="l00121"></a>00121 hawki_band <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a>
-<a name="l00122"></a>00122 (<span class="keyword">const</span> <span class="keywordtype">char</span> *          band);
-<a name="l00123"></a>00123 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a>
-<a name="l00124"></a>00124 (hawki_band            band);
-<a name="l00125"></a>00125 cpl_image * <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a>
-<a name="l00126"></a>00126 (cpl_image **    ima,
-<a name="l00127"></a>00127  <span class="keywordtype">double</span>    *     x,
-<a name="l00128"></a>00128  <span class="keywordtype">double</span>    *     y);
-<a name="l00129"></a>00129 cpl_bivector * <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a>
-<a name="l00130"></a>00130 (<span class="keyword">const</span> cpl_frameset *  frameset);
-<a name="l00131"></a>00131 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(cpl_frameset    *   <span class="keyword">set</span>);
-<a name="l00132"></a>00132 <span class="keywordtype">int</span> * <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a>
-<a name="l00133"></a>00133 (<span class="keyword">const</span> cpl_frameset *  frameset);
-<a name="l00134"></a>00134 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a>
-<a name="l00135"></a>00135 (<span class="keyword">const</span> cpl_frameset * in,
-<a name="l00136"></a>00136  <span class="keywordtype">double</span>               star_ra,
-<a name="l00137"></a>00137  <span class="keywordtype">double</span>               star_dec,
-<a name="l00138"></a>00138  <span class="keywordtype">int</span>                * labels);
-<a name="l00139"></a>00139 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a>
-<a name="l00140"></a>00140 (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid);
-<a name="l00141"></a>00141 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a>
-<a name="l00142"></a>00142 (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid);
-<a name="l00143"></a>00143 <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(cpl_vector * vec);
-<a name="l00144"></a>00144 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a>
-<a name="l00145"></a>00145 (cpl_frameset * frames, <span class="keywordtype">double</span> (*func)(<span class="keyword">const</span> cpl_propertylist *));
-<a name="l00146"></a>00146 <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a>
-<a name="l00147"></a>00147 (cpl_frameset * frames, <span class="keywordtype">int</span> (*func)(<span class="keyword">const</span> cpl_propertylist *));
-<a name="l00148"></a>00148 <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> length_str, <span class="keywordtype" [...]
-<a name="l00149"></a>00149 <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> length_str, <span class="keywordtype">double</span> dec);
-<a name="l00150"></a>00150 cpl_error_code <a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c" title="Insert all frames of other in self. To be removed after the same functionality exists in CPL...">hawki_frameset_append</a>
-<a name="l00151"></a>00151 (cpl_frameset *<span class="keyword">self</span>, <span class="keyword">const</span> cpl_frameset *other);
-<a name="l00152"></a>00152 CPL_END_DECLS
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_utils.h,v 1.43 2012/12/06 16:55: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012/12/06 16:55:32 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.43 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: hawki-1_8_12 $</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 HAWKI_UTILS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                New types</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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">typedef</span> <span class="keyword">enum</span> _HAWKI_BAND_ {</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     HAWKI_BAND_J,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     HAWKI_BAND_H,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     HAWKI_BAND_K,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     HAWKI_BAND_Y,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     HAWKI_BAND_UNKNOWN</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> } hawki_band ;</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">                                Define</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="preprocessor">#define HAWKI_NB_DETECTORS          4</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_PHOT_STAR_RADIUS      30.0</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET_NPIX_X            2048</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET_NPIX_Y            2048</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> <span class="comment">/* Input from commissionning 1 report */</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#define HAWKI_DET1_POSX             0</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET1_POSY             0</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET2_POSX             2048 + 153</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET2_POSY             0 + 3</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET3_POSX             2048 + 157</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET3_POSY             2048 + 144</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET4_POSX             0 + 5</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_DET4_POSY             2048 + 142</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 HAWKI_NB_VC                 32</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">#define HAWKI_HEADER_EXT_FORWARD    "DET CHIP|DET WIN NX|DET WIN NY|DET WIN STARTX|DET WIN STARTY"</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 HAWKI_HEADER_WCS            "CTYPE1|CTYPE2|CRVAL1|CRVAL2|CRPIX1|CRPIX2|CD1_1|CD1_2|CD2_1|CD2_2"</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">#define HAWKI_HEADER_COMB_OFFSETS   "ESO QC COMBINED"</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> <span class="preprocessor">#define HAWKI_HEADER_PRI_TOPAF      "^(ARCFILE|MJD-OBS|INSTRUME|ESO TPL ID|ESO TPL NEXP|ESO DPR CATG|ESO DPR TECH|ESO DPR TYPE|DATE-OBS|ESO INS GRAT NAME|ESO INS GRAT WLEN|ESO INS OPTI1 ID|ESO OBS ID|ESO DET MINDIT|ESO DET RSPEED|ESO DET DIT|ESO DET NDIT|ESO DET NCORRS NAME|ESO INS FILT1 NAME|ESO INS FILT2 NAME|ESO MODE NAME|ESO NDSAMPLES)$" </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 HAWKI_HEADER_EXT_TOPAF      "ESO DET CHIP ID|ESO DET CHIP NO|ESO DET CHIP LIVE"</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="comment">                                    Prototypes</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="comment"> -----------------------------------------------------------------------------*/</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_BEGIN_DECLS</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gadfbb9f93a998ca86bbe90dbf808e5566" title="Issue a banner with the pipeline version.">hawki_print_banner</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#gafde011eb3e31e78d4d01cc9c26e2d33a" title="Get the pipeline copyright and license.">hawki_get_license</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga4e8a1eeb0faaa8793bdb37b7450c33e3" title="Returns the version of the pipeline.">hawki_get_version</a>(<span class="keywordtype">void</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> cpl_image * <a class="code" href="group__hawki__utils.html#ga49279015ecc6c4dcc6a00de6ed6109bd" title="Compute the large scale background.">hawki_compute_lsbg</a></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> (<span class="keyword">const</span> cpl_image *     in);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> cpl_image * <a class="code" href="group__hawki__utils.html#ga292d87e3996e9bb4331980a41d8b45bb" title="Compute the bpm from the dark (hot pixels)">hawki_compute_darkbpm</a></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> (<span class="keyword">const</span> cpl_image *     in,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>  <span class="keywordtype">double</span>                sigma);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> cpl_image * <a class="code" href="group__hawki__utils.html#ga5d0deca1786f42488784c23e361d0877" title="Compute the bpm from the flat (aka cold pixels mask)">hawki_compute_flatbpm</a></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> (<span class="keyword">const</span> cpl_image *   in,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  <span class="keywordtype">double</span>              sigma,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  <span class="keywordtype">double</span>              lowval,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  <span class="keywordtype">double</span>              highval);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> cpl_error_code <a class="code" href="group__hawki__utils.html#ga8ad7002b08a8f9dff942f46b3f3456f0" title="Create an image with a given value for pixels within a range and another value for pixels outside tha...">hawki_image_inverse_threshold</a></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> (cpl_image *    image_in,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>  <span class="keywordtype">double</span>         lo_valid,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>  <span class="keywordtype">double</span>         hi_valid,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>  <span class="keywordtype">double</span>         assign_in_range,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>  <span class="keywordtype">double</span>         assign_out_range);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gaa24cf39f777ab8389419b3d18a8bec96" title="Apply the harmonization.">hawki_apply_harmonization</a></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> (cpl_imagelist *       in,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>  <span class="keywordtype">double</span>                h1,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>  <span class="keywordtype">double</span>                h2,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>  <span class="keywordtype">double</span>                h3,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>  <span class="keywordtype">double</span>                h4);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga367515ebe3345fcd79c2849879633ebf" title="Compute the harmonization.">hawki_compute_harmonization</a></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> (<span class="keyword">const</span> cpl_imagelist * in,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>  <span class="keywordtype">double</span> *              h1,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>  <span class="keywordtype">double</span> *              h2,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>  <span class="keywordtype">double</span> *              h3,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>  <span class="keywordtype">double</span> *              h4,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>  <span class="keywordtype">double</span> *              h);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga0ee9f37ad441f9fcc16865b34f9459a9" title="Extract the filename ffor the first frame of the given tag.">hawki_extract_first_filename</a></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> (<span class="keyword">const</span> cpl_frameset *  in,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *          tag);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> hawki_band <a class="code" href="group__hawki__utils.html#ga6d85879fd8b8895544f7787e8a6ddade" title="Get the band.">hawki_get_band</a></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> (<span class="keyword">const</span> <span class="keywordtype">char</span> *          band);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__hawki__utils.html#ga49b3f45aa7c812c0a90faf073998dbc4" title="Return a band name.">hawki_std_band_name</a></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> (hawki_band            band);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> cpl_image * <a class="code" href="group__hawki__utils.html#ga7f6d3694df0e3a441b20267a1e5894db" title="Apply the stitching.">hawki_images_stitch</a></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> (cpl_image **    ima,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>  <span class="keywordtype">double</span>    *     x,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>  <span class="keywordtype">double</span>    *     y);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> cpl_bivector * <a class="code" href="group__hawki__utils.html#ga4c2e0ffe688ffdfd93f0d61c60ac91fd" title="Get the nominal header offsets from a set of frames.">hawki_get_header_tel_offsets</a></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> (<span class="keyword">const</span> cpl_frameset *  frameset);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga7b165e9e91b6c6519595109b36d4fb46" title="Get the mean airmass for a set of frames.">hawki_get_mean_airmass</a>(cpl_frameset    *   <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="keywordtype">int</span> * <a class="code" href="group__hawki__utils.html#ga024bd2557115d5d7d3265dbcbb3b1884" title="Get the frames in which the star is for a given chip.">hawki_detectors_labelise</a></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> (<span class="keyword">const</span> cpl_frameset *  frameset);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#gabee84f3ed597df9a6ae97f07fc2204a0" title="Get the frames in which the star is for a given chip.">hawki_detectors_locate_star</a></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> (<span class="keyword">const</span> cpl_frameset * in,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>  <span class="keywordtype">double</span>               star_ra,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>  <span class="keywordtype">double</span>               star_dec,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>  <span class="keywordtype">int</span>                * labels);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#ga29ae7b4052fd284d8b01f33e127c2846" title="Gets the minimum value of a vector according to an array of flags.">hawki_vector_get_min_select</a></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gaba8fca8aa585fed96efc75545bfc6b04" title="Gets the maximum value of a vector according to an array of flags.">hawki_vector_get_max_select</a></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> (<span class="keyword">const</span> cpl_vector * <span class="keyword">self</span>, <span class="keyword">const</span> cpl_vector * valid);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="keywordtype">double</span> <a class="code" href="group__hawki__utils.html#gac64c154f22c4d25e242833fbe75da886" title="Compute the histogram mode.">hawki_vector_get_mode</a>(cpl_vector * vec);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga4c041169d43f161a8c9d7f23d7fc57a7" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_double_keys</a></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> (cpl_frameset * frames, <span class="keywordtype">double</span> (*func)(<span class="keyword">const</span> cpl_propertylist *));</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keywordtype">int</span> <a class="code" href="group__hawki__utils.html#ga8c1508e389b7fd0da8fbda451ffd1663" title="Check that all the frames share the same value of a given keyword.">hawki_utils_check_equal_int_keys</a></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> (cpl_frameset * frames, <span class="keywordtype">int</span> (*func)(<span class="keyword">const</span> cpl_propertylist *));</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#gaa6f925bb6e5320dcd0f06ad5238813b3" title="This functions formats a right ascension in degrees to a string of the form HH:MM:SS. It is based on ra2str from file libwcs/ang2str.c in wcstools library (http://tdc-www.harvard.edu/wcstools/)">hawki_utils_ra2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtyp [...]
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">void</span> <a class="code" href="group__hawki__utils.html#ga38bbbd4f8537d1cab5cfba056bd8edf6" title="This functions formats a declination in degrees to a string of the form DD:MM:SS. It is based on dec2...">hawki_utils_dec2str</a>(<span class="keywordtype">char</span> * str, <span class="keywordtype">int</span> length_str, <span class="keywordtype">double</span> dec);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> cpl_error_code <a class="code" href="group__hawki__utils.html#ga8750ba220d588314effce204619b015c" title="Insert all frames of other in self. To be removed after the same functionality exists in CPL...">hawki_frameset_append</a></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> (cpl_frameset *<span class="keyword">self</span>, <span class="keyword">const</span> cpl_frameset *other);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> CPL_END_DECLS</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="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/hawki__variance_8c_source.html b/html/hawki__variance_8c_source.html
index b666f23..c2af02a 100644
--- a/html/hawki__variance_8c_source.html
+++ b/html/hawki__variance_8c_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_variance.c Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,139 +40,140 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_variance.c</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_variance.c,v 1.2 2009/03/13 11:52:06 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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/03/13 11:52:06 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00033"></a>00033 <span class="comment">                                   Includes</span>
-<a name="l00034"></a>00034 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <float.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <string.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include "hawki_variance.h"</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00047"></a>00047 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00048"></a>00048 
-<a name="l00051"></a>00051 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00079"></a>00079 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00080"></a>00080 cpl_image * <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a>
-<a name="l00081"></a><a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc">00081</a> (<span class="keyword">const</span> cpl_image * image,
-<a name="l00082"></a>00082  <span class="keywordtype">double</span>            gain,
-<a name="l00083"></a>00083  <span class="keywordtype">double</span>            ron,
-<a name="l00084"></a>00084  <span class="keywordtype">int</span>               ndit,
-<a name="l00085"></a>00085  <span class="keywordtype">int</span>               ndsamples)
-<a name="l00086"></a>00086 {
-<a name="l00087"></a>00087     cpl_image    * variance;
-<a name="l00088"></a>00088     <span class="keywordtype">float</span>        * variance_p;
-<a name="l00089"></a>00089     <span class="keyword">const</span> <span class="keywordtype">float</span>  * image_p;
-<a name="l00090"></a>00090     <span class="keywordtype">int</span>            pix;
-<a name="l00091"></a>00091     <span class="keywordtype">int</span>            npix;
-<a name="l00092"></a>00092     <span class="keywordtype">double</span>         poisson_contrib;
-<a name="l00093"></a>00093     <span class="keywordtype">double</span>         poisson_factor;
-<a name="l00094"></a>00094     <span class="keywordtype">double</span>         ron_contrib;
-<a name="l00095"></a>00095     
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097     <span class="comment">/* Test entries */</span>
-<a name="l00098"></a>00098     <span class="keywordflow">if</span> (image == NULL) <span class="keywordflow">return</span> NULL;
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     <span class="comment">/* Create new image */</span>
-<a name="l00101"></a>00101     variance = cpl_image_duplicate(image);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103     <span class="comment">/* Loop on pixels */</span>
-<a name="l00104"></a>00104     variance_p = cpl_image_get_data(variance);
-<a name="l00105"></a>00105     image_p = cpl_image_get_data_const(image);
-<a name="l00106"></a>00106     npix = cpl_image_get_size_x(image) * cpl_image_get_size_y(image); 
-<a name="l00107"></a>00107     <span class="comment">/* TODO: There is a Delta_t factor that appears in the Vacca article</span>
-<a name="l00108"></a>00108 <span class="comment">     * that is not reflexed here! */</span> 
-<a name="l00109"></a>00109     ron_contrib = 12 * ron * ron / (gain * gain * ndsamples * ndit) *
-<a name="l00110"></a>00110         (ndsamples - 1) / (ndsamples + 1);
-<a name="l00111"></a>00111     poisson_factor = 6. / (5. * gain * ndsamples * ndit) * 
-<a name="l00112"></a>00112         (ndsamples * ndsamples + 1) / (ndsamples + 1);
-<a name="l00113"></a>00113     <span class="keywordflow">for</span>(pix = 0; pix < npix; ++pix)
-<a name="l00114"></a>00114     {
-<a name="l00115"></a>00115         <span class="comment">/* TODO: Include the effect of saturation in the TLI mode used by HAWK-I */</span>
-<a name="l00116"></a>00116         poisson_contrib = poisson_factor * fabs(image_p[pix]);
-<a name="l00117"></a>00117         variance_p[pix] = poisson_contrib + ron_contrib;
-<a name="l00118"></a>00118     }
-<a name="l00119"></a>00119     
-<a name="l00120"></a>00120     <span class="comment">/* Return */</span>
-<a name="l00121"></a>00121     <span class="keywordflow">return</span> variance;
-<a name="l00122"></a>00122 }
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00157"></a>00157 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00158"></a>00158 cpl_imagelist * <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a>
-<a name="l00159"></a><a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818">00159</a> (cpl_imagelist * imagelist_raw, 
-<a name="l00160"></a>00160  <span class="keywordtype">double</span>          gain,
-<a name="l00161"></a>00161  <span class="keywordtype">double</span>          ron,
-<a name="l00162"></a>00162  <span class="keywordtype">int</span>             ndit,
-<a name="l00163"></a>00163  <span class="keywordtype">int</span>             ndsamples)
-<a name="l00164"></a>00164 {
-<a name="l00165"></a>00165     cpl_imagelist  * variances;
-<a name="l00166"></a>00166     
-<a name="l00167"></a>00167     variances = cpl_imagelist_new();
-<a name="l00168"></a>00168     <span class="comment">/* Loop on the frames */</span>
-<a name="l00169"></a>00169     <span class="keywordflow">while</span>(cpl_imagelist_get_size(imagelist_raw) > 0)
-<a name="l00170"></a>00170     {
-<a name="l00171"></a>00171         cpl_image * variance;
-<a name="l00172"></a>00172             
-<a name="l00173"></a>00173         variance = <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a>
-<a name="l00174"></a>00174             (cpl_imagelist_get(imagelist_raw, 0), gain, ron, ndit, ndsamples);
-<a name="l00175"></a>00175         cpl_imagelist_set(variances, variance, 
-<a name="l00176"></a>00176                           cpl_imagelist_get_size(variances));
-<a name="l00177"></a>00177         cpl_image_delete(cpl_imagelist_unset(imagelist_raw, 0));
-<a name="l00178"></a>00178     }
-<a name="l00179"></a>00179     <span class="keywordflow">return</span> variances;
-<a name="l00180"></a>00180 }
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182 
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_variance.c,v 1.2 2009/03/13 11:52:06 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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/03/13 11:52:06 $</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: hawki-1_8_12 $</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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">                                   Includes</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> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <string.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 <cpl.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 "hawki_variance.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="comment">/*----------------------------------------------------------------------------*/</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> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</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> cpl_image * <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a></div>
+<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc">   81</a></span> (<span class="keyword">const</span> cpl_image * image,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>  <span class="keywordtype">double</span>            gain,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>  <span class="keywordtype">double</span>            ron,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>  <span class="keywordtype">int</span>               ndit,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>  <span class="keywordtype">int</span>               ndsamples)</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_image    * variance;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <span class="keywordtype">float</span>        * variance_p;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     <span class="keyword">const</span> <span class="keywordtype">float</span>  * image_p;</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <span class="keywordtype">int</span>            pix;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordtype">int</span>            npix;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordtype">double</span>         poisson_contrib;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="keywordtype">double</span>         poisson_factor;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordtype">double</span>         ron_contrib;</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> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="keywordflow">if</span> (image == NULL) <span class="keywordflow">return</span> 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="comment">/* Create new image */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     variance = cpl_image_duplicate(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="comment">/* Loop on pixels */</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     variance_p = cpl_image_get_data(variance);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     image_p = cpl_image_get_data_const(image);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     npix = cpl_image_get_size_x(image) * cpl_image_get_size_y(image); </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="comment">/* TODO: There is a Delta_t factor that appears in the Vacca article</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="comment">     * that is not reflexed here! */</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     ron_contrib = 12 * ron * ron / (gain * gain * ndsamples * ndit) *</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         (ndsamples - 1) / (ndsamples + 1);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     poisson_factor = 6. / (5. * gain * ndsamples * ndit) * </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         (ndsamples * ndsamples + 1) / (ndsamples + 1);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">for</span>(pix = 0; pix < npix; ++pix)</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">/* TODO: Include the effect of saturation in the TLI mode used by HAWK-I */</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         poisson_contrib = poisson_factor * fabs(image_p[pix]);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         variance_p[pix] = poisson_contrib + ron_contrib;</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>     </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="comment">/* Return */</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordflow">return</span> variance;</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> <span class="comment">/*----------------------------------------------------------------------------*/</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> cpl_imagelist * <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a></div>
+<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818">  159</a></span> (cpl_imagelist * imagelist_raw, </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>  <span class="keywordtype">double</span>          gain,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>  <span class="keywordtype">double</span>          ron,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>  <span class="keywordtype">int</span>             ndit,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>  <span class="keywordtype">int</span>             ndsamples)</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_imagelist  * variances;</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>     variances = cpl_imagelist_new();</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="comment">/* Loop on the frames */</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keywordflow">while</span>(cpl_imagelist_get_size(imagelist_raw) > 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>         cpl_image * variance;</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>         variance = <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>             (cpl_imagelist_get(imagelist_raw, 0), gain, ron, ndit, ndsamples);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         cpl_imagelist_set(variances, variance, </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                           cpl_imagelist_get_size(variances));</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>         cpl_image_delete(cpl_imagelist_unset(imagelist_raw, 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>     <span class="keywordflow">return</span> variances;</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><!-- 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/hawki__variance_8h_source.html b/html/hawki__variance_8h_source.html
index b0e2667..dc2a87a 100644
--- a/html/hawki__variance_8h_source.html
+++ b/html/hawki__variance_8h_source.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: hawki_variance.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -34,76 +40,77 @@
       <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_8028944ee79da36d001a678d64addfcc.html">hawki</a>      </li>
-    </ul>
-  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_0bffb7ec63ae446defe2a91d65f62d26.html">hawki</a></li>  </ul>
 </div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">hawki_variance.h</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: hawki_variance.h,v 1.2 2009/03/13 11:52: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 HAWKI Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/03/13 11:52:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: hawki-1_8_11 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef HAWKI_VARIANCE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_VARIANCE_H</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="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00038"></a>00038 <span class="comment">                                    Prototypes</span>
-<a name="l00039"></a>00039 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 cpl_image * <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a>
-<a name="l00042"></a>00042 (<span class="keyword">const</span> cpl_image * image,
-<a name="l00043"></a>00043  <span class="keywordtype">double</span>            gain,
-<a name="l00044"></a>00044  <span class="keywordtype">double</span>            ron,
-<a name="l00045"></a>00045  <span class="keywordtype">int</span>               ndit,
-<a name="l00046"></a>00046  <span class="keywordtype">int</span>               ndsamples);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 cpl_imagelist * <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a>
-<a name="l00049"></a>00049 (cpl_imagelist * imagelist_raw, 
-<a name="l00050"></a>00050  <span class="keywordtype">double</span>          gain,
-<a name="l00051"></a>00051  <span class="keywordtype">double</span>          ron,
-<a name="l00052"></a>00052  <span class="keywordtype">int</span>             ndit,
-<a name="l00053"></a>00053  <span class="keywordtype">int</span>             ndsamples);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="preprocessor">#endif</span>
-</pre></div></div>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: hawki_variance.h,v 1.2 2009/03/13 11:52: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 HAWKI Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002,2003 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: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009/03/13 11:52:14 $</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: hawki-1_8_12 $</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 HAWKI_VARIANCE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define HAWKI_VARIANCE_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="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="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">                                    Prototypes</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> -----------------------------------------------------------------------------*/</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> cpl_image * <a class="code" href="group__hawki__variance.html#ga0de4bc882b19eb5d32599f6ec2c3eecc" title="Create the associated variance of a raw image.">hawki_image_create_variance</a></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> (<span class="keyword">const</span> cpl_image * image,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>  <span class="keywordtype">double</span>            gain,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>  <span class="keywordtype">double</span>            ron,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>  <span class="keywordtype">int</span>               ndit,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>  <span class="keywordtype">int</span>               ndsamples);</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_imagelist * <a class="code" href="group__hawki__variance.html#ga3077d7b2029de0416fabed98bc092818" title="Create the associated variance of raw imagelist.">hawki_imglist_create_variances_and_delete</a></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> (cpl_imagelist * imagelist_raw, </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>  <span class="keywordtype">double</span>          gain,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>  <span class="keywordtype">double</span>          ron,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>  <span class="keywordtype">int</span>             ndit,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>  <span class="keywordtype">int</span>             ndsamples);</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="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/index.html b/html/index.html
index abe2bb0..eb9fe7c 100644
--- a/html/index.html
+++ b/html/index.html
@@ -2,42 +2,51 @@
 <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>HAWKI Pipeline Reference Manual: Main Page</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">HAWKI Pipeline Reference Manual Documentation</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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/jquery.js b/html/jquery.js
index c052173..63939e7 100644
--- a/html/jquery.js
+++ b/html/jquery.js
@@ -1,54 +1,8 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return [...]
-var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([ [...]
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[ [...]
-{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.no [...]
-{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"oldd [...]
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentP [...]
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- *	ui.core.js
- */
-(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.o [...]
-{s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relativ [...]
-/**
- * jQuery.ScrollTo - Easy element scrolling using jQuery.
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
- * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
- * Date: 2/8/2008
- * @author Ariel Flesler
- * @version 1.3.2
- */
-;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':i [...]
-
+/*! 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/modules.html b/html/modules.html
index a8d44f4..d18d29c 100644
--- a/html/modules.html
+++ b/html/modules.html
@@ -2,59 +2,70 @@
 <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>HAWKI Pipeline Reference Manual: Modules</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">Modules</div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<div class="textblock">Here is a list of all modules:</div><ul>
-<li><a class="el" href="group__hawki__alloc.html">Allocation rutines</a></li>
-<li><a class="el" href="group__hawki__calib.html">Basic calibration Utilities</a></li>
-<li><a class="el" href="group__hawki__combine.html">Images combination routines</a></li>
-<li><a class="el" href="group__hawki__dfs.html">DFS related functions</a></li>
-<li><a class="el" href="group__hawki__distortion.html">Distortion correction</a></li>
-<li><a class="el" href="group__hawki__image.html">Image manipulation</a></li>
-<li><a class="el" href="group__hawki__image__stats.html">Compute several statistics on images</a></li>
-<li><a class="el" href="group__hawki__load.html">Loading related functions</a></li>
-<li><a class="el" href="group__hawki__mask.html">Mask manipulation</a></li>
-<li><a class="el" href="group__hawki__obj__det.html">Functionality related to catalogue matching</a></li>
-<li><a class="el" href="group__hawki__pfits.html">FITS header protected access</a></li>
-<li><a class="el" href="group__hawki__properties__tel.html">Manipulates QC keywords from the telescope</a></li>
-<li><a class="el" href="group__hawki__save.html">Saving related functions</a></li>
-<li><a class="el" href="group__hawki__utils.html">Miscellaneous Utilities</a></li>
-<li><a class="el" href="group__hawki__variance.html">Variance estimation for raw images.</a></li>
-</ul>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
+<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__hawki__alloc.html" target="_self">Allocation rutines</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__hawki__calib.html" target="_self">Basic calibration 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__hawki__combine.html" target="_self">Images combination routines</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__hawki__dfs.html" target="_self">DFS related functions</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__hawki__distortion.html" target="_self">Distortion correction</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__hawki__image.html" target="_self">Image manipulation</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__hawki__image__stats.html" target="_self">Compute several statistics on images</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__hawki__load.html" target="_self">Loading related functions</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__hawki__mask.html" target="_self">Mask manipulation</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__hawki__obj__det.html" target="_self">Functionality related to catalogue matching</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__hawki__pfits.html" target="_self">FITS header protected access</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__hawki__properties__tel.html" target="_self">Manipulates QC keywords from the telescope</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__hawki__save.html" target="_self">Saving related functions</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__hawki__utils.html" target="_self">Miscellaneous Utilities</a></td><td class="desc"></td></tr>
+<tr id="row_14_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a class="el" href="group__hawki__variance.html" target="_self">Variance estimation for raw images.</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/nav_f.png b/html/nav_f.png
index 1b07a16..72a58a5 100644
Binary files a/html/nav_f.png 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
index 01f5fa6..33389b1 100644
Binary files a/html/nav_h.png and b/html/nav_h.png differ
diff --git a/html/open.png b/html/open.png
index 7b35d2c..30f75c7 100644
Binary files a/html/open.png and b/html/open.png differ
diff --git a/html/struct__hawki__distortion__obj__function__args__.html b/html/struct__hawki__distortion__obj__function__args__.html
index 78dbb1f..47f97af 100644
--- a/html/struct__hawki__distortion__obj__function__args__.html
+++ b/html/struct__hawki__distortion__obj__function__args__.html
@@ -2,31 +2,37 @@
 <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>HAWKI Pipeline Reference Manual: _hawki_distortion_obj_function_args_ Struct Reference</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.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>
-<!-- Generated by Doxygen 1.7.4 -->
-<div id="top">
+<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">HAWKI Pipeline Reference Manual <span id="projectnumber">1.8.11</span></div>
+   <div id="projectname">HAWKI Pipeline Reference Manual
+    <span id="projectnumber">1.8.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>
-      <li><a href="dirs.html"><span>Directories</span></a></li>
     </ul>
   </div>
   <div id="navrow2" class="tabs2">
@@ -35,25 +41,26 @@
       <li><a href="classes.html"><span>Data Structure Index</span></a></li>
     </ul>
   </div>
-</div>
+</div><!-- top -->
 <div class="header">
   <div class="headertitle">
 <div class="title">_hawki_distortion_obj_function_args_ Struct Reference<div class="ingroups"><a class="el" href="group__hawki__distortion.html">Distortion correction</a></div></div>  </div>
-</div>
+</div><!--header-->
 <div class="contents">
-<!-- doxytag: class="_hawki_distortion_obj_function_args_" --><table class="memberdecls">
-</table>
-<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
 <div class="textblock"><p>This private structure allows to pass parameters to the minimization function used to compute the distortion solution </p>
-<dl class="see"><dt><b>See also:</b></dt><dd>hawki_distortion_compute_solution </dd></dl>
+<dl class="section see"><dt>See Also</dt><dd>hawki_distortion_compute_solution </dd></dl>
 
 <p>Definition at line <a class="el" href="hawki__distortion_8c_source.html#l00069">69</a> of file <a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a>.</p>
 </div><hr/>The documentation for this struct was generated from the following file:<ul>
 <li><a class="el" href="hawki__distortion_8c_source.html">hawki_distortion.c</a></li>
 </ul>
-</div>
-<hr class="footer"/><address class="footer"><small>Generated on Tue Jan 15 2013 for HAWKI Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </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/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
index 2d99ef2..3b725c4 100644
Binary files a/html/tab_a.png and b/html/tab_a.png differ
diff --git a/html/tab_b.png b/html/tab_b.png
index b2c3d2b..e2b4a86 100644
Binary files a/html/tab_b.png and b/html/tab_b.png differ
diff --git a/html/tab_h.png b/html/tab_h.png
index c11f48f..fd5cb70 100644
Binary files a/html/tab_h.png and b/html/tab_h.png differ
diff --git a/html/tab_s.png b/html/tab_s.png
index 978943a..ab478c9 100644
Binary files a/html/tab_s.png and b/html/tab_s.png differ
diff --git a/html/tabs.css b/html/tabs.css
index 2192056..9cf578f 100644
--- a/html/tabs.css
+++ b/html/tabs.css
@@ -3,6 +3,7 @@
     width: 100%;
     z-index: 101;
     font-size: 13px;
+    font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
 }
 
 .tabs2 {
diff --git a/irplib/Makefile.am b/irplib/Makefile.am
index 2a5e64e..9e08d31 100644
--- a/irplib/Makefile.am
+++ b/irplib/Makefile.am
@@ -30,7 +30,7 @@ MAINTAINERCLEANFILES = Makefile.in
 
 endif
 
-INCLUDES = $(all_includes)
+AM_CPPFLAGS = $(all_includes)
 
 noinst_HEADERS =    irplib_flat.h \
                     irplib_calib.h \
diff --git a/irplib/Makefile.in b/irplib/Makefile.in
index 1f838dd..0ab48a9 100644
--- a/irplib/Makefile.in
+++ b/irplib/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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.
@@ -17,6 +16,23 @@
 
 
 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@
@@ -38,7 +54,8 @@ 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/gsl.m4 \
@@ -91,6 +108,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-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/||"`;; \
@@ -112,6 +134,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)"
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
@@ -317,7 +345,7 @@ AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 SUBDIRS = . tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = $(all_includes)
+AM_CPPFLAGS = $(all_includes)
 noinst_HEADERS = irplib_flat.h \
                     irplib_calib.h \
                     irplib_cat.h \
@@ -406,13 +434,15 @@ $(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) 
+	@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:
@@ -471,8 +501,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -486,17 +519,15 @@ uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+	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):
+# 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 \
@@ -506,7 +537,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; \
@@ -520,37 +555,6 @@ $(RECURSIVE_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-$(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; \
-	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; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -559,6 +563,10 @@ 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)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -622,6 +630,20 @@ GTAGS:
 	  && $(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
 
@@ -657,13 +679,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || 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; \
@@ -701,10 +720,15 @@ 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:
@@ -789,24 +813,25 @@ ps-am:
 
 uninstall-am: uninstall-pkgincludeHEADERS
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	clean-noinstLTLIBRARIES 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-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 mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-pkgincludeHEADERS
+	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-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 \
+	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.
diff --git a/irplib/irplib_calib.c b/irplib/irplib_calib.c
index 7eafd5b..f362c6c 100644
--- a/irplib/irplib_calib.c
+++ b/irplib/irplib_calib.c
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2009/02/17 08:05:25 $
  * $Revision: 1.17 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_calib.h b/irplib/irplib_calib.h
index 78d58f7..806508d 100644
--- a/irplib/irplib_calib.h
+++ b/irplib/irplib_calib.h
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2007/02/12 10:34:51 $
  * $Revision: 1.8 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_CALIB_H
diff --git a/irplib/irplib_cat.c b/irplib/irplib_cat.c
index 9fe4215..ce27b1d 100644
--- a/irplib/irplib_cat.c
+++ b/irplib/irplib_cat.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/12/01 12:34:25 $
  * $Revision: 1.10 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_cat.h b/irplib/irplib_cat.h
index d472acd..816460a 100644
--- a/irplib/irplib_cat.h
+++ b/irplib/irplib_cat.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/12/16 14:49:52 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_CAT_H
diff --git a/irplib/irplib_distortion.c b/irplib/irplib_distortion.c
index d3907dd..6c4cd96 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.52 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_distortion.h b/irplib/irplib_distortion.h
index 538ad3a..a0ba305 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.6 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_DISTORTION_H
diff --git a/irplib/irplib_flat.c b/irplib/irplib_flat.c
index b75f910..78d0bd1 100644
--- a/irplib/irplib_flat.c
+++ b/irplib/irplib_flat.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2007/08/07 12:15:41 $
  * $Revision: 1.15 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_flat.h b/irplib/irplib_flat.h
index 0cc03af..f977964 100644
--- a/irplib/irplib_flat.h
+++ b/irplib/irplib_flat.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2005/09/15 11:47:16 $
  * $Revision: 1.4 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_FLAT_H
diff --git a/irplib/irplib_framelist.c b/irplib/irplib_framelist.c
index 78484db..c591752 100644
--- a/irplib/irplib_framelist.c
+++ b/irplib/irplib_framelist.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/02/03 13:55:14 $
  * $Revision: 1.29 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 
diff --git a/irplib/irplib_framelist.h b/irplib/irplib_framelist.h
index 5af2821..221a4cc 100644
--- a/irplib/irplib_framelist.h
+++ b/irplib/irplib_framelist.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2008/11/20 10:24:47 $
  * $Revision: 1.8 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_FRAMELIST_H
diff --git a/irplib/irplib_hist.c b/irplib/irplib_hist.c
index 1ad2028..3370445 100644
--- a/irplib/irplib_hist.c
+++ b/irplib/irplib_hist.c
@@ -24,7 +24,7 @@
  * $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: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_hist.h b/irplib/irplib_hist.h
index 44c446d..1b1f90a 100644
--- a/irplib/irplib_hist.h
+++ b/irplib/irplib_hist.h
@@ -22,7 +22,7 @@
  * $Author: lbilbao $
  * $Date: 2007/09/07 14:23:50 $
  * $Revision: 1.3 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_HIST_H
diff --git a/irplib/irplib_ksigma_clip.c b/irplib/irplib_ksigma_clip.c
index 69dee51..63078c2 100644
--- a/irplib/irplib_ksigma_clip.c
+++ b/irplib/irplib_ksigma_clip.c
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2011/11/02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_ksigma_clip.h b/irplib/irplib_ksigma_clip.h
index a2730ec..fecc7d7 100644
--- a/irplib/irplib_ksigma_clip.h
+++ b/irplib/irplib_ksigma_clip.h
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2011/11/02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_KSIGMA_CLIP_H
diff --git a/irplib/irplib_ksigma_clip_body.h b/irplib/irplib_ksigma_clip_body.h
index ec073e6..7bbe9db 100644
--- a/irplib/irplib_ksigma_clip_body.h
+++ b/irplib/irplib_ksigma_clip_body.h
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2011/11/02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #define TYPE_ADD(a) CONCAT2X(a, CPL_TYPE)
diff --git a/irplib/irplib_match_cats.c b/irplib/irplib_match_cats.c
index c9d18f1..57befa4 100644
--- a/irplib/irplib_match_cats.c
+++ b/irplib/irplib_match_cats.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/12/18 10:44:48 $
  * $Revision: 1.10 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_match_cats.h b/irplib/irplib_match_cats.h
index fee54f0..e4e9166 100644
--- a/irplib/irplib_match_cats.h
+++ b/irplib/irplib_match_cats.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2009/12/18 10:44:48 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_MATCH_CATS_H
diff --git a/irplib/irplib_mkmaster.c b/irplib/irplib_mkmaster.c
index 85bb1ae..3ff44a3 100644
--- a/irplib/irplib_mkmaster.c
+++ b/irplib/irplib_mkmaster.c
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2012/01/12 14:29:41 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_mkmaster.h b/irplib/irplib_mkmaster.h
index d4b7e40..d7699b5 100644
--- a/irplib/irplib_mkmaster.h
+++ b/irplib/irplib_mkmaster.h
@@ -22,7 +22,7 @@
  * $Author: amodigli $
  * $Date: 2011/11/02 13:17:25 $
  * $Revision: 1.3 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_MKMASTER_H
diff --git a/irplib/irplib_oddeven.c b/irplib/irplib_oddeven.c
index ff1511e..66a78d7 100644
--- a/irplib/irplib_oddeven.c
+++ b/irplib/irplib_oddeven.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/01/12 11:50:41 $
  * $Revision: 1.9 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_oddeven.h b/irplib/irplib_oddeven.h
index 1eaac2a..66dadd4 100644
--- a/irplib/irplib_oddeven.h
+++ b/irplib/irplib_oddeven.h
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2006/10/06 20:46:04 $
  * $Revision: 1.4 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_ODDEVEN_H
diff --git a/irplib/irplib_plugin.c b/irplib/irplib_plugin.c
index 6151223..02cc7a5 100644
--- a/irplib/irplib_plugin.c
+++ b/irplib/irplib_plugin.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/02/03 14:19:06 $
  * $Revision: 1.39 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/irplib_plugin.h b/irplib/irplib_plugin.h
index a6de0bb..c1b9d1f 100644
--- a/irplib/irplib_plugin.h
+++ b/irplib/irplib_plugin.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/01/11 08:03:37 $
  * $Revision: 1.23 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_PLUGIN_H
diff --git a/irplib/irplib_polynomial.c b/irplib/irplib_polynomial.c
index c943d45..080891a 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.35 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_polynomial.h b/irplib/irplib_polynomial.h
index e9bd337..18bd147 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.10 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_POLYNOMIAL_H
diff --git a/irplib/irplib_ppm.c b/irplib/irplib_ppm.c
index 4a8892e..fcc9174 100644
--- a/irplib/irplib_ppm.c
+++ b/irplib/irplib_ppm.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/06/11 07:24:09 $
  * $Revision: 1.31 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_ppm.h b/irplib/irplib_ppm.h
index cfcfd6f..c827428 100644
--- a/irplib/irplib_ppm.h
+++ b/irplib/irplib_ppm.h
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2007/07/23 09:27:07 $
  * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_PPM_H
diff --git a/irplib/irplib_slitpos.c b/irplib/irplib_slitpos.c
index b4e4520..7b2de6c 100644
--- a/irplib/irplib_slitpos.c
+++ b/irplib/irplib_slitpos.c
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2011/11/23 13:58:45 $
  * $Revision: 1.30 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_slitpos.h b/irplib/irplib_slitpos.h
index c799285..f1bb944 100644
--- a/irplib/irplib_slitpos.h
+++ b/irplib/irplib_slitpos.h
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2006/11/29 13:22:59 $
  * $Revision: 1.6 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_SLITPOS_H
diff --git a/irplib/irplib_spectrum.c b/irplib/irplib_spectrum.c
index 7d01d72..ef3892a 100644
--- a/irplib/irplib_spectrum.c
+++ b/irplib/irplib_spectrum.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/01/12 11:50:41 $
  * $Revision: 1.29 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_spectrum.h b/irplib/irplib_spectrum.h
index 1b0d4e4..f1d55a4 100644
--- a/irplib/irplib_spectrum.h
+++ b/irplib/irplib_spectrum.h
@@ -22,7 +22,7 @@
  * $Author: yjung $
  * $Date: 2009/07/30 12:38:37 $
  * $Revision: 1.7 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_SPECTRUM_H
diff --git a/irplib/irplib_stdstar.c b/irplib/irplib_stdstar.c
index 29f49c3..736a656 100644
--- a/irplib/irplib_stdstar.c
+++ b/irplib/irplib_stdstar.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/05/04 13:58:12 $
  * $Revision: 1.41 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_stdstar.h b/irplib/irplib_stdstar.h
index b5a7f16..30342a6 100644
--- a/irplib/irplib_stdstar.h
+++ b/irplib/irplib_stdstar.h
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/12/14 08:53:04 $
  * $Revision: 1.15 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_STDSTAR_H
diff --git a/irplib/irplib_strehl.c b/irplib/irplib_strehl.c
index 8c60c32..175b3ac 100644
--- a/irplib/irplib_strehl.c
+++ b/irplib/irplib_strehl.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2009/11/18 21:37:48 $
  * $Revision: 1.43 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_strehl.h b/irplib/irplib_strehl.h
index b0b873b..2c4a0d6 100644
--- a/irplib/irplib_strehl.h
+++ b/irplib/irplib_strehl.h
@@ -22,7 +22,7 @@
  * $Author: kmirny $
  * $Date: 2009/06/29 14:32:53 $
  * $Revision: 1.12 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_STREHL_H
diff --git a/irplib/irplib_utils.c b/irplib/irplib_utils.c
index 9f2127a..47d9468 100644
--- a/irplib/irplib_utils.c
+++ b/irplib/irplib_utils.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/08/06 06:14:18 $
  * $Revision: 1.79 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_utils.h b/irplib/irplib_utils.h
index 40494d2..4a09acd 100644
--- a/irplib/irplib_utils.h
+++ b/irplib/irplib_utils.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/08/06 06:14:18 $
  * $Revision: 1.56 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  * $Log: irplib_utils.h,v $
  * Revision 1.56  2012/08/06 06:14:18  llundin
  * irplib_errorstate_warning(): Replaced by cpl_errorstate_dump_one_warning() from CPL 6.X
diff --git a/irplib/irplib_wavecal.c b/irplib/irplib_wavecal.c
index 1b4e191..9c3095d 100644
--- a/irplib/irplib_wavecal.c
+++ b/irplib/irplib_wavecal.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/08/03 21:05:32 $
  * $Revision: 1.52 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wavecal.h b/irplib/irplib_wavecal.h
index aa0fdbb..ddcdccd 100644
--- a/irplib/irplib_wavecal.h
+++ b/irplib/irplib_wavecal.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/08/03 21:05:33 $
  * $Revision: 1.18 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_WAVECAL_H
diff --git a/irplib/irplib_wavecal_impl.h b/irplib/irplib_wavecal_impl.h
index 1f16d0a..aa8f696 100644
--- a/irplib/irplib_wavecal_impl.h
+++ b/irplib/irplib_wavecal_impl.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2012/08/03 21:05:34 $
  * $Revision: 1.7 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_WAVECAL_IMPL_H
diff --git a/irplib/irplib_wcs.c b/irplib/irplib_wcs.c
index ad7652c..eabddbf 100644
--- a/irplib/irplib_wcs.c
+++ b/irplib/irplib_wcs.c
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2010/10/07 14:10:55 $
  * $Revision: 1.8 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wcs.h b/irplib/irplib_wcs.h
index 13bf7f5..c1dad08 100644
--- a/irplib/irplib_wcs.h
+++ b/irplib/irplib_wcs.h
@@ -22,7 +22,7 @@
  * $Author: llundin $
  * $Date: 2010/10/07 14:10:55 $
  * $Revision: 1.7 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_WCS_H
diff --git a/irplib/irplib_wlxcorr.c b/irplib/irplib_wlxcorr.c
index 0d22fe9..943d7a4 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.58 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wlxcorr.h b/irplib/irplib_wlxcorr.h
index 2d016d8..c2cf26b 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.22 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifndef IRPLIB_WLXCORR_H
diff --git a/irplib/tests/Makefile.am b/irplib/tests/Makefile.am
index 893d5b8..291c542 100644
--- a/irplib/tests/Makefile.am
+++ b/irplib/tests/Makefile.am
@@ -28,9 +28,9 @@ MAINTAINERCLEANFILES = Makefile.in
 
 endif
 
-INCLUDES = $(all_includes)
+AM_CPPFLAGS = $(all_includes)
 
-LDADD = $(LIBIRPLIB) 
+LDADD = $(LIBIRPLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 
 pkginclude_HEADERS =
 
@@ -65,12 +65,12 @@ irplib_wlxcorr_test_DEPENDENCIES = $(LIBIRPLIB)
 
 irplib_wcs_test_SOURCES = irplib_wcs-test.c
 irplib_wcs_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB)
+irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 irplib_wcs_test_LDFLAGS = $(WCSLIB_LDFLAGS)
 
 irplib_cat_test_SOURCES = irplib_cat-test.c
 irplib_cat_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB)
+irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 irplib_cat_test_LDFLAGS = $(WCSLIB_LDFLAGS)
 
 TESTS          = $(check_PROGRAMS)
@@ -79,7 +79,8 @@ TESTS          = $(check_PROGRAMS)
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
         CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
         LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
+        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
+        MALLOC_PERTURB_=137 MALLOC_CHECK_=2
 
 # We need to remove any files that the above tests created.
 clean-local: 
diff --git a/irplib/tests/Makefile.in b/irplib/tests/Makefile.in
index 10dc108..341ebd1 100644
--- a/irplib/tests/Makefile.in
+++ b/irplib/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +15,23 @@
 @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@
@@ -42,7 +58,8 @@ 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/gsl.m4 \
@@ -111,6 +128,11 @@ 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/||"`;; \
@@ -132,12 +154,20 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)"
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
+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@
@@ -307,8 +337,8 @@ wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = $(all_includes)
-LDADD = $(LIBIRPLIB) 
+AM_CPPFLAGS = $(all_includes)
+LDADD = $(LIBIRPLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 pkginclude_HEADERS = 
 noinst_HEADERS = 
 irplib_framelist_test_SOURCES = irplib_framelist-test.c
@@ -325,11 +355,11 @@ irplib_wlxcorr_test_SOURCES = irplib_wlxcorr-test.c
 irplib_wlxcorr_test_DEPENDENCIES = $(LIBIRPLIB)
 irplib_wcs_test_SOURCES = irplib_wcs-test.c
 irplib_wcs_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB)
+irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 irplib_wcs_test_LDFLAGS = $(WCSLIB_LDFLAGS)
 irplib_cat_test_SOURCES = irplib_cat-test.c
 irplib_cat_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB)
+irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 irplib_cat_test_LDFLAGS = $(WCSLIB_LDFLAGS)
 TESTS = $(check_PROGRAMS)
 
@@ -337,7 +367,8 @@ TESTS = $(check_PROGRAMS)
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
         CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
         LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
+        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
+        MALLOC_PERTURB_=137 MALLOC_CHECK_=2
 
 all: all-am
 
@@ -382,28 +413,28 @@ clean-checkPROGRAMS:
 	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) 
+irplib_cat-test$(EXEEXT): $(irplib_cat_test_OBJECTS) $(irplib_cat_test_DEPENDENCIES) $(EXTRA_irplib_cat_test_DEPENDENCIES) 
 	@rm -f irplib_cat-test$(EXEEXT)
 	$(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) 
+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_OBJECTS) $(irplib_framelist_test_LDADD) $(LIBS)
-irplib_hist-test$(EXEEXT): $(irplib_hist_test_OBJECTS) $(irplib_hist_test_DEPENDENCIES) 
+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_OBJECTS) $(irplib_hist_test_LDADD) $(LIBS)
-irplib_plugin-test$(EXEEXT): $(irplib_plugin_test_OBJECTS) $(irplib_plugin_test_DEPENDENCIES) 
+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_OBJECTS) $(irplib_plugin_test_LDADD) $(LIBS)
-irplib_polynomial-test$(EXEEXT): $(irplib_polynomial_test_OBJECTS) $(irplib_polynomial_test_DEPENDENCIES) 
+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_OBJECTS) $(irplib_polynomial_test_LDADD) $(LIBS)
-irplib_utils-test$(EXEEXT): $(irplib_utils_test_OBJECTS) $(irplib_utils_test_DEPENDENCIES) 
+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_OBJECTS) $(irplib_utils_test_LDADD) $(LIBS)
-irplib_wcs-test$(EXEEXT): $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_DEPENDENCIES) 
+irplib_wcs-test$(EXEEXT): $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_DEPENDENCIES) $(EXTRA_irplib_wcs_test_DEPENDENCIES) 
 	@rm -f irplib_wcs-test$(EXEEXT)
 	$(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) 
+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_OBJECTS) $(irplib_wlxcorr_test_LDADD) $(LIBS)
 
@@ -450,8 +481,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -465,9 +499,7 @@ uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -518,6 +550,20 @@ GTAGS:
 	  && $(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
 
@@ -531,7 +577,7 @@ check-TESTS: $(TESTS)
 	    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[\ \	]*) \
@@ -602,14 +648,15 @@ check-TESTS: $(TESTS)
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
 	  if test "$$failed" -eq 0; then \
-	    echo "$$grn$$dashes"; \
+	    col="$$grn"; \
 	  else \
-	    echo "$$red$$dashes"; \
+	    col="$$red"; \
 	  fi; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes$$std"; \
+	  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
 
@@ -662,10 +709,15 @@ 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:
@@ -754,7 +806,7 @@ uninstall-am: uninstall-pkgincludeHEADERS
 
 .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-dvi install-dvi-am install-exec \
diff --git a/irplib/tests/irplib_cat-test.c b/irplib/tests/irplib_cat-test.c
index b02d613..43992e4 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.10 $
+ * $Name: hawki-1_8_12 $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/tests/irplib_polynomial-test.c b/irplib/tests/irplib_polynomial-test.c
index 2e005ae..34667ed 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.35 2011/12/14 13:05:01 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: 2011/12/14 13:05:01 $
- * $Revision: 1.35 $
- * $Name: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.37 $
+ * $Name: hawki-1_8_12 $
  */
 
 /*-----------------------------------------------------------------------------
@@ -202,7 +202,7 @@ static void irplib_polynomial_solve_1d_all_test(void)
                                         DBL_EPSILON, 2.0*DBL_EPSILON);
 
         /* A more extreme case: Same with negative roots */
-        (void)cpl_vector_fill(xtrue, -2.0e-4 * FLT_EPSILON);
+        (void)cpl_vector_fill(xtrue, -2.0e-3 * FLT_EPSILON);
         (void)cpl_vector_set(xtrue, 0, -1.0);
 
         irplib_polynomial_test_root_all(xtrue, nreal, CPL_MATH_PI,
@@ -253,7 +253,7 @@ static void irplib_polynomial_solve_1d_all_test(void)
 
     cpl_vector_set_size(xtrue, nreal);
 
-    /* -2, epsilon, 1  */
+    /* -2, epsilon, 1.5  */
     (void)cpl_vector_set(xtrue, 0, -2.0);
     (void)cpl_vector_set(xtrue, 1,  2.0 * DBL_EPSILON);
     (void)cpl_vector_set(xtrue, 2,  1.5);
diff --git a/irplib/tests/irplib_wcs-test.c b/irplib/tests/irplib_wcs-test.c
index d376049..f9a7772 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.9 $
+ * $Name: hawki-1_8_12 $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/tests/irplib_wlxcorr-test.c b/irplib/tests/irplib_wlxcorr-test.c
index a9072bc..2c1271f 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: hawki-1_8_11 $
+ * $Author: jtaylor $
+ * $Date: 2013/01/29 08:43:33 $
+ * $Revision: 1.16 $
+ * $Name: hawki-1_8_12 $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/m4macros/cpl.m4 b/m4macros/cpl.m4
index e1a27c1..956b580 100644
--- a/m4macros/cpl.m4
+++ b/m4macros/cpl.m4
@@ -4,6 +4,7 @@
 AC_DEFUN([CPL_CHECK_CFITSIO],
 [
 
+	AC_REQUIRE([AC_SYS_LARGEFILE])
     AC_REQUIRE([ESO_CHECK_THREADS_POSIX])
         
     cpl_cfitsio_check_version="$1"
@@ -215,8 +216,6 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
         cpl_cfitsio_libs_save="$LIBS"
 
         CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
-        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm"
         
         AC_RUN_IFELSE([AC_LANG_PROGRAM(
                       [[
@@ -227,9 +226,8 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
                       int vlib = 0;
                       int vmin = (int)(1000. * $cpl_cfitsio_check_version + 0.5);
                        
-                      float v;
+                      float v = CFITSIO_VERSION;
 
-                      fits_get_version(&v);
                       vlib = (int)(v * 1000 + 0.5);
                                             
                       FILE* f = fopen("conftest.out", "w");
@@ -314,7 +312,8 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
 
         # Check whether cfitsio is thread-safe
         
-        AC_MSG_CHECKING([whether cfitsio requires libpthread])
+		AC_MSG_CHECKING([whether cfitsio was compiled with thread support])
+
         AC_LANG_PUSH(C)
         
         cpl_cfitsio_cflags_save="$CFLAGS"
@@ -324,91 +323,35 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
         CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
         LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
         LIBS="$LIBCFITSIO_STATIC -lm"
-        
-        
-        cpl_cfitsio_provides_pthread="no"
-        
-        AC_LINK_IFELSE([AC_LANG_PROGRAM(
-                       [[
-                       #include <fitsio.h>
-                       ]],
-                       [
-                       float v;
-                       fits_get_version(&v);
-                       ])],
-                       [cpl_cfitsio_requires_pthread="no"],
-                       [cpl_cfitsio_requires_pthread="undefined"])
 
-		if test x"$cpl_cfitsio_requires_pthread" = xno; then
-		
-	    	# If libpthread is not required this means either cfitsio is
-    		# not compiled with thread support, or the library dependencies
-    		# are compiled into cfitsio.
+        AC_RUN_IFELSE([AC_LANG_PROGRAM(
+                      [[
+                      #include <fitsio.h>
+                      ]],
+                      [
+                      if (fits_is_reentrant() == 0) {
+                          return 1;
+                      }
+
+                      return 0;
+                      ])],
+                      [cpl_cfitsio_is_thread_safe=yes],
+                      [cpl_cfitsio_is_thread_safe=no])
+
+		AC_MSG_RESULT([$cpl_cfitsio_is_thread_safe])
 
-			# Check whether shared library dependencies are present
-			# Don't use pthread_mutex_init/destroy here, since glibc
-			# provides these symbols too! Sigh!
-		
-	        AC_LINK_IFELSE([AC_LANG_PROGRAM(
-		                   [[
-	    	               #include <pthread.h>
-    	    	           #include <fitsio.h>
-        	    	       ]],
-            	    	   [                	       
-	                	   float v;
-    	            	   pthread_mutexattr_t attrb;
-    	            	   pthread_mutexattr_init(&attrb);
-            	           fits_get_version(&v);
-                		   pthread_mutexattr_destroy(&attrb);
-	                	   ])],
-	    	               [cpl_cfitsio_provides_pthread="yes"],
-    	    	           [cpl_cfitsio_provides_pthread="no"])
-            	           
-        else
-        
-            LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD"
-        
-            AC_LINK_IFELSE([AC_LANG_PROGRAM(
-                           [[
-                           #include <fitsio.h>
-                           ]],
-                           [
-                           float v;
-                           fits_get_version(&v);
-                           ])],
-                           [cpl_cfitsio_requires_pthread="yes"],
-                           AC_MSG_FAILURE([Cannot link with cfitsio! Please check!]))
-          
-        fi
-                       
-        AC_MSG_RESULT([$cpl_cfitsio_requires_pthread])
-        
         AC_LANG_POP(C)
         
         CFLAGS="$cpl_cfitsio_cflags_save"
         LDFLAGS="$cpl_cfitsio_ldflags_save"
         LIBS="$cpl_cfitsio_libs_save"
 
-
-		AC_MSG_CHECKING([whether cfitsio was compiled with thread support])
-		
-		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
-		
-		AC_MSG_RESULT([$cpl_cfitsio_is_thread_safe])
-		
 		
         # Set compiler flags and libraries
         
         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
                 AC_DEFINE([HAVE_FITS_GET_HDUOFF], [1],
                           [Define if you have the `fits_get_hduoff' function])
@@ -419,10 +362,6 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
                     
         fi
                 
-        if test x"$cpl_cfitsio_requires_pthread" = xyes; then
-            echo $LIBS | grep -q -e "$LIBPTHREAD" || LIBS="$LIBPTHREAD $LIBS"
-        fi
-        
     else
         AC_MSG_RESULT([disabled])
         AC_MSG_WARN([cfitsio checks have been disabled! This package may not build!])
@@ -431,11 +370,8 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
         LIBCFITSIO=""
         
         cpl_cfitsio_is_thread_safe="undefined"
-        cpl_cfitsio_requires_pthread="undefined"
     fi
 
-	AC_CACHE_VAL(cpl_cv_cfitsio_requires_pthread,
-	             cpl_cv_cfitsio_requires_pthread=$cpl_cfitsio_requires_pthread)
 	AC_CACHE_VAL(cpl_cv_cfitsio_is_thread_safe,
 	             cpl_cv_cfitsio_is_thread_safe=$cpl_cfitsio_is_thread_safe)
 	             
@@ -894,7 +830,7 @@ AC_DEFUN([CPL_CHECK_WCS],
 
 # CPL_CHECK_FFTW(version)
 #------------------------
-# Checks for the wcs library and header files.
+# Checks for the FFTW library and header files.
 AC_DEFUN([CPL_CHECK_FFTW],
 [
 
diff --git a/m4macros/eso.m4 b/m4macros/eso.m4
index 86e1839..7753b13 100644
--- a/m4macros/eso.m4
+++ b/m4macros/eso.m4
@@ -36,6 +36,46 @@ AC_DEFUN([ESO_PROG_CC_FLAG],
 ])
 
 
+# ESO_PROG_CC_ATTRIBUTE(VARIANT1, [VARIANT2], [CODE], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#----------------------------------------------------------------------------------------------
+AC_DEFUN([ESO_PROG_CC_ATTRIBUTE],
+[
+
+    AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
+                   AS_TR_SH([eso_cv_prog_cc_attribute_$1]),
+                   [
+                       eso_save_CFLAGS="$CFLAGS"
+                       CFLAGS="$CFLAGS"
+                   
+                       AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
+                                         [eval "AS_TR_SH([eso_cv_prog_cc_attribute_$1])='yes'"],
+                                         [eval "AS_TR_SH([eso_cv_prog_cc_attribute_$1])='no'"])
+                       CFLAGS="$eso_save_CFLAGS"
+                   ])
+                   
+    if eval "test x\$AS_TR_SH([eso_cv_prog_cc_attribute_$1]) = xyes"; then
+        :
+        $4
+    else
+        :
+        $5
+    fi
+               
+])
+
+
+# ESO_PROG_CC_ATTRIBUTE_VISIBILITY(ARG, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#--------------------------------------------------------------------------------
+AC_DEFUN([ESO_PROG_CC_ATTRIBUTE_VISIBILITY],
+[
+
+    ESO_PROG_CC_ATTRIBUTE([visibility_$1], [visibility("$1")],
+                          [void __attribute__((visibility("$1"))) $1_function() { }],
+                          [$2], [$3])
+
+])
+
+
 # ESO_ENABLE_DEBUG(debug=no)
 #---------------------------
 AC_DEFUN([ESO_ENABLE_DEBUG],
diff --git a/m4macros/libtool.m4 b/m4macros/libtool.m4
index 88de383..56666f0 100644
--- a/m4macros/libtool.m4
+++ b/m4macros/libtool.m4
@@ -1,8 +1,8 @@
 # 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 Free Software Foundation,
-#                 Inc.
+#                 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
@@ -11,8 +11,8 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -146,6 +146,8 @@ 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
@@ -637,7 +639,7 @@ 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) 2010 Free Software Foundation, Inc.
+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."
 
@@ -801,6 +803,7 @@ AC_DEFUN([LT_LANG],
 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)],
@@ -822,6 +825,31 @@ m4_defun([_LT_LANG],
 ])# _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],
@@ -852,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_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)])])
@@ -954,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# 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
@@ -962,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	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
@@ -973,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	[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
@@ -990,7 +1030,9 @@ _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 -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      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
@@ -1035,8 +1077,8 @@ _LT_EOF
 ])
 
 
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
 # Checks for linker and compiler features on darwin
 m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
@@ -1047,6 +1089,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _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
@@ -1330,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*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" ;;
+      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"
@@ -1414,13 +1471,13 @@ 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 -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -1600,6 +1657,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     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
@@ -1639,7 +1701,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      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
@@ -2185,7 +2247,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  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
 
@@ -2194,7 +2256,7 @@ aix3*)
   ;;
 
 aix[[4-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -2259,7 +2321,7 @@ beos*)
   ;;
 
 bsdi[[45]]*)
-  version_type=linux
+  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'
@@ -2398,7 +2460,7 @@ m4_if([$1], [],[
   ;;
 
 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'
@@ -2406,10 +2468,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -2417,7 +2475,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
+    freebsd[[23]].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -2435,7 +2493,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2455,17 +2513,18 @@ 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
+  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"
@@ -2526,7 +2585,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[[3-9]]*)
-  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}'
@@ -2542,7 +2601,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 ;;
@@ -2579,9 +2638,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-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}'
@@ -2648,7 +2707,7 @@ 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
@@ -2717,7 +2776,7 @@ rdos*)
   ;;
 
 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}'
@@ -2742,7 +2801,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
@@ -2766,7 +2825,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
@@ -2797,7 +2856,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  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}'
@@ -2807,7 +2866,7 @@ tpf*)
   ;;
 
 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
@@ -3229,7 +3288,7 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3649,6 +3708,7 @@ for ac_symprfx in "" "_"; do
     # 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};"\
@@ -4233,7 +4293,9 @@ m4_if([$1], [CXX], [
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      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
@@ -4325,18 +4387,33 @@ m4_if([$1], [CXX], [
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ F* | *Sun*Fortran*)
+	*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
@@ -4496,7 +4573,9 @@ m4_if([$1], [CXX], [
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
-    cl*) ;;
+    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']
@@ -4521,7 +4600,6 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4772,8 +4850,7 @@ _LT_EOF
 	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)=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _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~
@@ -5068,6 +5145,7 @@ _LT_EOF
 	# 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'
@@ -5114,10 +5192,6 @@ _LT_EOF
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    freebsd1*)
-      _LT_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
@@ -5130,7 +5204,7 @@ _LT_EOF
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    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
@@ -5169,7 +5243,6 @@ _LT_EOF
       fi
       if test "$with_gnu_ld" = no; then
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -5611,9 +5684,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
 _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_flag_spec_ld], [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]])
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
@@ -5771,7 +5841,6 @@ _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_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -6141,7 +6210,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         esac
         ;;
 
-      freebsd[[12]]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6902,12 +6971,18 @@ public class foo {
   }
 };
 _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
@@ -7104,7 +7179,6 @@ _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_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7237,7 +7311,6 @@ _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_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7424,6 +7497,77 @@ 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
@@ -7493,6 +7637,13 @@ 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],
diff --git a/m4macros/ltoptions.m4 b/m4macros/ltoptions.m4
index 17cfd51..5d9acd8 100644
--- a/m4macros/ltoptions.m4
+++ b/m4macros/ltoptions.m4
@@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 # 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],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
 	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
+    [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])
diff --git a/m4macros/ltversion.m4 b/m4macros/ltversion.m4
index 9c7b5d4..07a8602 100644
--- a/m4macros/ltversion.m4
+++ b/m4macros/ltversion.m4
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3293 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3293])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4'
-macro_revision='1.3293'
+[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/openmp.m4 b/m4macros/openmp.m4
index 22e8006..85d3c66 100644
--- a/m4macros/openmp.m4
+++ b/m4macros/openmp.m4
@@ -15,24 +15,31 @@
 #   In addition, the command line option to disable OpenMP support has been
 #   remove, so that the macro just reports the results, which can be used
 #   by a calling custom macro.  
-# 
-
+#
+ 
 # _CPL_LANG_OPENMP
 # ---------------
 # Expands to some language dependent source code for testing the presence of
 # OpenMP.
 AC_DEFUN([_CPL_LANG_OPENMP],
-[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+[AC_LANG_SOURCE([_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])])
 
 # _CPL_LANG_OPENMP(C)
 # ------------------
+# This tries to see if linking properly resolves omp_get_num_threads() object.
+# It also checks that the #pragma omp threadprivate directive is supported,
+# since some combinations of compiler/OS do not support it (e.g. gcc/OSX).
 m4_define([_CPL_LANG_OPENMP(C)],
 [
 #ifndef _OPENMP
  choke me
 #endif
 #include <omp.h>
-int main () { return omp_get_num_threads (); }
+int var;
+#pragma omp threadprivate(var)
+int main () { 
+return omp_get_num_threads (); 
+}
 ])
 
 # _CPL_LANG_OPENMP(C++)
@@ -42,14 +49,21 @@ m4_copy([_CPL_LANG_OPENMP(C)], [_CPL_LANG_OPENMP(C++)])
 # _CPL_LANG_OPENMP(Fortran 77)
 # ---------------------------
 m4_define([_CPL_LANG_OPENMP(Fortran 77)],
-[AC_LANG_FUNC_LINK_TRY([omp_get_num_threads])])
+[
+      program main
+      implicit none
+!$    integer tid
+      tid = 42
+      call omp_set_num_threads(2)
+      end
+])
 
 # _CPL_LANG_OPENMP(Fortran)
-# ---------------------------
+# -------------------------
 m4_copy([_CPL_LANG_OPENMP(Fortran 77)], [_CPL_LANG_OPENMP(Fortran)])
 
 # CPL_OPENMP
-# ---------
+# ----------
 # Check which options need to be passed to the C compiler to support OpenMP.
 # Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these
 # options.
@@ -77,12 +91,16 @@ AC_DEFUN([CPL_OPENMP],
 	dnl   SGI C, PGI C         -mp
 	dnl   Tru64 Compaq C       -omp
 	dnl   IBM C (AIX, Linux)   -qsmp=omp
+    dnl   Cray CCE             -homp
+    dnl   NEC SX               -Popenmp
+    dnl   Lahey Fortran (Linux)  --openmp
 	dnl If in this loop a compiler is passed an option that it doesn't
 	dnl understand or that it misinterprets, the AC_LINK_IFELSE test
 	dnl will fail (since we know that it failed without the option),
 	dnl therefore the loop will continue searching for an option, and
 	dnl no output file called 'penmp' or 'mp' is created.
-	for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
+	for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \
+                     -Popenmp --openmp; do
 	  ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
 	  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option"
 	  AC_LINK_IFELSE([_CPL_LANG_OPENMP],
@@ -91,12 +109,12 @@ AC_DEFUN([CPL_OPENMP],
 	  if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then
 	    break
 	  fi
-	  done])])
+    done])])
   case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #(
   "none needed" | unsupported)
-	;; #(
+    ;; #(
   *)
-	OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;;
+    OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;;
   esac
   dnl fi
   AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS])
diff --git a/recipes/Makefile.am b/recipes/Makefile.am
index 044e590..ccbcff0 100644
--- a/recipes/Makefile.am
+++ b/recipes/Makefile.am
@@ -29,7 +29,7 @@ MAINTAINERCLEANFILES = Makefile.in
 endif
 
 
-INCLUDES = $(all_includes)
+AM_CPPFLAGS = $(all_includes)
 
 noinst_HEADERS = 
 
diff --git a/recipes/Makefile.in b/recipes/Makefile.in
index 2b4f62e..5f98a45 100644
--- a/recipes/Makefile.in
+++ b/recipes/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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.
@@ -17,6 +16,23 @@
 
 
 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@
@@ -38,7 +54,7 @@ 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/gsl.m4 \
@@ -77,6 +93,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)"
 LTLIBRARIES = $(plugin_LTLIBRARIES)
 am__DEPENDENCIES_1 =
@@ -246,6 +268,11 @@ DIST_SOURCES = $(hawki_cal_dark_la_SOURCES) \
 	$(hawki_util_extinction_la_SOURCES) \
 	$(hawki_util_gendist_la_SOURCES) \
 	$(hawki_util_stdstars_la_SOURCES)
+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)
 ETAGS = etags
 CTAGS = ctags
@@ -418,7 +445,7 @@ wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = $(all_includes)
+AM_CPPFLAGS = $(all_includes)
 noinst_HEADERS = 
 plugin_LTLIBRARIES = hawki_cal_dark.la \
                         hawki_cal_flat.la \
@@ -552,7 +579,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
 	@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -560,6 +586,8 @@ install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
 	  else :; fi; \
 	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)"; \
 	}
@@ -575,49 +603,51 @@ uninstall-pluginLTLIBRARIES:
 
 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
-hawki_cal_dark.la: $(hawki_cal_dark_la_OBJECTS) $(hawki_cal_dark_la_DEPENDENCIES) 
+	@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}; \
+	}
+hawki_cal_dark.la: $(hawki_cal_dark_la_OBJECTS) $(hawki_cal_dark_la_DEPENDENCIES) $(EXTRA_hawki_cal_dark_la_DEPENDENCIES) 
 	$(hawki_cal_dark_la_LINK) -rpath $(plugindir) $(hawki_cal_dark_la_OBJECTS) $(hawki_cal_dark_la_LIBADD) $(LIBS)
-hawki_cal_distortion.la: $(hawki_cal_distortion_la_OBJECTS) $(hawki_cal_distortion_la_DEPENDENCIES) 
+hawki_cal_distortion.la: $(hawki_cal_distortion_la_OBJECTS) $(hawki_cal_distortion_la_DEPENDENCIES) $(EXTRA_hawki_cal_distortion_la_DEPENDENCIES) 
 	$(hawki_cal_distortion_la_LINK) -rpath $(plugindir) $(hawki_cal_distortion_la_OBJECTS) $(hawki_cal_distortion_la_LIBADD) $(LIBS)
-hawki_cal_flat.la: $(hawki_cal_flat_la_OBJECTS) $(hawki_cal_flat_la_DEPENDENCIES) 
+hawki_cal_flat.la: $(hawki_cal_flat_la_OBJECTS) $(hawki_cal_flat_la_DEPENDENCIES) $(EXTRA_hawki_cal_flat_la_DEPENDENCIES) 
 	$(hawki_cal_flat_la_LINK) -rpath $(plugindir) $(hawki_cal_flat_la_OBJECTS) $(hawki_cal_flat_la_LIBADD) $(LIBS)
-hawki_cal_zpoint.la: $(hawki_cal_zpoint_la_OBJECTS) $(hawki_cal_zpoint_la_DEPENDENCIES) 
+hawki_cal_zpoint.la: $(hawki_cal_zpoint_la_OBJECTS) $(hawki_cal_zpoint_la_DEPENDENCIES) $(EXTRA_hawki_cal_zpoint_la_DEPENDENCIES) 
 	$(hawki_cal_zpoint_la_LINK) -rpath $(plugindir) $(hawki_cal_zpoint_la_OBJECTS) $(hawki_cal_zpoint_la_LIBADD) $(LIBS)
-hawki_sci_jitter.la: $(hawki_sci_jitter_la_OBJECTS) $(hawki_sci_jitter_la_DEPENDENCIES) 
+hawki_sci_jitter.la: $(hawki_sci_jitter_la_OBJECTS) $(hawki_sci_jitter_la_DEPENDENCIES) $(EXTRA_hawki_sci_jitter_la_DEPENDENCIES) 
 	$(hawki_sci_jitter_la_LINK) -rpath $(plugindir) $(hawki_sci_jitter_la_OBJECTS) $(hawki_sci_jitter_la_LIBADD) $(LIBS)
-hawki_step_apply_dist.la: $(hawki_step_apply_dist_la_OBJECTS) $(hawki_step_apply_dist_la_DEPENDENCIES) 
+hawki_step_apply_dist.la: $(hawki_step_apply_dist_la_OBJECTS) $(hawki_step_apply_dist_la_DEPENDENCIES) $(EXTRA_hawki_step_apply_dist_la_DEPENDENCIES) 
 	$(hawki_step_apply_dist_la_LINK) -rpath $(plugindir) $(hawki_step_apply_dist_la_OBJECTS) $(hawki_step_apply_dist_la_LIBADD) $(LIBS)
-hawki_step_basic_calib.la: $(hawki_step_basic_calib_la_OBJECTS) $(hawki_step_basic_calib_la_DEPENDENCIES) 
+hawki_step_basic_calib.la: $(hawki_step_basic_calib_la_OBJECTS) $(hawki_step_basic_calib_la_DEPENDENCIES) $(EXTRA_hawki_step_basic_calib_la_DEPENDENCIES) 
 	$(hawki_step_basic_calib_la_LINK) -rpath $(plugindir) $(hawki_step_basic_calib_la_OBJECTS) $(hawki_step_basic_calib_la_LIBADD) $(LIBS)
-hawki_step_combine.la: $(hawki_step_combine_la_OBJECTS) $(hawki_step_combine_la_DEPENDENCIES) 
+hawki_step_combine.la: $(hawki_step_combine_la_OBJECTS) $(hawki_step_combine_la_DEPENDENCIES) $(EXTRA_hawki_step_combine_la_DEPENDENCIES) 
 	$(hawki_step_combine_la_LINK) -rpath $(plugindir) $(hawki_step_combine_la_OBJECTS) $(hawki_step_combine_la_LIBADD) $(LIBS)
-hawki_step_compute_bkg.la: $(hawki_step_compute_bkg_la_OBJECTS) $(hawki_step_compute_bkg_la_DEPENDENCIES) 
+hawki_step_compute_bkg.la: $(hawki_step_compute_bkg_la_OBJECTS) $(hawki_step_compute_bkg_la_DEPENDENCIES) $(EXTRA_hawki_step_compute_bkg_la_DEPENDENCIES) 
 	$(hawki_step_compute_bkg_la_LINK) -rpath $(plugindir) $(hawki_step_compute_bkg_la_OBJECTS) $(hawki_step_compute_bkg_la_LIBADD) $(LIBS)
-hawki_step_detect_obj.la: $(hawki_step_detect_obj_la_OBJECTS) $(hawki_step_detect_obj_la_DEPENDENCIES) 
+hawki_step_detect_obj.la: $(hawki_step_detect_obj_la_OBJECTS) $(hawki_step_detect_obj_la_DEPENDENCIES) $(EXTRA_hawki_step_detect_obj_la_DEPENDENCIES) 
 	$(hawki_step_detect_obj_la_LINK) -rpath $(plugindir) $(hawki_step_detect_obj_la_OBJECTS) $(hawki_step_detect_obj_la_LIBADD) $(LIBS)
-hawki_step_photom_2mass.la: $(hawki_step_photom_2mass_la_OBJECTS) $(hawki_step_photom_2mass_la_DEPENDENCIES) 
+hawki_step_photom_2mass.la: $(hawki_step_photom_2mass_la_OBJECTS) $(hawki_step_photom_2mass_la_DEPENDENCIES) $(EXTRA_hawki_step_photom_2mass_la_DEPENDENCIES) 
 	$(hawki_step_photom_2mass_la_LINK) -rpath $(plugindir) $(hawki_step_photom_2mass_la_OBJECTS) $(hawki_step_photom_2mass_la_LIBADD) $(LIBS)
-hawki_step_refine_offsets.la: $(hawki_step_refine_offsets_la_OBJECTS) $(hawki_step_refine_offsets_la_DEPENDENCIES) 
+hawki_step_refine_offsets.la: $(hawki_step_refine_offsets_la_OBJECTS) $(hawki_step_refine_offsets_la_DEPENDENCIES) $(EXTRA_hawki_step_refine_offsets_la_DEPENDENCIES) 
 	$(hawki_step_refine_offsets_la_LINK) -rpath $(plugindir) $(hawki_step_refine_offsets_la_OBJECTS) $(hawki_step_refine_offsets_la_LIBADD) $(LIBS)
-hawki_step_stats.la: $(hawki_step_stats_la_OBJECTS) $(hawki_step_stats_la_DEPENDENCIES) 
+hawki_step_stats.la: $(hawki_step_stats_la_OBJECTS) $(hawki_step_stats_la_DEPENDENCIES) $(EXTRA_hawki_step_stats_la_DEPENDENCIES) 
 	$(hawki_step_stats_la_LINK) -rpath $(plugindir) $(hawki_step_stats_la_OBJECTS) $(hawki_step_stats_la_LIBADD) $(LIBS)
-hawki_step_stitch.la: $(hawki_step_stitch_la_OBJECTS) $(hawki_step_stitch_la_DEPENDENCIES) 
+hawki_step_stitch.la: $(hawki_step_stitch_la_OBJECTS) $(hawki_step_stitch_la_DEPENDENCIES) $(EXTRA_hawki_step_stitch_la_DEPENDENCIES) 
 	$(hawki_step_stitch_la_LINK) -rpath $(plugindir) $(hawki_step_stitch_la_OBJECTS) $(hawki_step_stitch_la_LIBADD) $(LIBS)
-hawki_step_subtract_bkg.la: $(hawki_step_subtract_bkg_la_OBJECTS) $(hawki_step_subtract_bkg_la_DEPENDENCIES) 
+hawki_step_subtract_bkg.la: $(hawki_step_subtract_bkg_la_OBJECTS) $(hawki_step_subtract_bkg_la_DEPENDENCIES) $(EXTRA_hawki_step_subtract_bkg_la_DEPENDENCIES) 
 	$(hawki_step_subtract_bkg_la_LINK) -rpath $(plugindir) $(hawki_step_subtract_bkg_la_OBJECTS) $(hawki_step_subtract_bkg_la_LIBADD) $(LIBS)
-hawki_tec_filtchk.la: $(hawki_tec_filtchk_la_OBJECTS) $(hawki_tec_filtchk_la_DEPENDENCIES) 
+hawki_tec_filtchk.la: $(hawki_tec_filtchk_la_OBJECTS) $(hawki_tec_filtchk_la_DEPENDENCIES) $(EXTRA_hawki_tec_filtchk_la_DEPENDENCIES) 
 	$(hawki_tec_filtchk_la_LINK) -rpath $(plugindir) $(hawki_tec_filtchk_la_OBJECTS) $(hawki_tec_filtchk_la_LIBADD) $(LIBS)
-hawki_util_extinction.la: $(hawki_util_extinction_la_OBJECTS) $(hawki_util_extinction_la_DEPENDENCIES) 
+hawki_util_extinction.la: $(hawki_util_extinction_la_OBJECTS) $(hawki_util_extinction_la_DEPENDENCIES) $(EXTRA_hawki_util_extinction_la_DEPENDENCIES) 
 	$(hawki_util_extinction_la_LINK) -rpath $(plugindir) $(hawki_util_extinction_la_OBJECTS) $(hawki_util_extinction_la_LIBADD) $(LIBS)
-hawki_util_gendist.la: $(hawki_util_gendist_la_OBJECTS) $(hawki_util_gendist_la_DEPENDENCIES) 
+hawki_util_gendist.la: $(hawki_util_gendist_la_OBJECTS) $(hawki_util_gendist_la_DEPENDENCIES) $(EXTRA_hawki_util_gendist_la_DEPENDENCIES) 
 	$(hawki_util_gendist_la_LINK) -rpath $(plugindir) $(hawki_util_gendist_la_OBJECTS) $(hawki_util_gendist_la_LIBADD) $(LIBS)
-hawki_util_stdstars.la: $(hawki_util_stdstars_la_OBJECTS) $(hawki_util_stdstars_la_DEPENDENCIES) 
+hawki_util_stdstars.la: $(hawki_util_stdstars_la_OBJECTS) $(hawki_util_stdstars_la_DEPENDENCIES) $(EXTRA_hawki_util_stdstars_la_DEPENDENCIES) 
 	$(hawki_util_stdstars_la_LINK) -rpath $(plugindir) $(hawki_util_stdstars_la_OBJECTS) $(hawki_util_stdstars_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -743,6 +773,20 @@ GTAGS:
 	  && $(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
 
@@ -793,10 +837,15 @@ 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:
@@ -884,18 +933,19 @@ uninstall-am: uninstall-pluginLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pluginLTLIBRARIES 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-pluginLTLIBRARIES \
-	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-pluginLTLIBRARIES
+	clean-libtool clean-pluginLTLIBRARIES 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-pluginLTLIBRARIES 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-pluginLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/recipes/hawki_cal_dark.c b/recipes/hawki_cal_dark.c
index a28619a..8334a62 100644
--- a/recipes/hawki_cal_dark.c
+++ b/recipes/hawki_cal_dark.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/02/16 16:33:21 $
  * $Revision: 1.21 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_cal_distortion.c b/recipes/hawki_cal_distortion.c
index 3379150..ed3bb27 100644
--- a/recipes/hawki_cal_distortion.c
+++ b/recipes/hawki_cal_distortion.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_cal_distortion.c,v 1.14 2012/04/23 10:02:57 cgarcia Exp $
+/* $Id: hawki_cal_distortion.c,v 1.17 2013/02/01 17:18:05 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/04/23 10:02:57 $
- * $Revision: 1.14 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/02/01 17:18:05 $
+ * $Revision: 1.17 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -56,6 +56,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_cal_distortion_create(cpl_plugin *) ;
 static int hawki_cal_distortion_exec(cpl_plugin *) ;
 static int hawki_cal_distortion_destroy(cpl_plugin *) ;
@@ -533,7 +538,7 @@ static int hawki_cal_distortion_load_master_calib
     if(flat != NULL)
     {
         *flat_images = hawki_load_frame(flat, CPL_TYPE_FLOAT);
-        if(flat_images == NULL)
+        if(*flat_images == NULL)
         {
             cpl_msg_error(__func__, "Error reading flat") ;
             return -1;
@@ -542,7 +547,7 @@ static int hawki_cal_distortion_load_master_calib
     if(dark != NULL)
     {
         *dark_images = hawki_load_frame(dark, CPL_TYPE_FLOAT);
-        if(dark_images == NULL)
+        if(*dark_images == NULL)
         {
             cpl_msg_error(__func__, "Error reading dark") ;
             cpl_imagelist_delete(*flat_images);
@@ -552,7 +557,7 @@ static int hawki_cal_distortion_load_master_calib
     if(bpm != NULL)
     {
         *bpm_images = hawki_load_frame(bpm, CPL_TYPE_INT);
-        if(bpm_images == NULL)
+        if(*bpm_images == NULL)
         {
             cpl_msg_error(__func__, "Error reading bpm") ;
             cpl_imagelist_delete(*flat_images);
@@ -634,6 +639,9 @@ static int hawki_cal_distortion_get_apertures_from_raw_distor
     {
         cpl_imagelist * distor_serie;
         cpl_imagelist * distor_serie_trimmed;
+        cpl_image     * flat_det = NULL;
+        cpl_image     * dark_det = NULL;
+        cpl_image     * bpm_det  = NULL;
         
         cpl_msg_info(__func__, "Working on detector %d", idet + 1);
         cpl_msg_indent_more();
@@ -647,14 +655,22 @@ static int hawki_cal_distortion_get_apertures_from_raw_distor
             return -1;
         } 
 
+        /* Getting the calibs */
+        if(flat_images != NULL)
+            flat_det = cpl_imagelist_get(flat_images, idet);
+        if(dark_images != NULL)
+            dark_det = cpl_imagelist_get(dark_images, idet);
+        if(bpm_images != NULL)
+            bpm_det = cpl_imagelist_get(bpm_images, idet);
+        
+        if(!cpl_errorstate_is_equal(error_prevstate ))
+            cpl_msg_warning(cpl_func,"PPPPPP5");
+        
         /* Applying the calibrations */
         cpl_msg_info(__func__, "Applying basic calibration") ;
         cpl_msg_indent_more();
         if (hawki_flat_dark_bpm_detector_calib
-                (distor_serie,
-                 cpl_imagelist_get(flat_images, idet),
-                 cpl_imagelist_get(dark_images, idet),
-                 cpl_imagelist_get(bpm_images, idet)) == -1)
+                (distor_serie, flat_det, dark_det, bpm_det) == -1)
         {
             cpl_msg_error(__func__, "Cannot calibrate frame") ;
             cpl_imagelist_delete(flat_images);
@@ -711,7 +727,7 @@ static int hawki_cal_distortion_get_apertures_from_raw_distor
     
     if(!cpl_errorstate_is_equal(error_prevstate ))
     {
-        cpl_msg_error(__func__, "A problem happened with basic calibration");
+        cpl_msg_error(__func__, "A problem happened detecting objects");
         return -1 ;
     }
     return 0;
@@ -765,6 +781,9 @@ static cpl_image **  hawki_cal_distortion_get_master_sky
     {
         cpl_imagelist * sky_serie;
         cpl_imagelist * sky_serie_trimmed;
+        cpl_image     * flat_det = NULL;
+        cpl_image     * dark_det = NULL;
+        cpl_image     * bpm_det  = NULL;
         
         /* Loading the sky images for one detector */
         sky_serie = hawki_load_detector(raw_sky_frames, idet + 1, CPL_TYPE_FLOAT);
@@ -774,14 +793,19 @@ static cpl_image **  hawki_cal_distortion_get_master_sky
             return NULL;
         }
 
+        /* Getting the calibs */
+        if(flat_images != NULL)
+            flat_det = cpl_imagelist_get(flat_images, idet);
+        if(dark_images != NULL)
+            dark_det = cpl_imagelist_get(dark_images, idet);
+        if(bpm_images != NULL)
+            bpm_det = cpl_imagelist_get(bpm_images, idet);
+        
         /* Applying the calibrations */
         cpl_msg_info(__func__, "Working on detector %d", idet + 1);
         cpl_msg_indent_more();
         if (hawki_flat_dark_bpm_detector_calib
-                (sky_serie,
-                 cpl_imagelist_get(flat_images, idet),
-                 cpl_imagelist_get(dark_images, idet),
-                 cpl_imagelist_get(bpm_images, idet)) == -1)
+                (sky_serie, flat_det, dark_det, bpm_det) == -1)
         {
             cpl_msg_error(__func__, "Cannot calibrate frame") ;
             cpl_imagelist_delete(flat_images);
diff --git a/recipes/hawki_cal_flat.c b/recipes/hawki_cal_flat.c
index 8fe9aa6..0ecdbed 100644
--- a/recipes/hawki_cal_flat.c
+++ b/recipes/hawki_cal_flat.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/01/11 15:02:18 $
  * $Revision: 1.25 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_cal_zpoint.c b/recipes/hawki_cal_zpoint.c
index de073d5..dc1fbb1 100644
--- a/recipes/hawki_cal_zpoint.c
+++ b/recipes/hawki_cal_zpoint.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_cal_zpoint.c,v 1.34 2012/04/23 09:58:56 cgarcia Exp $
+/* $Id: hawki_cal_zpoint.c,v 1.36 2013/02/01 16:51:43 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/04/23 09:58:56 $
- * $Revision: 1.34 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/02/01 16:51:43 $
+ * $Revision: 1.36 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -57,6 +57,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_cal_zpoint_create(cpl_plugin *) ;
 static int hawki_cal_zpoint_exec(cpl_plugin *) ;
 static int hawki_cal_zpoint_destroy(cpl_plugin *) ;
@@ -1311,9 +1316,9 @@ static int hawki_cal_zpoint_get_mag(
             star_ind, NULL);
     
     /* Store results */
-    strcpy(hawki_cal_zpoint_outputs.starname, star_name) ;
-    strcpy(hawki_cal_zpoint_outputs.sptype, star_type) ;
-    strcpy(hawki_cal_zpoint_outputs.catalog, used_catname);
+    strncpy(hawki_cal_zpoint_outputs.starname, star_name, 510);
+    strncpy(hawki_cal_zpoint_outputs.sptype, star_type, 510);
+    strncpy(hawki_cal_zpoint_outputs.catalog, used_catname, 510);
     hawki_cal_zpoint_outputs.stdstar_ra = stdstar_ra;
     hawki_cal_zpoint_outputs.stdstar_dec = stdstar_dec;
     if(mag_invalid == 0)
@@ -1630,7 +1635,7 @@ static int hawki_cal_zpoint_compute_qc
             cpl_propertylist_append_double(qcextparams[idet], "ESO QC ZPOINT PEAK",
                                            hawki_cal_zpoint_outputs.peak[idet]) ;
             cpl_propertylist_set_comment(qcextparams[idet], "ESO QC ZPOINT PEAK",
-                                         "Peak of the standard starr [ADU]");
+                                         "Peak of the standard star [ADU]");
             cpl_propertylist_append_double(qcextparams[idet], "ESO QC ZPOINT BGD",
                                            hawki_cal_zpoint_outputs.bgd[idet]) ;
             cpl_propertylist_set_comment(qcextparams[idet], "ESO QC ZPOINT BGD",
diff --git a/recipes/hawki_sci_jitter.c b/recipes/hawki_sci_jitter.c
index ca9cedd..e7c649f 100644
--- a/recipes/hawki_sci_jitter.c
+++ b/recipes/hawki_sci_jitter.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_sci_jitter.c,v 1.31 2012/12/04 09:41:34 cgarcia Exp $
+/* $Id: hawki_sci_jitter.c,v 1.34 2013/01/15 09:58:25 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/12/04 09:41:34 $
- * $Revision: 1.31 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/15 09:58:25 $
+ * $Revision: 1.34 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -821,6 +821,16 @@ static cpl_image ** hawki_sci_jitter_reduce
         return NULL;        
     }
     
+    /* Check that pointing is the same for all the frames */
+    if(!hawki_utils_check_equal_double_keys(jitters, &hawki_pfits_get_targ_alpha_hhmmss) ||
+       !hawki_utils_check_equal_double_keys(jitters, &hawki_pfits_get_targ_delta_ddmmss))
+    {
+        cpl_msg_error(__func__, "Not all input science frames belong to the "
+                "same pointing/target. Check keywords TEL TARG ALPHA/DELTA");
+        cpl_msg_indent_less() ;
+        return NULL;        
+    }
+    
     /* Get the offsets */
     if ((offsets = hawki_get_header_tel_offsets(jitters)) == NULL) {
         cpl_msg_error(cpl_func, "Cannot load the offsets") ;
@@ -1936,10 +1946,14 @@ static int hawki_sci_jitter_save
             (qclists[i], "ESO QC IQ DIFF AMBI",
              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double
                  (telstats, "ESO QC TEL AMBI FWHM MEAN"));
+        cpl_propertylist_set_comment(qclists[i], "ESO QC IQ DIFF AMBI",
+                           "Mean Observatory seeing measured by AS");
         cpl_propertylist_append_double
             (qclists[i], "ESO QC IQ DIFF TEL",
              hawki_sci_jitter_output.iq[i] - cpl_propertylist_get_double
                  (telstats, "ESO QC TEL IA FWHM MEAN"));
+        cpl_propertylist_set_comment(qclists[i], "ESO QC IQ DIFF TEL",
+                "Mean Observatory seeing measured by AS corrected by airmass");
         cpl_propertylist_append_double
             (qclists[i], "ESO QC FWHM PIX",
              hawki_sci_jitter_output.fwhm_pix[i]);
diff --git a/recipes/hawki_step_apply_dist.c b/recipes/hawki_step_apply_dist.c
index 148738e..f06add9 100644
--- a/recipes/hawki_step_apply_dist.c
+++ b/recipes/hawki_step_apply_dist.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/03/09 10:48:38 $
  * $Revision: 1.10 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_step_basic_calib.c b/recipes/hawki_step_basic_calib.c
index dc9be2b..ec61a0f 100644
--- a/recipes/hawki_step_basic_calib.c
+++ b/recipes/hawki_step_basic_calib.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/01/31 11:03:23 $
  * $Revision: 1.13 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_step_combine.c b/recipes/hawki_step_combine.c
index 25c1879..d54a037 100644
--- a/recipes/hawki_step_combine.c
+++ b/recipes/hawki_step_combine.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_step_combine.c,v 1.25 2012/11/30 14:50:51 cgarcia Exp $
+/* $Id: hawki_step_combine.c,v 1.26 2013/01/14 15:18:44 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/11/30 14:50:51 $
- * $Revision: 1.25 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/14 15:18:44 $
+ * $Revision: 1.26 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -342,19 +342,28 @@ static int hawki_step_combine(
             return -1 ;
         }
     }
+    /* Check that pointing is the same for all the frames */
+    if(!hawki_utils_check_equal_double_keys(objframes, &hawki_pfits_get_targ_alpha) ||
+       !hawki_utils_check_equal_double_keys(objframes, &hawki_pfits_get_targ_delta))
+    {
+        cpl_msg_error(__func__, "Not all input science frames belong to the "
+                "same pointing/target. Check keywords TEL TARG ALPHA/DELTA");
+        cpl_frameset_delete(objframes);
+        return -1;        
+    }
     used_frames = cpl_frameset_duplicate(objframes);
     
     /* Retrieve the refined offsets, if provided */
     offsets = hawki_extract_frameset(framelist, HAWKI_CALPRO_OFFSETS);
     if(offsets)
         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-                cpl_frameset_get_first(offsets)));
+                cpl_frameset_get_position(offsets, 0)));
     
     /* Retrieve the general bad pixel mask, if provided */
     bpm = hawki_extract_frameset(framelist, HAWKI_CALPRO_BPM);
     if(bpm)
         cpl_frameset_insert(used_frames, cpl_frame_duplicate(
-                cpl_frameset_get_first(bpm)));
+                cpl_frameset_get_position(bpm, 0)));
 
     /* Retrieve the background bad pixel masks, if provided */
     bpmbkg = hawki_extract_frameset(framelist, HAWKI_CALPRO_BKGBPM);
diff --git a/recipes/hawki_step_compute_bkg.cc b/recipes/hawki_step_compute_bkg.cc
index 5475d46..faba398 100644
--- a/recipes/hawki_step_compute_bkg.cc
+++ b/recipes/hawki_step_compute_bkg.cc
@@ -1,4 +1,4 @@
-/* $Id: hawki_step_compute_bkg.cc,v 1.5 2012/12/07 13:44:19 cgarcia Exp $
+/* $Id: hawki_step_compute_bkg.cc,v 1.6 2013/01/29 18:16:21 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2008 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/12/07 13:44:19 $
- * $Revision: 1.5 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/29 18:16:21 $
+ * $Revision: 1.6 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -274,6 +274,7 @@ static int hawki_step_compute_bkg_create(cpl_plugin * plugin)
 static int hawki_step_compute_bkg_exec(cpl_plugin * plugin)
 {
     cpl_recipe  *   recipe ;
+    int             status;
 
     /* Get the recipe out of the plugin */
     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
@@ -283,7 +284,17 @@ static int hawki_step_compute_bkg_exec(cpl_plugin * plugin)
     /* Issue a banner */
     hawki_print_banner();
 
-    return hawki_step_compute_bkg(recipe->parameters, recipe->frames) ;
+    try
+    {
+        status = hawki_step_compute_bkg(recipe->parameters, recipe->frames);
+    }
+    catch(...)
+    {
+        status = 1;
+        cpl_msg_error(cpl_func, "An uncaught error during recipe execution");
+    }
+
+    return status;
 }
 
 /*----------------------------------------------------------------------------*/
diff --git a/recipes/hawki_step_detect_obj.c b/recipes/hawki_step_detect_obj.c
index 615a3dc..8c0017c 100644
--- a/recipes/hawki_step_detect_obj.c
+++ b/recipes/hawki_step_detect_obj.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/11/30 14:50:51 $
  * $Revision: 1.27 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_step_photom_2mass.c b/recipes/hawki_step_photom_2mass.c
index 79ff20e..4a550c4 100644
--- a/recipes/hawki_step_photom_2mass.c
+++ b/recipes/hawki_step_photom_2mass.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_step_photom_2mass.c,v 1.17 2012/04/23 10:08:45 cgarcia Exp $
+/* $Id: hawki_step_photom_2mass.c,v 1.18 2013/01/14 15:58:23 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/04/23 10:08:45 $
- * $Revision: 1.17 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/01/14 15:58:23 $
+ * $Revision: 1.18 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -52,6 +52,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_step_photom_2mass_create(cpl_plugin *) ;
 static int hawki_step_photom_2mass_exec(cpl_plugin *) ;
 static int hawki_step_photom_2mass_destroy(cpl_plugin *) ;
@@ -748,18 +753,18 @@ static cpl_table * hawki_step_photom_2mass_fill_zpoint_table
     {
         case HAWKI_BAND_J:    
             extinction = 0.098;
-            strcpy(magcol_2mass, HAWKI_COL_2MASS_J_MAG);
-            strcpy(magerrcol_2mass, HAWKI_COL_2MASS_J_MAGSIG);
+            strncpy(magcol_2mass, HAWKI_COL_2MASS_J_MAG, 98);
+            strncpy(magerrcol_2mass, HAWKI_COL_2MASS_J_MAGSIG, 98);
             break ;
         case HAWKI_BAND_H:
             extinction = 0.039;
-            strcpy(magcol_2mass, HAWKI_COL_2MASS_H_MAG);
-            strcpy(magerrcol_2mass, HAWKI_COL_2MASS_H_MAGSIG);
+            strncpy(magcol_2mass, HAWKI_COL_2MASS_H_MAG, 98);
+            strncpy(magerrcol_2mass, HAWKI_COL_2MASS_H_MAGSIG, 98);
             break ;
         case HAWKI_BAND_K:
             extinction = 0.065;
-            strcpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG);
-            strcpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG);
+            strncpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG, 98);
+            strncpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG, 98);
             break ;
         default: 
             extinction = 0.00;
@@ -769,8 +774,8 @@ static cpl_table * hawki_step_photom_2mass_fill_zpoint_table
                             "be accurate", filter, 
                             HAWKI_COL_ZPOINT_MAG, HAWKI_COL_ZPOINT_ERRMAG,
                             HAWKI_COL_ZPOINT_ZPOINT, HAWKI_COL_ZPOINT_ATX0);
-            strcpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG);
-            strcpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG);
+            strncpy(magcol_2mass, HAWKI_COL_2MASS_K_MAG, 98);
+            strncpy(magerrcol_2mass, HAWKI_COL_2MASS_K_MAGSIG, 98);
             break ;
     }
                 
diff --git a/recipes/hawki_step_refine_offsets.c b/recipes/hawki_step_refine_offsets.c
index 7dc1692..52113b3 100644
--- a/recipes/hawki_step_refine_offsets.c
+++ b/recipes/hawki_step_refine_offsets.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/10/24 10:42:12 $
  * $Revision: 1.17 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_step_stats.c b/recipes/hawki_step_stats.c
index b0b19b1..f556a7d 100644
--- a/recipes/hawki_step_stats.c
+++ b/recipes/hawki_step_stats.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/11/30 14:51:22 $
  * $Revision: 1.13 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_step_stitch.c b/recipes/hawki_step_stitch.c
index 1b88731..fb59410 100644
--- a/recipes/hawki_step_stitch.c
+++ b/recipes/hawki_step_stitch.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_step_stitch.c,v 1.7 2011/10/24 10:41:54 cgarcia Exp $
+/* $Id: hawki_step_stitch.c,v 1.8 2013/03/11 11:01:58 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/24 10:41:54 $
- * $Revision: 1.7 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/03/11 11:01:58 $
+ * $Revision: 1.8 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -47,6 +47,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_step_stitch_create(cpl_plugin *) ;
 static int hawki_step_stitch_exec(cpl_plugin *) ;
 static int hawki_step_stitch_destroy(cpl_plugin *) ;
diff --git a/recipes/hawki_step_subtract_bkg.c b/recipes/hawki_step_subtract_bkg.c
index 472d73a..91fa3e5 100644
--- a/recipes/hawki_step_subtract_bkg.c
+++ b/recipes/hawki_step_subtract_bkg.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2012/11/30 14:50:51 $
  * $Revision: 1.18 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/hawki_tec_filtchk.c b/recipes/hawki_tec_filtchk.c
index ebc04b8..2367d3b 100644
--- a/recipes/hawki_tec_filtchk.c
+++ b/recipes/hawki_tec_filtchk.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_tec_filtchk.c,v 1.15 2011/10/24 10:41:32 cgarcia Exp $
+/* $Id: hawki_tec_filtchk.c,v 1.16 2013/03/11 11:02:59 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/24 10:41:32 $
- * $Revision: 1.15 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/03/11 11:02:59 $
+ * $Revision: 1.16 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -49,6 +49,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_tec_filtchk_create(cpl_plugin *) ;
 static int hawki_tec_filtchk_exec(cpl_plugin *) ;
 static int hawki_tec_filtchk_destroy(cpl_plugin *) ;
diff --git a/recipes/hawki_util_extinction.c b/recipes/hawki_util_extinction.c
index 22023fe..9a83b3f 100644
--- a/recipes/hawki_util_extinction.c
+++ b/recipes/hawki_util_extinction.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_util_extinction.c,v 1.3 2011/12/22 14:28:43 cgarcia Exp $
+/* $Id: hawki_util_extinction.c,v 1.4 2013/03/11 11:03:00 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/12/22 14:28:43 $
- * $Revision: 1.3 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/03/11 11:03:00 $
+ * $Revision: 1.4 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -54,6 +54,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_util_extinction_create(cpl_plugin *) ;
 static int hawki_util_extinction_exec(cpl_plugin *) ;
 static int hawki_util_extinction_destroy(cpl_plugin *) ;
diff --git a/recipes/hawki_util_gendist.c b/recipes/hawki_util_gendist.c
index 314107f..cadc898 100644
--- a/recipes/hawki_util_gendist.c
+++ b/recipes/hawki_util_gendist.c
@@ -1,4 +1,4 @@
-/* $Id: hawki_util_gendist.c,v 1.22 2011/10/24 10:40:50 cgarcia Exp $
+/* $Id: hawki_util_gendist.c,v 1.23 2013/03/11 11:03:00 cgarcia Exp $
  *
  * This file is part of the HAWKI Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/24 10:40:50 $
- * $Revision: 1.22 $
- * $Name: hawki-1_8_11 $
+ * $Date: 2013/03/11 11:03:00 $
+ * $Revision: 1.23 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -49,6 +49,11 @@
                             Functions prototypes
  -----------------------------------------------------------------------------*/
 
+#ifdef __cplusplus
+extern "C"
+#endif
+int cpl_plugin_get_info(cpl_pluginlist * list);
+
 static int hawki_util_gendist_create(cpl_plugin *) ;
 static int hawki_util_gendist_exec(cpl_plugin *) ;
 static int hawki_util_gendist_destroy(cpl_plugin *) ;
diff --git a/recipes/hawki_util_stdstars.c b/recipes/hawki_util_stdstars.c
index c84db86..db77b46 100644
--- a/recipes/hawki_util_stdstars.c
+++ b/recipes/hawki_util_stdstars.c
@@ -22,7 +22,7 @@
  * $Author: cgarcia $
  * $Date: 2011/07/06 08:21:36 $
  * $Revision: 1.16 $
- * $Name: hawki-1_8_11 $
+ * $Name: hawki-1_8_12 $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/reflex/Makefile.in b/reflex/Makefile.in
index 0bcce2b..b7ff850 100644
--- a/reflex/Makefile.in
+++ b/reflex/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +15,23 @@
 @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@
@@ -57,6 +73,11 @@ CONFIG_CLEAN_FILES = Hawki_Calib_Science.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/||"`;; \
@@ -78,6 +99,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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)"
 DATA = $(wkfcopy_DATA) $(wkfextra_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -306,8 +333,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-wkfcopyDATA: $(wkfcopy_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(wkfcopydir)" || $(MKDIR_P) "$(DESTDIR)$(wkfcopydir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -321,13 +351,14 @@ uninstall-wkfcopyDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(wkfcopy_DATA)'; test -n "$(wkfcopydir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(wkfcopydir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(wkfcopydir)" && rm -f $$files
+	dir='$(DESTDIR)$(wkfcopydir)'; $(am__uninstall_files_from_dir)
 install-wkfextraDATA: $(wkfextra_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(wkfextradir)" || $(MKDIR_P) "$(DESTDIR)$(wkfextradir)"
 	@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; \
 	  echo "$$d$$p"; \
@@ -341,15 +372,15 @@ uninstall-wkfextraDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(wkfextra_DATA)'; test -n "$(wkfextradir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(wkfextradir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(wkfextradir)" && rm -f $$files
+	dir='$(DESTDIR)$(wkfextradir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -398,10 +429,15 @@ 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:
diff --git a/regtests/Makefile.am b/regtests/Makefile.am
index c19c6fa..5b23528 100644
--- a/regtests/Makefile.am
+++ b/regtests/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 St, Fifth Floor, Boston, MA  02111-1307  USA
 
 AUTOMAKE_OPTIONS = 1.8 foreign
 
diff --git a/regtests/Makefile.in b/regtests/Makefile.in
index 6f98d14..b6c5c2c 100644
--- a/regtests/Makefile.in
+++ b/regtests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +14,23 @@
 
 @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@
@@ -62,6 +78,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-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=) \
@@ -306,12 +327,12 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # 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):
+# 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 \
@@ -321,7 +342,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; \
@@ -335,37 +360,6 @@ $(RECURSIVE_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-$(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; \
-	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; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -374,6 +368,10 @@ 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)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -437,6 +435,20 @@ GTAGS:
 	  && $(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
 
@@ -472,13 +484,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || 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; \
@@ -513,10 +522,15 @@ 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:
@@ -596,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	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
+	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
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/regtests/tests/Makefile.am b/regtests/tests/Makefile.am
index 290494d..f7b7b4c 100644
--- a/regtests/tests/Makefile.am
+++ b/regtests/tests/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 St, Fifth Floor, Boston, MA  02111-1307  USA
 
 AUTOMAKE_OPTIONS = 1.8 foreign
 
diff --git a/regtests/tests/Makefile.in b/regtests/tests/Makefile.in
index 00a9bcf..5817d91 100644
--- a/regtests/tests/Makefile.in
+++ b/regtests/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +14,23 @@
 
 @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@
@@ -55,6 +71,11 @@ CONFIG_CLEAN_FILES =
 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@
 AMTAR = @AMTAR@
@@ -269,6 +290,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -314,10 +337,15 @@ 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:
diff --git a/setup b/setup
index b59cdf9..5bf697e 100755
--- a/setup
+++ b/setup
@@ -19,7 +19,7 @@
 # $Author: cgarcia $
 # $Date: 2012/01/09 14:15:47 $
 # $Revision: 1.2 $
-# $Name: hawki-1_8_11 $
+# $Name: hawki-1_8_12 $
 
 
 #   This script is the autoinstaller for the VLT instrument pipeline
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 506909d..f127d90 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,7 +31,7 @@ endif
 
 LIBHAWKI = $(top_builddir)/hawki/libhawki.la
 
-INCLUDES = -I$(top_builddir)hawki/
+AM_CPPFLAGS = -I$(top_builddir)hawki/
 LDADD = $(LIBHAWKI)
 
 check_PROGRAMS =
@@ -40,7 +40,8 @@ check_PROGRAMS =
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
         CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
         LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
+        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" MALLOC_PERTURB_=231 \
+        MALLOC_CHECK_=2
 
 TESTS =
 
diff --git a/tests/Makefile.in b/tests/Makefile.in
index cdb7cb7..b8c4d62 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 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, 2006, 2007, 2008, 2009  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,6 +14,23 @@
 
 @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@
@@ -57,8 +73,15 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+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@
@@ -228,14 +251,15 @@ wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.6 foreign
 DISTCLEANFILES = *~
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = -I$(top_builddir)hawki/
+AM_CPPFLAGS = -I$(top_builddir)hawki/
 LDADD = $(LIBHAWKI)
 
 # Be sure to reexport important environment variables.
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
         CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
         LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
+        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" MALLOC_PERTURB_=231 \
+        MALLOC_CHECK_=2
 
 all: all-am
 
@@ -291,6 +315,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
@@ -302,7 +328,7 @@ check-TESTS: $(TESTS)
 	    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[\ \	]*) \
@@ -373,14 +399,15 @@ check-TESTS: $(TESTS)
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
 	  if test "$$failed" -eq 0; then \
-	    echo "$$grn$$dashes"; \
+	    col="$$grn"; \
 	  else \
-	    echo "$$red$$dashes"; \
+	    col="$$red"; \
 	  fi; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes$$std"; \
+	  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
 
@@ -430,10 +457,15 @@ 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:

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



More information about the debian-science-commits mailing list