MUSE Pipeline Reference Manual  2.1.1
muse_sky.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_SKY_H
23 #define MUSE_SKY_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_utils.h"
31 #include "muse_cplwrappers.h"
32 #include "muse_pixtable.h"
33 #include "muse_resampling.h"
34 #include "muse_lsf.h"
35 
36 /*----------------------------------------------------------------------------*
37  * Defines *
38  *----------------------------------------------------------------------------*/
40 extern const muse_cpltable_def muse_relativespectrum_def[];
41 extern const muse_cpltable_def muse_extinction_def[];
42 
43 /*----------------------------------------------------------------------------*
44  * Special variable types *
45  *----------------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------------*/
53 /*----------------------------------------------------------------------------*/
54 typedef struct {
55  double ignore;
56  double fraction;
57  double sampling;
58  double csampling;
59  double crsigmac; /* CR rejection sigma level for cube-based cleaning */
60  double crsigmas; /* CR rejection sigma level for spectrum-based cleaning */
62 
65 /*----------------------------------------------------------------------------*
66  * Function prototypes *
67  *----------------------------------------------------------------------------*/
68 /* common functions (muse_sky_common.c) */
69 cpl_table *muse_sky_spectrum_from_cube(muse_datacube *, const cpl_mask *);
70 muse_mask *muse_sky_create_skymask(muse_image *, double, double, const char *);
71 cpl_error_code muse_sky_save_continuum(muse_processing *, const cpl_table *, cpl_propertylist *);
72 
73 /* functions about lines (muse_sky_lines.c) */
74 cpl_error_code muse_sky_lines_set_range(cpl_table *, double, double);
75 cpl_error_code muse_sky_lines_save(muse_processing *, const cpl_table *, cpl_propertylist *);
77 cpl_error_code muse_sky_lines_apply_strength(cpl_table *, const cpl_array *);
78 cpl_error_code muse_sky_lines_cut(cpl_table *, double);
79 cpl_table *muse_sky_lines_create(const cpl_table *, const cpl_table *, double);
80 
81 /* functions about master sky creation (muse_sky_master.c) */
82 cpl_error_code muse_sky_lines_fit(cpl_table *, cpl_table *, cpl_image *, muse_wcs *);
83 cpl_table *muse_sky_continuum_create(cpl_table *, cpl_table *, cpl_image *, muse_wcs *, double);
85 
86 /* functios about QC parameters (muse_sky_qc.c) */
87 void muse_sky_qc_lines(cpl_propertylist *, cpl_table *, const char *);
88 void muse_sky_qc_continuum(cpl_propertylist *, cpl_table *, const char *);
89 
90 /* functions about sky subtraction (muse_sky_subtract.c) */
91 cpl_array *muse_sky_lines_spectrum(const cpl_array *, cpl_table *, const cpl_image *, const muse_wcs *);
92 cpl_error_code muse_sky_subtract_lines(muse_pixtable *, cpl_table *, muse_lsf_cube **);
93 cpl_error_code muse_sky_subtract_continuum(muse_pixtable *, cpl_table *);
94 
95 #endif /* MUSE_SKY_H */
cpl_error_code muse_sky_lines_fit(cpl_table *, cpl_table *, cpl_image *, muse_wcs *)
Fit all entries of the pixel table to the master sky.
cpl_table * muse_sky_continuum_create(cpl_table *, cpl_table *, cpl_image *, muse_wcs *, double)
Create a continuum spectrum.
Structure definition of a MUSE datacube.
Definition: muse_datacube.h:48
cpl_error_code muse_sky_lines_apply_strength(cpl_table *, const cpl_array *)
Apply the line strengths to the lines.
A structure containing a spatial two-axis WCS.
Definition: muse_wcs.h:105
cpl_error_code muse_sky_lines_save(muse_processing *, const cpl_table *, cpl_propertylist *)
Save sky lines table to file.
cpl_table * muse_sky_spectrum_from_cube(muse_datacube *, const cpl_mask *)
Create a spectrum out of a cube by applying a mask.
cpl_table * muse_sky_lines_create(const cpl_table *, const cpl_table *, double)
Create the emission lines from the OH transitions and other lines.
cpl_table * muse_sky_lines_load(muse_processing *)
Load the sky data files.
Data cube/stacked image list containing the LSF for one IFU.
Definition: muse_lsf.h:49
void muse_sky_qc_lines(cpl_propertylist *, cpl_table *, const char *)
Fill a header with the QC parameters for the sky lines.
Definition: muse_sky_qc.c:46
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:40
void muse_sky_qc_continuum(cpl_propertylist *, cpl_table *, const char *)
Fill a header with the QC parameters for the sky continuum.
Definition: muse_sky_qc.c:102
cpl_table * muse_sky_continuum_load(muse_processing *)
Load the sky continuum.
Structure definition of MUSE pixel table.
Structure to define the major settable sky parameters.
Definition: muse_sky.h:54
cpl_error_code muse_sky_subtract_continuum(muse_pixtable *, cpl_table *)
Subtract sky continuum from pixel table.
const muse_cpltable_def muse_fluxspectrum_def[]
Definition of the flux spectrum table structure.
cpl_error_code muse_sky_lines_set_range(cpl_table *, double, double)
Limit the lines in the table to a wavelength range.
cpl_array * muse_sky_lines_spectrum(const cpl_array *, cpl_table *, const cpl_image *, const muse_wcs *)
Create spectrum for a single slice.
cpl_error_code muse_sky_lines_cut(cpl_table *, double)
Remove all lines below a certain flux limit.
Handling of "mask" files.
Definition: muse_mask.h:43
muse_mask * muse_sky_create_skymask(muse_image *, double, double, const char *)
Select spaxels to be considered as sky.
cpl_error_code muse_sky_subtract_lines(muse_pixtable *, cpl_table *, muse_lsf_cube **)
Subtract sky lines from a pixtable.
Definition of a cpl table structure.
cpl_error_code muse_sky_save_continuum(muse_processing *, const cpl_table *, cpl_propertylist *)
Save sky continuum table to file.