ERIS Pipeline Reference Manual 1.8.15
eris_ifu_lambda_corr.h
1/* $Id: eris_ifu_priv_lcorr.h,v 1.8 2013-09-16 13:40:02 aagudo Exp $
2 *
3 * This file is part of the ERIS Pipeline
4 * Copyright (C) 2002,2003 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/*
22 * $Author: aagudo $
23 * $Date: 2013-09-16 13:40:02 $
24 * $Revision: 1.8 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef ERIS_IFU_LAMBDA_CORR_H
29#define ERIS_IFU_LAMBDA_CORR_H
30
31/*-----------------------------------------------------------------------------
32 * Includes
33 *----------------------------------------------------------------------------*/
34
35#include <stdio.h>
36#include <string.h>
37#include <cpl.h>
38#include "eris_ifu_utils.h"
39
40/*-----------------------------------------------------------------------------
41 * Types
42 *-----------------------------------------------------------------------------*/
43
44/*------------------------------------------------------------------------------
45 * Prototypes
46 *----------------------------------------------------------------------------*/
47
48cpl_polynomial *eris_ifu_lcorr_get(cpl_imagelist *cube, hdrl_imagelist *hdrlCube,
49 const cpl_propertylist *header,
50 cpl_vector *peaks, const int pfit_order);
51
52cpl_bivector *eris_ifu_lcorr_extract_spectrum (const cpl_imagelist *cube,
53 const cpl_propertylist *header,
54 const double min_frac,
55 const cpl_vector *range);
56
57cpl_image *eris_ifu_lcorr_create_object_mask (const cpl_imagelist *cube,
58 double min_frac,
59 const cpl_vector *lambda,
60 const cpl_vector *range);
61
62cpl_vector *eris_ifu_lcorr_create_lambda_vector (const cpl_propertylist *header);
63
64cpl_bivector *eris_ifu_lcorr_read_OH_reference_spectrum (const char *filename,
65 cpl_size ext_number);
66
67cpl_array *eris_ifu_lcorr_get_peak_positions(const cpl_bivector *spectrum,
68 double min_frac,
69 cpl_vector *range);
70
71cpl_vector *eris_ifu_lcorr_get_peak_lambdas (const cpl_bivector *spectrum,
72 double min_frac,
73 cpl_vector *range);
74
75cpl_polynomial *eris_ifu_lcorr_crosscorrelate_spectra(cpl_bivector *object,
76 cpl_vector *peaks, ifsBand bandId, const int pfit_order);
77
78int gauss1d_fnc(const double x[], const double a[], double *result);
79int gauss1d_fncd(const double x[], const double a[], double result[]);
80double fit_peak (const cpl_bivector *spectrum, const cpl_size size, double lambda_in, int half_width, double *sigma_par);
81void eris_ifu_lcorr_open_debug_file(const char *filename);
83
84#endif
cpl_image * eris_ifu_lcorr_create_object_mask(const cpl_imagelist *cube, double min_frac, const cpl_vector *lambda, const cpl_vector *range)
Create spaxel selection mask for spectrum extraction.
cpl_bivector * eris_ifu_lcorr_extract_spectrum(const cpl_imagelist *cube, const cpl_propertylist *header, const double min_frac, const cpl_vector *range)
Extract integrated spectrum from IFU cube for brightest spaxels.
cpl_polynomial * eris_ifu_lcorr_get(cpl_imagelist *cube, hdrl_imagelist *hdrlCube, const cpl_propertylist *header, cpl_vector *peaks, const int pfit_order)
Create wavelength correction polynomial from IFU cube using OH lines.
void eris_ifu_lcorr_close_debug_file(void)
close ASCII file that hold debug results
cpl_vector * eris_ifu_lcorr_create_lambda_vector(const cpl_propertylist *header)
Create wavelength vector from FITS header WCS keywords.
void eris_ifu_lcorr_open_debug_file(const char *filename)
open ASCII file to hold debug results
cpl_array * eris_ifu_lcorr_get_peak_positions(const cpl_bivector *spectrum, double min_frac, cpl_vector *range)
Detect emission line peak positions in a spectrum.
int gauss1d_fncd(const double x[], const double a[], double result[])
define a Gaussian profile
cpl_vector * eris_ifu_lcorr_get_peak_lambdas(const cpl_bivector *spectrum, double min_frac, cpl_vector *range)
Detect and refine emission line peak wavelengths using Gaussian fitting.
double fit_peak(const cpl_bivector *spectrum, const cpl_size size, double lambda_in, int half_width, double *sigma_par)
fit a peak
int gauss1d_fnc(const double x[], const double a[], double *result)
define a Gaussian profile
cpl_polynomial * eris_ifu_lcorr_crosscorrelate_spectra(cpl_bivector *object, cpl_vector *peaks, ifsBand bandId, const int pfit_order)
cross-correlate two input spectra
cpl_bivector * eris_ifu_lcorr_read_OH_reference_spectrum(const char *filename, cpl_size ext_number)
Read OH reference spectrum from FITS file.