MUSE Pipeline Reference Manual  1.0.2
muse_flux.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_FLUX_H
23 #define MUSE_FLUX_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_image.h"
31 #include "muse_pixtable.h"
32 #include "muse_resampling.h"
33 
34 /*----------------------------------------------------------------------------*
35  * Defines *
36  *----------------------------------------------------------------------------*/
37 /* flux scaling units expressed according to the FITS Standard v3.0, §4.3 */
38 static const char kMuseFluxUnitString[] = "10**(-20)*erg/s/cm**2/Angstrom";
39 static const char kMuseFluxStatString[] = "(10**(-20)*erg/s/cm**2/Angstrom)**2";
40 static const double kMuseFluxUnitFactor = 1e20;
41 static const double kMuseFluxStatFactor = 1e40;
42 
43 /* FITS headers for storing detected sources found *
44  * by the standard star flux integration routines */
45 #define MUSE_HDR_FLUX_NOBJ "ESO DRS MUSE FLUX NOBJ"
46 #define MUSE_HDR_FLUX_OBJn_X "ESO DRS MUSE FLUX OBJ%d X"
47 #define MUSE_HDR_FLUX_OBJn_Y "ESO DRS MUSE FLUX OBJ%d Y"
48 #define MUSE_HDR_FLUX_OBJn_RA "ESO DRS MUSE FLUX OBJ%d RA"
49 #define MUSE_HDR_FLUX_OBJn_DEC "ESO DRS MUSE FLUX OBJ%d DEC"
50 #define MUSE_HDR_FLUX_OBJn_FLUX "ESO DRS MUSE FLUX OBJ%d INTFLUX"
51 
52 /*----------------------------------------------------------------------------*
53  * Data structures *
54  *----------------------------------------------------------------------------*/
56 
60 /*----------------------------------------------------------------------------*/
64 /*----------------------------------------------------------------------------*/
65 typedef struct {
73  cpl_table *sensitivity;
75  cpl_table *response;
77  cpl_table *tellbands;
79  cpl_table *telluric;
81  double raref;
83  double decref;
85 
86 /*----------------------------------------------------------------------------*/
95 /*----------------------------------------------------------------------------*/
96 typedef enum {
103 
104 /*----------------------------------------------------------------------------*/
108 /*----------------------------------------------------------------------------*/
109 typedef enum {
115 
116 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 typedef enum {
125 
126 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 typedef enum {
137 
140 /*----------------------------------------------------------------------------*
141  * Function prototypes *
142  *----------------------------------------------------------------------------*/
145 
146 cpl_error_code muse_flux_reference_table_check(cpl_table *);
147 double muse_flux_response_interpolate(const cpl_table *, double, double *, muse_flux_interpolation_type);
149 cpl_error_code muse_flux_response_compute(muse_flux_object *, muse_flux_selection_type, double, const cpl_table *, const cpl_table *, const cpl_table *);
152 cpl_error_code muse_flux_calibrate(muse_pixtable *, const cpl_table *, const cpl_table *, const cpl_table *);
153 
154 #endif /* MUSE_FLUX_H */
Structure definition of a MUSE datacube.
Definition: muse_datacube.h:47
cpl_table * telluric
Definition: muse_flux.h:79
muse_image * intimage
Definition: muse_flux.h:70
muse_flux_smooth_type
Type of response curve smoothing to use.
Definition: muse_flux.h:131
cpl_table * response
Definition: muse_flux.h:75
muse_flux_profile_type
Type of optimal profile to use.
Definition: muse_flux.h:109
cpl_error_code muse_flux_reference_table_check(cpl_table *)
Check and/or adapt the standard flux reference table format.
Definition: muse_flux.c:168
const muse_cpltable_def muse_response_tellbands_def[]
Table definition for a telluric bands table.
Definition: muse_flux.c:1392
cpl_table * sensitivity
Definition: muse_flux.h:73
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:40
muse_flux_object * muse_flux_object_new(void)
Allocate memory for a new muse_flux_object object.
Definition: muse_flux.c:68
cpl_error_code muse_flux_get_telluric_table(muse_flux_object *)
Get the table of the telluric correction.
Definition: muse_flux.c:2458
double muse_flux_response_interpolate(const cpl_table *, double, double *, muse_flux_interpolation_type)
Compute linearly interpolated response of some kind at given wavelength.
Definition: muse_flux.c:336
Structure definition of MUSE pixel table.
Flux object to store data needed while computing the flux calibration.
Definition: muse_flux.h:65
cpl_error_code muse_flux_response_compute(muse_flux_object *, muse_flux_selection_type, double, const cpl_table *, const cpl_table *, const cpl_table *)
Compare measured flux distribution over wavelength with calibrated stellar fluxes and derive instrume...
Definition: muse_flux.c:1930
muse_datacube * cube
Definition: muse_flux.h:67
cpl_error_code muse_flux_calibrate(muse_pixtable *, const cpl_table *, const cpl_table *, const cpl_table *)
Convert the input pixel table from counts to fluxes.
Definition: muse_flux.c:2568
muse_flux_interpolation_type
Type of table interpolation to use.
Definition: muse_flux.h:96
cpl_error_code muse_flux_get_response_table(muse_flux_object *, muse_flux_smooth_type)
Get the table of the standard star response function.
Definition: muse_flux.c:2397
cpl_table * tellbands
Definition: muse_flux.h:77
cpl_error_code muse_flux_integrate_std(muse_pixtable *, muse_flux_profile_type, muse_flux_object *)
Integrate the flux of the standard star(s) in the field over all wavelengths.
Definition: muse_flux.c:1020
Definition of a cpl table structure.
muse_flux_selection_type
Type of star selection to use.
Definition: muse_flux.h:121
void muse_flux_object_delete(muse_flux_object *aFluxObj)
Deallocate memory associated to a muse_flux_object.
Definition: muse_flux.c:89