X-shooter Pipeline Reference Manual 3.8.15
xsh_data_spectrum.h
Go to the documentation of this file.
1/* *
2 * This file is part of the ESO X-shooter Pipeline *
3 * Copyright (C) 2006 European Southern Observatory *
4 * *
5 * This library is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18 * */
19
20/*
21 * $Author: amodigli $
22 * $Date: 2011-12-02 14:15:28 $
23 * $Revision: 1.9 $
24 * $Name: not supported by cvs2svn $
25 */
26#ifndef XSH_DATA_SPECTRUM_H
27#define XSH_DATA_SPECTRUM_H
28
29#include <cpl.h>
30#include <xsh_data_instrument.h>
31
32#define XSH_SPECTRUM_DATA_TYPE CPL_TYPE_FLOAT
33#define XSH_SPECTRUM_DATA_BPP CPL_BPP_IEEE_FLOAT
34#define XSH_SPECTRUM_ERRS_TYPE CPL_TYPE_FLOAT
35#define XSH_SPECTRUM_ERRS_BPP CPL_BPP_IEEE_FLOAT
36#define XSH_SPECTRUM_QUAL_TYPE CPL_TYPE_INT
37#define XSH_SPECTRUM_QUAL_BPP CPL_BPP_32_SIGNED
38
39typedef struct{
40 /* size of the order */
41 int size;
42 /* Minimal spectrum lambda */
43 double lambda_min;
44 /* Maximal spectrum lambda */
45 double lambda_max;
46 /* step in lambda */
48 /* Minimal slit position */
49 double slit_min;
50 /* Maximal slit position */
51 double slit_max;
52 /* step in slit */
53 double slit_step;
54 /* size in lambda */
56 /* size in slit */
58 /* flux data */
59 cpl_propertylist* flux_header;
60 cpl_image *flux;
61 /* errs */
62 cpl_propertylist* errs_header;
63 cpl_image *errs;
64 /* qual */
65 cpl_propertylist* qual_header;
66 cpl_image *qual;
68
69xsh_spectrum* xsh_spectrum_1D_create( double lambda_min, double lambda_max,
70 double lambda_step);
71xsh_spectrum* xsh_spectrum_2D_create( double lambda_min, double lambda_max,
72 double lambda_step, double slit_min, double slit_max, double slit_step);
73
74xsh_spectrum* xsh_spectrum_load( cpl_frame* s1d_frame);
75xsh_spectrum* xsh_spectrum_load_order( cpl_frame* s1d_frame,
76 xsh_instrument* instr,
77 const int order);
78
88cpl_frame* xsh_spectrum_save( xsh_spectrum* s, const char* filename,
89 const char* tag);
90cpl_frame* xsh_spectrum_save_order( xsh_spectrum* s, const char* filename,
91 const char* tag,const int order);
92
94
96
98
100
101cpl_frame * xsh_phys_spectrum_save( xsh_spectrum* s, const char* filename,
102 xsh_instrument* instr) ;
105xsh_spectrum_extract_range( xsh_spectrum * org, const double wmin,const double wmax );
106cpl_error_code
108cpl_error_code
109xsh_spectrum_cut_dichroic_uvb(cpl_frame* frame1d);
110#endif /* XSH_DATA_SPECTRUM_H */
static float slit_step
static float lambda_step
int xsh_spectrum_get_size_lambda(xsh_spectrum *s)
Get lambda axis size of spectrum.
double xsh_spectrum_get_lambda_min(xsh_spectrum *s)
Get minimum lambda of spectrum.
xsh_spectrum * xsh_spectrum_load(cpl_frame *s1d_frame)
Load a 1D spectrum structure.
double * xsh_spectrum_get_errs(xsh_spectrum *s)
Get errs of spectrum.
cpl_image * xsh_spectrum_get_errs_ima(xsh_spectrum *s)
Get flux of spectrum as image.
double xsh_spectrum_get_lambda_step(xsh_spectrum *s)
Get bin in lambda of spectrum.
cpl_error_code xsh_spectrum_cut_dichroic_uvb(cpl_frame *frame1d)
cpl_frame * xsh_phys_spectrum_save(xsh_spectrum *s, const char *filename, xsh_instrument *instr)
save a spectrum
xsh_spectrum * xsh_spectrum_load_order(cpl_frame *s1d_frame, xsh_instrument *instr, const int order)
Load a 1D spectrum structure.
int * xsh_spectrum_get_qual(xsh_spectrum *s)
Get qual of spectrum.
int xsh_spectrum_get_size(xsh_spectrum *s)
Get size of spectrum.
xsh_spectrum * xsh_spectrum_duplicate(xsh_spectrum *org)
cpl_frame * xsh_spectrum_save(xsh_spectrum *s, const char *filename, const char *tag)
save a spectrum
cpl_error_code xsh_spectrum_orders_cut_dichroic_uvb(cpl_frame *frame1d, xsh_instrument *instr)
cpl_frame * xsh_spectrum_save_order(xsh_spectrum *s, const char *filename, const char *tag, const int order)
save a spectrum
cpl_image * xsh_spectrum_get_flux_ima(xsh_spectrum *s)
Get flux of spectrum as image.
double * xsh_spectrum_get_flux(xsh_spectrum *s)
Get flux of spectrum.
xsh_spectrum * xsh_spectrum_extract_range(xsh_spectrum *org, const double wmin, const double wmax)
cpl_image * xsh_spectrum_get_qual_ima(xsh_spectrum *s)
Get flux of spectrum as image.
xsh_spectrum * xsh_spectrum_2D_create(double lambda_min, double lambda_max, double lambda_step, double slit_min, double slit_max, double slit_step)
Create a 2D spectrum structure.
xsh_spectrum * xsh_spectrum_1D_create(double lambda_min, double lambda_max, double lambda_step)
Create a 1D spectrum structure.
double xsh_spectrum_get_lambda_max(xsh_spectrum *s)
Get maximum lambda of spectrum.
void xsh_spectrum_free(xsh_spectrum **list)
free memory associated to an 1D spectrum
int xsh_spectrum_get_size_slit(xsh_spectrum *s)
Get slit axis ize of spectrum.
static SimAnneal s
Definition: xsh_model_sa.c:99
cpl_propertylist * errs_header
cpl_propertylist * flux_header
cpl_image * flux
cpl_propertylist * qual_header
cpl_image * qual
cpl_image * errs
int order
Definition: xsh_detmon_lg.c:80