MUSE Pipeline Reference Manual  2.1.1
muse_lsf.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_LSF_H
23 #define MUSE_LSF_H
24 
25 /*----------------------------------------------------------------------------*
26  * Includes *
27  *----------------------------------------------------------------------------*/
28 #include <cpl.h>
29 
30 #include "muse_cplwrappers.h"
31 #include "muse_pixtable.h"
32 #include "muse_processing.h"
33 #include "muse_wcs.h"
34 
35 /*----------------------------------------------------------------------------*
36  * Special variable types *
37  *----------------------------------------------------------------------------*/
41 /*----------------------------------------------------------------------------*/
48 /*----------------------------------------------------------------------------*/
49 typedef struct {
51  cpl_propertylist *header; /* this has to be the first component! */
53  cpl_imagelist *img;
57 
58 /*----------------------------------------------------------------------------*
59  * Function prototypes *
60  *----------------------------------------------------------------------------*/
61 muse_pixtable *muse_lsf_create_arcpixtable(muse_imagelist *, cpl_table *, cpl_table *, cpl_table *, int, double);
62 cpl_error_code muse_lsf_fit_slice(const muse_pixtable *, cpl_image *, muse_wcs *, double);
63 
64 muse_lsf_cube *muse_lsf_cube_new(double, cpl_size, cpl_size, const cpl_propertylist *);
66 cpl_error_code muse_lsf_cube_save(muse_lsf_cube *, const char *);
67 muse_lsf_cube *muse_lsf_cube_load(const char *, unsigned char);
70 
71 cpl_error_code muse_lsf_apply(const cpl_image *, const muse_wcs *, cpl_array *, double);
73 muse_wcs *muse_lsf_cube_get_wcs_all(muse_lsf_cube **);
74 cpl_error_code muse_lsf_fold_rectangle(cpl_image *, const muse_wcs *, double);
75 
78 #endif /* MUSE_LSF_H */
Structure definition for a collection of muse_images.
muse_wcs * wcs
Common WCS information for each slice.
Definition: muse_lsf.h:55
cpl_propertylist * header
Primary header used to save the LSF cube to disk.
Definition: muse_lsf.h:51
A structure containing a spatial two-axis WCS.
Definition: muse_wcs.h:105
cpl_image * muse_lsf_average_cube_all(muse_lsf_cube **aLsfCube, muse_pixtable *aPixtable)
Create an average image from all LSF cubes.
Data cube/stacked image list containing the LSF for one IFU.
Definition: muse_lsf.h:49
muse_lsf_cube * muse_lsf_cube_new(double aLsfHalfRange, cpl_size aNLsf, cpl_size aNLambda, const cpl_propertylist *aHeader)
Create a new LSF datacube.
cpl_error_code muse_lsf_cube_save(muse_lsf_cube *aLsfCube, const char *aFileName)
Save the LSF cube to disk.
muse_lsf_cube * muse_lsf_cube_load(const char *aFileName, unsigned char aIFU)
Load a LSF cube for one single IFU from disk.
Structure definition of MUSE pixel table.
muse_lsf_cube ** muse_lsf_cube_load_all(muse_processing *aProcessing)
Load all LSF cubes for all IFUs into an array.
cpl_error_code muse_lsf_apply(const cpl_image *aLsfImage, const muse_wcs *aWCS, cpl_array *aVal, double aLambda)
Apply the LSF to a number of data points of one slice.
void muse_lsf_cube_delete_all(muse_lsf_cube **aLsfCube)
Delete all LSF cubes.
muse_pixtable * muse_lsf_create_arcpixtable(muse_imagelist *aImages, cpl_table *aTrace, cpl_table *aWave, cpl_table *aArcLines, int aQuality, double aWindow)
Read images and combine the arc lines into one pixtable.
cpl_error_code muse_lsf_fold_rectangle(cpl_image *aLsfImage, const muse_wcs *aWCS, double aBinWidth)
Filter an LSF image with a rectangle to model spectrum binning.
void muse_lsf_cube_delete(muse_lsf_cube *aLsfCube)
Deallocate the memory for the LSF cube.
cpl_imagelist * img
Stacked image list for LSF; one per slice.
Definition: muse_lsf.h:53
cpl_error_code muse_lsf_fit_slice(const muse_pixtable *aPixtable, cpl_image *aLsfImage, muse_wcs *aWCS, double aLsfRegressionWindow)
Compute the LSF for all wavelengths of one slice.