|
ERIS Pipeline Reference Manual 1.8.10
|
Functions | |
| cpl_polynomial * | eris_ifu_lcorr_get (cpl_imagelist *cube, hdrl_imagelist *hdrlCube, const cpl_propertylist *header, cpl_vector *peaks, const int pfit_order) |
| Main function to create the lcal-correction. | |
| cpl_bivector * | eris_ifu_lcorr_extract_spectrum (const cpl_imagelist *cube, const cpl_propertylist *header, const double min_frac, const cpl_vector *range) |
| Creates a vector containing the spectrum of all marked spaxels. | |
| cpl_image * | eris_ifu_lcorr_create_object_mask (const cpl_imagelist *cube, double min_frac, const cpl_vector *lambda, const cpl_vector *range) |
| Creates a mask of the cube. | |
| cpl_vector * | eris_ifu_lcorr_create_lambda_vector (const cpl_propertylist *header) |
| Creates a wavelength vector from an input cube. | |
| cpl_bivector * | eris_ifu_lcorr_read_OH_reference_spectrum (const char *filename, cpl_size ext_number) |
| Creates a spectrum bivector (x: lambda) from an input FITS file. | |
| cpl_array * | eris_ifu_lcorr_get_peak_positions (const cpl_bivector *spectrum, double min_frac, cpl_vector *range) |
| Get peaks of position of lines used in wavelength calibration. | |
| cpl_vector * | eris_ifu_lcorr_get_peak_lambdas (const cpl_bivector *spectrum, double min_frac, cpl_vector *range) |
| Get peaks of position of lines used in wavelength calibration. | |
| int | gauss1d_fnc (const double x[], const double a[], double *result) |
| define a Gaussian profile | |
| int | gauss1d_fncd (const double x[], const double a[], double result[]) |
| define a Gaussian profile | |
| double | fit_peak (const cpl_bivector *spectrum, const cpl_size size, double lambda_in, int half_width, double *sigma_par) |
| fit a peak | |
| cpl_polynomial * | eris_ifu_lcorr_crosscorrelate_spectra (cpl_bivector *object, cpl_vector *peaks, ifsBand bandId, const int pfit_order) |
| cross-correlate two input spectra | |
| void | eris_ifu_lcorr_open_debug_file (const char *filename) |
| open ASCII file to hold debug results | |
| void | eris_ifu_lcorr_close_debug_file (void) |
| close ASCII file that hold debug results | |
| void eris_ifu_lcorr_close_debug_file | ( | void | ) |
close ASCII file that hold debug results
Definition at line 1384 of file eris_ifu_lambda_corr.c.
| cpl_vector * eris_ifu_lcorr_create_lambda_vector | ( | const cpl_propertylist * | header | ) |
Creates a wavelength vector from an input cube.
Using the WCS properties of the third axis a lambda vector is created.
| header | propertylist property list of input cube |
The returned vector has to be deallocated with cpl_vector_delete().
Definition at line 408 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_NULL, CATCH, CATCH_MSG, and TRY.
Referenced by eris_ifu_lcorr_extract_spectrum(), and eris_ifu_sky_tweak().
| cpl_image * eris_ifu_lcorr_create_object_mask | ( | const cpl_imagelist * | cube, |
| double | min_frac, | ||
| const cpl_vector * | lambda, | ||
| const cpl_vector * | range | ||
| ) |
Creates a mask of the cube.
For every spaxel an averaged (using median) flux is calculated. If both a lambda vector and wavelength range(s) are specified only those ranges are considered.
Both the lambda vector and the wavelength range vector must be specified or must be NULL.
Each entry in the lambda vector corresponds to the same index in the z-axis of the cube. So the lambda vector must have the same number of elements than the number of images in the cube.
The wavelength range vector contains one or more ranges as a sequence of value pairs: lower range value (inclusive), upper range value (inclusive)
| cube | input cube |
| min_frac | fraction of spaxels sorted according the average flux to be used |
| lambda | wavelength vector, each entry corresponds to the z-direction of the input cube or NULL |
| range | wavelength ranges to be considered or NULL |
The returned image has to be deallocated with cpl_image_delete().
Definition at line 258 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, eris_ifu_mask_nans_in_cube(), and TRY.
Referenced by eris_ifu_lcorr_extract_spectrum(), eris_ifu_plot_cube_background(), and eris_ifu_sky_tweak().
| cpl_polynomial * eris_ifu_lcorr_crosscorrelate_spectra | ( | cpl_bivector * | object, |
| cpl_vector * | peaks, | ||
| ifsBand | bandId, | ||
| const int | pfit_order | ||
| ) |
cross-correlate two input spectra
| object | input spectrum |
| peaks | peaks |
| bandId | band setup |
| pfit_order |
Definition at line 1090 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, CHECK_ERROR_STATE, eris_ifu_get_band_resolution(), fit_peak(), and TRY.
Referenced by eris_ifu_lcorr_get().
| cpl_bivector * eris_ifu_lcorr_extract_spectrum | ( | const cpl_imagelist * | cube, |
| const cpl_propertylist * | header, | ||
| const double | min_frac, | ||
| const cpl_vector * | range | ||
| ) |
Creates a vector containing the spectrum of all marked spaxels.
| cube | input cube |
| header | input fits header |
| min_frac | minimum fraction |
| range | wavelength ranges to be considered or NULL |
The returned bi-vector has to be deallocated with cpl_vector_delete().
Definition at line 184 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, eris_ifu_lcorr_create_lambda_vector(), eris_ifu_lcorr_create_object_mask(), and TRY.
Referenced by eris_ifu_lcorr_get().
| cpl_polynomial * eris_ifu_lcorr_get | ( | cpl_imagelist * | cube, |
| hdrl_imagelist * | hdrlCube, | ||
| const cpl_propertylist * | header, | ||
| cpl_vector * | peaks, | ||
| const int | pfit_order | ||
| ) |
Main function to create the lcal-correction.
| cube | input data cube |
| hdrlCube | the header of cube |
| header | the header of cube |
| peaks | vector with the found peaks |
| pfit_order | order of polynomial fit |
The returned polynomial has to be deallocated with cpl_polynomial_delete().
Definition at line 61 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, CATCH, CHECK_ERROR_STATE, eris_ifu_get_band(), eris_ifu_lcorr_crosscorrelate_spectra(), eris_ifu_lcorr_extract_spectrum(), eris_ifu_mask_nans_in_cube(), hdrl_image_get_image(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), and TRY.
| cpl_vector * eris_ifu_lcorr_get_peak_lambdas | ( | const cpl_bivector * | spectrum, |
| double | min_frac, | ||
| cpl_vector * | range | ||
| ) |
Get peaks of position of lines used in wavelength calibration.
| spectrum | File name of input FITS file holding the reference spectrum |
| min_frac | minimum fraction |
| range | wavelength ranges to be considered or NULL |
The returned bivector has to be deallocated with cpl_bivector_delete().
Definition at line 680 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, BRK_WITH_ERROR, CATCH, CHECK_ERROR_STATE, eris_ifu_free_int_array(), eris_ifu_free_vector(), eris_ifu_lcorr_get_peak_positions(), fit_peak(), and TRY.
| cpl_array * eris_ifu_lcorr_get_peak_positions | ( | const cpl_bivector * | spectrum, |
| double | min_frac, | ||
| cpl_vector * | range | ||
| ) |
Get peaks of position of lines used in wavelength calibration.
| spectrum | File name of input FITS file holding the reference spectrum |
| min_frac | minimum fraction |
| range | wavelength ranges to be considered or NULL |
The returned bivector has to be deallocated with cpl_bivector_delete().
Definition at line 562 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, and TRY.
Referenced by eris_ifu_lcorr_get_peak_lambdas().
| void eris_ifu_lcorr_open_debug_file | ( | const char * | filename | ) |
open ASCII file to hold debug results
| filename | input filename |
Definition at line 1374 of file eris_ifu_lambda_corr.c.
| cpl_bivector * eris_ifu_lcorr_read_OH_reference_spectrum | ( | const char * | filename, |
| cpl_size | ext_number | ||
| ) |
Creates a spectrum bivector (x: lambda) from an input FITS file.
Reads a spectrum from a FITS file. If lambda is specified the spectrum is mapped on the specified lambda values using cubic splines. Otherwise the native lambda resolution is returned.
| filename | File name of input FITS file holding the reference spectrum |
| ext_number | extension number |
The returned bivector has to be deallocated with cpl_bivector_delete().
Definition at line 468 of file eris_ifu_lambda_corr.c.
References ASSURE, BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.
| double fit_peak | ( | const cpl_bivector * | spectrum, |
| const cpl_size | size, | ||
| double | lambda_in, | ||
| int | half_width, | ||
| double * | sigma_par | ||
| ) |
fit a peak
| spectrum | input spectrum |
| size | size of input spectrum |
| lambda_in | input lambda near which peak is found |
| half_width | input half_with of range where fit is done |
| sigma_par | output sigma |
Definition at line 963 of file eris_ifu_lambda_corr.c.
References gauss1d_fnc(), and gauss1d_fncd().
Referenced by eris_ifu_lcorr_crosscorrelate_spectra(), and eris_ifu_lcorr_get_peak_lambdas().
| int gauss1d_fnc | ( | const double | x[], |
| const double | a[], | ||
| double * | result | ||
| ) |
define a Gaussian profile
| x | File name of input FITS file holding the reference spectrum |
| a | minimum fraction |
| result | Gaussian profile |
Definition at line 891 of file eris_ifu_lambda_corr.c.
Referenced by fit_peak().
| int gauss1d_fncd | ( | const double | x[], |
| const double | a[], | ||
| double | result[] | ||
| ) |
define a Gaussian profile
| x | File name of input FITS file holding the reference spectrum |
| a | minimum fraction |
| result | Gaussian profile |
Definition at line 920 of file eris_ifu_lambda_corr.c.
Referenced by fit_peak().