ERIS Pipeline Reference Manual 1.9.2
eris_nix_lss_utils.h
1/* $Id$
2 *
3 * This file is part of the ERIS/NIX Pipeline
4 * Copyright (C) 2017 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/*
22 * $Author$
23 * $Date$
24 * $Rev$
25 */
26
27#ifndef ERIS_NIX_WAVECAL_UTILS_H
28#define ERIS_NIX_WAVECAL_UTILS_H
29
30#ifdef HAVE_CONFIG_H
31#include <config.h>
32#endif
33
34/*-----------------------------------------------------------------------------
35 Includes
36 -----------------------------------------------------------------------------*/
37
38#include "eris_nix_defs.h"
39#include <cpl.h>
40#include <hdrl.h>
41
42/*-----------------------------------------------------------------------------
43 Prototypes
44 -----------------------------------------------------------------------------*/
45
46cpl_error_code enlu_divide_slit_response(located_imagelist * jitters);
47
48cpl_error_code enlu_divide_slit_response_worker(hdrl_image * himage_2d,
49 cpl_image * response_1d);
50
51double enlu_linepos_1d(const cpl_vector * spectrum1d,
52 const double guess_pos,
53 const cpl_size half_width);
54
55cpl_matrix * enlu_linepos_2d(const hdrl_image * spectrum2d,
56 const cpl_size slice_index,
57 const cpl_vector * guess_pos);
58
59cpl_error_code enlu_trace_save(const char * pro_catg,
60 const hdrl_image * image,
61 const cpl_image * confidence,
62 const cpl_size ntraces,
63 const cpl_polynomial * traces[ntraces],
64 const cpl_size nspectra,
65 const cpl_vector * spectra[nspectra],
66 const cpl_size nlines,
67 const cpl_polynomial * lines[nlines],
68 cpl_frameset * frameset,
69 const cpl_parameterlist * parlist,
70 const char * filename,
71 const char * recipe_name);
72
73cpl_polynomial * enlu_warp_poly_load_from_table(const cpl_table * poly_table);
74
75cpl_table * enlu_warp_poly_save_to_table(const cpl_polynomial * polynomial);
76
77#endif
78
79
cpl_error_code enlu_divide_slit_response_worker(hdrl_image *himage_2d, cpl_image *response_1d)
Worker function to divide a 2d image by a 1d response.
cpl_error_code enlu_divide_slit_response(located_imagelist *jitters)
Divide LSS 2d-spectra by the slit response.
double enlu_linepos_1d(const cpl_vector *spectrum1d, const double guess_pos, const cpl_size half_width)
Fit line peak.
cpl_table * enlu_warp_poly_save_to_table(const cpl_polynomial *polynomial)
Save an LSS polynomial to a cpl_table.
cpl_matrix * enlu_linepos_2d(const hdrl_image *spectrum2d, const cpl_size slice_index, const cpl_vector *guess_pos)
Fit the line peaks of a wave calibration spectrum.
cpl_polynomial * enlu_warp_poly_load_from_table(const cpl_table *poly_table)
Load a LSS warp polynomial from a cpl_table.
cpl_error_code enlu_trace_save(const char *pro_catg, const hdrl_image *image, const cpl_image *confidence, const cpl_size ntraces, const cpl_polynomial *traces[ntraces], const cpl_size nspectra, const cpl_vector *spectra[nspectra], const cpl_size nlines, const cpl_polynomial *lines[nlines], cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *filename, const char *recipe_name)
Save a trace result.