MUSE Pipeline Reference Manual  2.5.2
muse_postproc.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-2018 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_POSTPROC_H
23 #define MUSE_POSTPROC_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_autocalib.h"
31 #include "muse_flux.h"
32 #include "muse_lsf.h"
33 #include "muse_lsf_params.h"
34 #include "muse_pixtable.h"
35 #include "muse_processing.h"
36 #include "muse_resampling.h"
37 #include "muse_rvcorrect.h"
38 #include "muse_sky.h"
39 #include "muse_table.h"
40 #include "muse_wcs.h"
41 #include "muse_xcombine.h"
42 
43 /*----------------------------------------------------------------------------*
44  * Defines *
45  *----------------------------------------------------------------------------*/
46 
47 /*----------------------------------------------------------------------------*
48  * Data structures *
49  *----------------------------------------------------------------------------*/
50 
54 /*----------------------------------------------------------------------------*/
58 /*----------------------------------------------------------------------------*/
59 typedef enum {
60  MUSE_POSTPROC_SCIPOST = 0,
61  MUSE_POSTPROC_STANDARD,
62  MUSE_POSTPROC_ASTROMETRY
64 
65 /*----------------------------------------------------------------------------*/
69 /*----------------------------------------------------------------------------*/
70 typedef enum {
71  MUSE_POSTPROC_SKYMETHOD_NONE = 0,
72  MUSE_POSTPROC_SKYMETHOD_MODEL,
73  MUSE_POSTPROC_SKYMETHOD_SIMPLE
75 
76 /*----------------------------------------------------------------------------*/
80 /*----------------------------------------------------------------------------*/
81 typedef enum {
82  MUSE_POSTPROC_DARCHECK_NONE = 0,
83  MUSE_POSTPROC_DARCHECK_CHECK,
84  MUSE_POSTPROC_DARCHECK_CORRECT
86 
87 /*----------------------------------------------------------------------------*/
91 /*----------------------------------------------------------------------------*/
92 typedef struct {
94  cpl_table *exposures;
95  double lambdamin;
96  double lambdamax;
97  double lambdaref;
99  muse_rvcorrect_type rvtype;
102  cpl_table *extinction;
103  cpl_propertylist *wcs;
104  cpl_boolean astrometry;
105  cpl_table *raman_lines;
106  double raman_width;
108  cpl_table *sky_lines;
109  cpl_table *sky_continuum;
111 #ifdef USE_LSF_PARAMS
113 #endif
117  cpl_frame *refframe;
119  cpl_table *tellregions;
123  double detsigma;
124  double radius;
126  double faccuracy;
128  double rejsigma;
129  int niter;
132  double crpix1, crpix2;
134 
135 /*----------------------------------------------------------------------------*/
139 /*----------------------------------------------------------------------------*/
140 typedef struct {
144 
145 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 typedef struct {
153  cpl_table *spectrum;
154  cpl_table *lines;
155  cpl_table *continuum;
157 
160 /*----------------------------------------------------------------------------*
161  * Function prototypes *
162  *----------------------------------------------------------------------------*/
165 
166 cpl_boolean muse_postproc_check_save_param(const char *, const char *);
171 
172 void muse_postproc_offsets_scale(muse_pixtable *, const cpl_table *, const char *);
173 cpl_table *muse_postproc_load_nearest(const cpl_propertylist *, const cpl_frame *, float, float, double *, double *);
176 cpl_error_code muse_postproc_correct_raman(muse_pixtable *, muse_postproc_properties *, const cpl_table *, muse_datacube **);
178 
182 
183 #endif /* MUSE_POSTPROC_H */
Structure definition of a MUSE datacube.
Definition: muse_datacube.h:48
muse_rvcorrect_type rvtype
Definition: muse_postproc.h:99
cpl_propertylist * muse_postproc_cube_load_output_wcs(muse_processing *)
Find a file with a usable output WCS in the input frameset.
muse_autocalib_type autocalib
muse_postproc_properties * muse_postproc_properties_new(muse_postproc_type)
Create a post-processing properties object.
Definition: muse_postproc.c:76
muse_flux_selection_type select
muse_postproc_skymethod
Method of sky subtraction to apply.
Definition: muse_postproc.h:70
muse_flux_smooth_type
Type of response curve smoothing to use.
Definition: muse_flux.h:146
muse_wcs_centroid_type centroid
cpl_error_code muse_postproc_correct_raman(muse_pixtable *, muse_postproc_properties *, const cpl_table *, muse_datacube **)
Set up and run Raman-light removal.
void muse_postproc_offsets_scale(muse_pixtable *, const cpl_table *, const char *)
Apply spatial offsets and flux scale to a pixel table (of a single exposure)
muse_xcombine_types muse_postproc_get_weight_type(const char *)
Select correct weighting type for weight string.
cpl_error_code muse_postproc_revert_ffspec_maybe(muse_pixtable *, const muse_table *)
Revert correction of on-sky data with the flat-field spectrum.
muse_flux_profile_type
Type of optimal profile to use.
Definition: muse_flux.h:124
muse_resampling_crstats_type muse_postproc_get_cr_type(const char *)
Select correct cosmic ray rejection type for crtype string.
Data cube/stacked image list containing the LSF for one IFU.
Definition: muse_lsf.h:49
cpl_error_code muse_postproc_qc_fwhm(muse_processing *, muse_datacube *)
Compute QC1 parameters for datacubes and save them in the FITS header.
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:40
cpl_error_code muse_postproc_cube_resample_and_collapse(muse_processing *, muse_pixtable *, muse_cube_type, muse_resampling_params *, const char *)
High level function to resample to a datacube and collapse that to an image of the field of view and ...
muse_flux_profile_type profile
muse_postproc_skymethod skymethod
muse_lsf_params ** lsf_params
muse_wcs_centroid_type
Type of centroiding algorithm to use.
Definition: muse_wcs.h:90
Structure definition of MUSE pixel table.
muse_cube_type muse_postproc_get_cube_format(const char *)
Select correct cube format for format string.
cpl_boolean muse_postproc_check_save_param(const char *, const char *)
Check the –save parameter contents against allowed options.
muse_resampling_crstats_type
Cosmic ray rejection statistics type.
muse_flux_smooth_type smooth
muse_cube_type
cpl_propertylist * wcs
Structure definition of the post-processing properties.
Definition: muse_postproc.h:92
Structure to define the major settable sky parameters.
Definition: muse_sky.h:54
void muse_postproc_properties_delete(muse_postproc_properties *)
Free memory taken by a post-processing properties object and all its components.
cpl_table * muse_postproc_load_nearest(const cpl_propertylist *, const cpl_frame *, float, float, double *, double *)
Load the calibration from a multi-table FITS file that is nearest on the sky.
Structure to store a table together with a property list.
Definition: muse_table.h:43
muse_image * muse_postproc_whitelight(muse_pixtable *, double)
Create a white-light image of the field of view.
muse_postproc_darcheck
Method of DAR checking/correction to do.
Definition: muse_postproc.h:81
muse_lsf_cube ** lsf_cube
void * muse_postproc_process_exposure(muse_postproc_properties *, unsigned int, muse_postproc_autocal_outputs *, muse_datacube **, muse_postproc_sky_outputs *, const cpl_table *)
Merge and process pixel tables from one exposure.
muse_postproc_type
Type of per-exposure processing to run.
Definition: muse_postproc.h:59
muse_resampling_type muse_postproc_get_resampling_type(const char *)
Select correct resampling type for resample string.
Handling of "mask" files.
Definition: muse_mask.h:43
muse_postproc_type type
Definition: muse_postproc.h:93
muse_resampling_type
Resampling types.
Resampling parameters.
Structure definition of the post-processing output sky data.
Structure definition of the post-processing output auto-calibration.
muse_sky_params skymodel_params
Structure definition of detector (slice) parameters.
muse_postproc_darcheck darcheck
Definition: muse_postproc.h:98
muse_xcombine_types
Xposure combination types.
Definition: muse_xcombine.h:44
muse_flux_selection_type
Type of star selection to use.
Definition: muse_flux.h:136
muse_autocalib_type
Type of autocalibration to use (if any)