MUSE Pipeline Reference Manual  0.18.5
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  *
5  * This file is part of the MUSE Instrument Pipeline
6  * Copyright (C) 2005-2011 European Southern Observatory
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef MUSE_FLUX_H
24 #define MUSE_FLUX_H
25 
26 /*----------------------------------------------------------------------------*
27  * Includes *
28  *----------------------------------------------------------------------------*/
29 #include <cpl.h>
30 
31 #include "muse_image.h"
32 #include "muse_pixtable.h"
33 #include "muse_resampling.h"
34 
35 /*----------------------------------------------------------------------------*
36  * Defines *
37  *----------------------------------------------------------------------------*/
38 /* flux scaling units expressed according to the FITS Standard v3.0, §4.3 */
39 static const char kMuseFluxUnitString[] = "10**(-20)*erg/s/cm**2/Angstrom";
40 static const char kMuseFluxStatString[] = "(10**(-20)*erg/s/cm**2/Angstrom)**2";
41 static const double kMuseFluxUnitFactor = 1e20;
42 static const double kMuseFluxStatFactor = 1e40;
43 
44 /*----------------------------------------------------------------------------*
45  * Data structures *
46  *----------------------------------------------------------------------------*/
48 
52 /*----------------------------------------------------------------------------*/
56 /*----------------------------------------------------------------------------*/
57 typedef struct {
58  /* the datacube created for the standard star exposure */
59  muse_datacube *cube;
60  /* the three extension muse_image to store the *
61  * integrated fluxes and their error estimates */
62  muse_image *intimage;
63  /* the sensitivity (ratio of expected to measured flux in magnitudes), *
64  * plus additional data in table form */
65  cpl_table *sensitivity;
66  /* the flux response curve in table form */
67  cpl_table *response;
68  /* the regions of the telluric bands in table form */
69  cpl_table *tellbands;
70  /* the telluric correction in table form */
71  cpl_table *telluric;
73 
74 /*----------------------------------------------------------------------------*/
83 /*----------------------------------------------------------------------------*/
84 typedef enum {
91 
92 /*----------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------*/
97 typedef enum {
103 
106 /*----------------------------------------------------------------------------*
107  * Function prototypes *
108  *----------------------------------------------------------------------------*/
111 
112 cpl_error_code muse_flux_reference_table_check(cpl_table *);
113 double muse_flux_response_interpolate(const cpl_table *, double, double *, muse_flux_interpolation_type);
115 cpl_error_code muse_flux_response_compute(muse_flux_object *, double, const cpl_table *, const cpl_table *, const cpl_table *);
118 cpl_error_code muse_flux_calibrate(muse_pixtable *, const cpl_table *, const cpl_table *, const cpl_table *);
119 
120 #endif /* MUSE_FLUX_H */
Structure definition of a MUSE datacube.
Definition: muse_datacube.h:48
muse_flux_profile_type
Type of optimal profile to use.
Definition: muse_flux.h:97
cpl_error_code muse_flux_reference_table_check(cpl_table *)
Check and/or adapt the standard flux reference table format.
Definition: muse_flux.c:162
const muse_cpltable_def muse_response_tellbands_def[]
Table definition for a telluric bands table.
Definition: muse_flux.c:1303
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:41
muse_flux_object * muse_flux_object_new(void)
Allocate memory for a new muse_flux_object object.
Definition: muse_flux.c:66
cpl_error_code muse_flux_get_telluric_table(muse_flux_object *)
Get the table of the telluric correction.
Definition: muse_flux.c:2051
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:322
cpl_error_code muse_flux_get_response_table(muse_flux_object *)
Get the table of the standard star response function.
Definition: muse_flux.c:2009
Structure definition of MUSE pixel table.
Flux object to store data needed while computing the flux calibration.
Definition: muse_flux.h:57
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:2161
muse_flux_interpolation_type
Type of table interpolation to use.
Definition: muse_flux.h:84
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:1006
cpl_error_code muse_flux_response_compute(muse_flux_object *, 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:1833
Definition of a cpl table structure.
void muse_flux_object_delete(muse_flux_object *aFluxObj)
Deallocate memory associated to a muse_flux_object.
Definition: muse_flux.c:84