MUSE Pipeline Reference Manual  2.1.1
muse_lsf_params.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2005-2014 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef MUSE_LSF_PARAMS_H
23 #define MUSE_LSF_PARAMS_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_cplwrappers.h"
31 #include "muse_pixtable.h"
32 #include "muse_processing.h"
33 
34 #define USE_LSF_PARAMS // define this for support of (old) LSF table support
35 
36 /*----------------------------------------------------------------------------*
37  * Special variable types *
38  *----------------------------------------------------------------------------*/
42 #define MAX_HERMIT_ORDER 4
43 
44 /*----------------------------------------------------------------------------*/
51 /*----------------------------------------------------------------------------*/
52 typedef struct {
53  int ifu;
54  int slice;
55  double refraction;
56  double offset;
58  double lambda_ref;
60  cpl_array *sensitivity;
62  double slit_width;
64  double bin_width;
66  cpl_array *lsf_width;
68  cpl_array *hermit[MAX_HERMIT_ORDER];
70 /*----------------------------------------------------------------------------*/
74 /*----------------------------------------------------------------------------*/
75 typedef struct {
76  cpl_size n_param;
77  cpl_size offset;
78  cpl_size refraction;
79  cpl_size sensitivity;
80  cpl_size slit_width;
81  cpl_size bin_width;
82  cpl_size lsf_width;
83  cpl_size hermit[MAX_HERMIT_ORDER];
85 
88 /*----------------------------------------------------------------------------*
89  * Function prototypes *
90  *----------------------------------------------------------------------------*/
91 
92 muse_lsf_params *muse_lsf_params_new(cpl_size, cpl_size, cpl_size);
96 cpl_error_code muse_lsf_params_save(const muse_lsf_params **, const char *);
100 
101 cpl_error_code muse_lsf_params_apply(const muse_lsf_params *,
102  cpl_array *, double);
103 cpl_array *muse_lsf_params_spectrum(const cpl_array *, cpl_table *,
104  const muse_lsf_params *);
106 double muse_lsf_fwhm_lambda(const muse_lsf_params *, double,
107  double, unsigned int);
108 
109 
110 #endif /* MUSE_LSF_PARAMS_H */
cpl_array * muse_lsf_params_spectrum(const cpl_array *, cpl_table *, const muse_lsf_params *)
Create spectrum for a single slice.
double muse_lsf_fwhm_lambda(const muse_lsf_params *, double, double, unsigned int)
Measure the FWHM of an LSF at a given wavelength.
void muse_lsf_params_delete(muse_lsf_params *)
Delete an allocated muse_lsf_params structure.
muse_lsf_params * muse_lsf_params_get(muse_lsf_params **, int, int)
Get the slice LSF parameters for one slice.
void muse_lsf_params_delete_all(muse_lsf_params **)
Delete an allocated array of muse_lsf_params structure.
double bin_width
Bin width.
muse_lsf_params * muse_lsf_params_new(cpl_size, cpl_size, cpl_size)
Create a new lsf_params structure.
cpl_array * sensitivity
Relative detector sensitivity parametrization.
Structure definition of MUSE pixel table.
double slit_width
Slit width.
cpl_array * lsf_width
LSF width.
muse_lsf_params * muse_lsf_params_fit(muse_pixtable *, cpl_table *, int)
Fit all entries of one slice.
cpl_error_code muse_lsf_params_apply(const muse_lsf_params *, cpl_array *, double)
Apply the MUSE LSF function to a single line.
cpl_size muse_lsf_params_get_size(muse_lsf_params **)
Count the number of entries in the array.
muse_lsf_params ** muse_lsf_params_load(const char *, muse_lsf_params **, int)
Load slice LSF parameters from the extension "SLICE_PARAM".
Structure to define which slice parameters are fit.
cpl_error_code muse_lsf_params_save(const muse_lsf_params **, const char *)
Save slice LSF parameters to the extension "slice" on disk.
double lambda_ref
Reference wavelength for polynomial parametrizations.
muse_lsf_params ** muse_processing_lsf_params_load(muse_processing *, int)
Load slice LSF parameters.
Structure definition of detector (slice) parameters.