MUSE Pipeline Reference Manual
1.0.2
|
Data Structures | |
struct | muse_lsf_params |
Structure definition of detector (slice) parameters. More... | |
Functions | |
static cpl_error_code | muse_lsf_line_apply (const cpl_array *aLambda, cpl_array *aSpectrum, const muse_lsf_params *aLsf, double aLineLambda, double aLineFlux) |
Apply the MUSE LSF function to a single line. More... | |
muse_lsf_params * | muse_lsf_params_new (cpl_size n_sensit, cpl_size n_lsf_width, cpl_size n_hermit) |
Create a new lsf_params structure. More... | |
cpl_size | muse_lsf_params_get_size (muse_lsf_params **aParams) |
Count the number of entries in the array. More... | |
void | muse_lsf_params_delete_one (muse_lsf_params *aParams) |
Delete an allocated muse_lsf_params structure. More... | |
void | muse_lsf_params_delete (muse_lsf_params **aParams) |
Delete an allocated array of muse_lsf_params structure. More... | |
cpl_error_code | muse_lsf_params_save (const muse_lsf_params **aLsf, const char *aFile) |
Save slice LSF parameters to the extension "slice" on disk. More... | |
muse_lsf_params ** | muse_lsf_params_load (const char *aFile, muse_lsf_params **aParams, int aIFU) |
Load slice LSF parameters from the extension "SLICE_PARAM". More... | |
muse_lsf_params ** | muse_processing_lsf_params_load (muse_processing *aProcessing, int aIFU) |
Load slice LSF parameters. More... | |
muse_lsf_params * | muse_lsf_params_get (muse_lsf_params **aParams, int aIFU, int aSlice) |
Get the slice LSF parameters for one slice. More... | |
static cpl_array * | muse_lsf_G (cpl_array *aX, cpl_array *aCoeffs) |
Helper function "G" for integrated damped gauss-hermitean function. More... | |
cpl_array * | muse_lsf_spectrum_get_lines (const cpl_array *aLambda, const cpl_array *aLinesLambda, const cpl_array *aLinesFlux, const muse_lsf_params *aLsf) |
Set the lines spectrum from the lines table and the detector LSF. More... | |
double | muse_lsf_fwhm_lambda (const muse_lsf_params *aDP, double aLambda, double aFlux, double aSampling, unsigned int aLength, FILE *aOutstream) |
Measure the FWHM of an LSF at a given wavelength. More... | |
Variables | |
const muse_cpltable_def | muse_lsfparams_def [] |
Definition of a lsf parameters table. More... | |
double muse_lsf_fwhm_lambda | ( | const muse_lsf_params * | aDP, |
double | aLambda, | ||
double | aFlux, | ||
double | aSampling, | ||
unsigned int | aLength, | ||
FILE * | aOutstream | ||
) |
Measure the FWHM of an LSF at a given wavelength.
aDP | the LSF parameters (for one IFU and slice) |
aLambda | wavelength at which to evaluate the LSF |
aFlux | flux of the line to distribute |
aSampling | sampling of the spectrum in Angstrom |
aLength | length of spectrum in pixels |
aOutstream | file pointer for verbose output (can be NULL) |
This function creates a spectrum of given aLength with given resolution (aSampling), fills it with a line with given flux (aFlux) at the given wavelength aLambda. This spectrum is then used to measures peak intensity, searches for the position where the intensity reaches half the peak, to derive the FWHM from this. If aOutstream is not NULL, debug output about the parameters and measurement values is written to this file pointer.
set CPL_ERROR_NULL_INPUT, return 0. | aDP is NULL |
set CPL_ERROR_ILLEGAL_INPUT, return 0. | aDP contains lsf_width of zero or one |
set CPL_ERROR_ILLEGAL_OUTPUT, return 0. | FWHM is outside the test spectrum for the given parameters |
Definition at line 710 of file muse/muse_lsf.c.
References muse_lsf_params::bin_width, muse_lsf_params::lambda_ref, muse_lsf_params::lsf_width, muse_lsf_spectrum_get_lines(), and muse_lsf_params::slit_width.
|
static |
Helper function "G" for integrated damped gauss-hermitean function.
aX | X values array to apply |
aCoeffs | pointer to five values for the damping polynomial |
set CPL_ERROR_NULL_INPUT, return 0.0 | (aX != NULL) not fulfilled |
set CPL_ERROR_NULL_INPUT, return 0.0 | (aCoeffs != NULL) not fulfilled |
R(x) = aCoeffs[0] * x**4 + aCoeffs[1] * x**3 + aCoeffs[2] * x**2 + aCoeffs[3] * x + aCoeffs[4] G(x) = exp(-0.5 * x**2) + R(x) * exp(-x**2) / 60 + x * sqrt(Pi/2) * erf(x * sqrt(0.5))
Definition at line 490 of file muse/muse_lsf.c.
References muse_cplarray_erf(), muse_cplarray_exp(), and muse_cplarray_poly1d().
Referenced by muse_lsf_line_apply().
|
static |
Apply the MUSE LSF function to a single line.
aLambda | Wavelength bins [Angstrom] |
aSpectrum | Spectrum to add the line |
aLsf | LSF parameters |
aLineLambda | Line wavelength |
aLineFlux | Line flux |
CPL_ERROR_NONE | Everything went OK |
CPL_ERROR_NULL_INPUT | (aSpectrum != NULL) not fulfilled |
CPL_ERROR_NULL_INPUT | (aParam != NULL) not fulfilled |
CPL_ERROR_DATA_NOT_FOUND | (cpl_table_has_column(aSpectrum, "lines")) not fulfilled |
x = (aLambda - aLineLambda) / aLsf.width slit_width = aLsf.slit_width / aLsf.width bin_width = aLsf.bin_width / aLsf.width y = G(x + slit_width/2 + bin_width/2) - G(x - slit_width/2 + bin_width/2) - G(x + slit_width/2 - bin_width/2) + G(x - slit_width/2 - bin_width/2) spectrum += y * aLineFlux
Definition at line 549 of file muse/muse_lsf.c.
References muse_lsf_params::bin_width, muse_lsf_params::hermit, muse_lsf_params::lambda_ref, muse_lsf_params::lsf_width, muse_cplarray_add_window(), muse_cplarray_find_sorted(), muse_cplarray_poly1d_double(), muse_lsf_G(), and muse_lsf_params::slit_width.
Referenced by muse_lsf_spectrum_get_lines().
void muse_lsf_params_delete | ( | muse_lsf_params ** | aParams | ) |
Delete an allocated array of muse_lsf_params structure.
aParams | Structure to delete. |
Definition at line 148 of file muse/muse_lsf.c.
References muse_lsf_params_delete_one().
Referenced by muse_sky_master_delete().
void muse_lsf_params_delete_one | ( | muse_lsf_params * | aParams | ) |
Delete an allocated muse_lsf_params structure.
aParams | Structure to delete. |
Definition at line 129 of file muse/muse_lsf.c.
References muse_lsf_params::hermit, muse_lsf_params::lsf_width, and muse_lsf_params::sensitivity.
Referenced by muse_lsf_params_delete(), muse_lsf_params_fit(), muse_sky_lsf_params_fit(), and muse_sky_slice_apply_lsf_parametrization().
muse_lsf_params* muse_lsf_params_get | ( | muse_lsf_params ** | aParams, |
int | aIFU, | ||
int | aSlice | ||
) |
Get the slice LSF parameters for one slice.
Definition at line 458 of file muse/muse_lsf.c.
Referenced by muse_sky_subtract_pixtable().
cpl_size muse_lsf_params_get_size | ( | muse_lsf_params ** | aParams | ) |
Count the number of entries in the array.
aParams | LSF parameter array |
Definition at line 111 of file muse/muse_lsf.c.
Referenced by muse_lsf_params_load().
muse_lsf_params** muse_lsf_params_load | ( | const char * | aFile, |
muse_lsf_params ** | aParams, | ||
int | aIFU | ||
) |
Load slice LSF parameters from the extension "SLICE_PARAM".
aFile | File name (file must exist, is written as extension) |
aParams | NULL-terminated array of LSF parameters to append to, or NULL. |
aIFU | the IFU/channel number, or 0 for all IFUs/channels |
The extension "SLICE_PARAM" (or "CHANnn.SLICE_PARAM") is expected to be a table with the slice dependent LSF parameters.
Definition at line 309 of file muse/muse_lsf.c.
References muse_lsf_params::bin_width, muse_lsf_params::hermit, muse_lsf_params::lsf_width, muse_cpltable_get_array_copy(), muse_cpltable_load(), muse_lsf_params_get_size(), muse_lsf_params_new(), muse_lsf_params::sensitivity, and muse_lsf_params::slit_width.
Referenced by muse_processing_lsf_params_load(), and muse_sky_master_load().
muse_lsf_params* muse_lsf_params_new | ( | cpl_size | n_sensit, |
cpl_size | n_lsf_width, | ||
cpl_size | n_hermit | ||
) |
Create a new lsf_params structure.
n_sensit | Order of polynomial sensitivity parametrization. |
n_lsf_width | Order of polynomial lsf width parametrization. |
n_hermit | Order of polynomial parametrization of hermitean coefficients. |
All polynomial parametrizations are meant as wavelength dependent.
Definition at line 75 of file muse/muse_lsf.c.
References muse_lsf_params::bin_width, muse_lsf_params::hermit, muse_lsf_params::lambda_ref, muse_lsf_params::lsf_width, muse_lsf_params::sensitivity, and muse_lsf_params::slit_width.
Referenced by muse_lsf_params_fit(), muse_lsf_params_load(), muse_sky_lsf_params_fit(), and muse_sky_slice_apply_lsf_parametrization().
cpl_error_code muse_lsf_params_save | ( | const muse_lsf_params ** | aLsf, |
const char * | aFile | ||
) |
Save slice LSF parameters to the extension "slice" on disk.
aLsf | NULL-terminated array of LSF parameters. |
aFile | File name (file must exist, is written as extension) |
CPL_ERROR_NONE | if everything went OK |
CPL_ERROR_NULL_INPUT | (aLsf != NULL) not fulfilled |
CPL_ERROR_DATA_NOT_FOUND | (*aLsf != NULL) not fulfilled |
CPL_ERROR_NULL_INPUT | (aFile != NULL) not fulfilled |
The slice parameters are converted to a table structure:
ifu
: IFU numberslice
: slice number within the IFUsensitivity
sensitivity, relative to the referencelsf_width
: LSF gauss-hermitean width [Angstrom]hermit3
: 3rd order hermitean coefficienthermit4
: 4th order hermitean coefficienthermit5
: 5th order hermitean coefficienthermit6
: 6th order hermitean coefficient Definition at line 215 of file muse/muse_lsf.c.
References muse_cpltable_append_file().
cpl_array* muse_lsf_spectrum_get_lines | ( | const cpl_array * | aLambda, |
const cpl_array * | aLinesLambda, | ||
const cpl_array * | aLinesFlux, | ||
const muse_lsf_params * | aLsf | ||
) |
Set the lines spectrum from the lines table and the detector LSF.
aLambda | Wavelength bins |
aLinesLambda | Array with lines wavelengths |
aLinesFlux | Array with lines fluxes |
aLsf | LSF parameters |
set CPL_ERROR_NULL_INPUT, return NULL | (aSpectrum != NULL) not fulfilled |
set CPL_ERROR_NULL_INPUT, return NULL | (aLines != NULL) not fulfilled |
set CPL_ERROR_NULL_INPUT, return NULL | (aLsf != NULL) not fulfilled |
spectrum = 0 for line in aLines: spectrum += muse_lsf_line_apply(aLsf, line.lambda, line.flux) return spectrum
Definition at line 655 of file muse/muse_lsf.c.
References muse_lsf_line_apply().
Referenced by muse_lsf_fwhm_lambda(), muse_lsf_params_fit(), and muse_sky_apply_lsf().
muse_lsf_params** muse_processing_lsf_params_load | ( | muse_processing * | aProcessing, |
int | aIFU | ||
) |
Load slice LSF parameters.
aProcessing | the processing structure |
aIFU | the IFU/channel number, or 0 for all IFUs/channels |
set CPL_ERROR_NULL_INPUT, return NULL | invalid processing pointer |
propagate CPL error code, return NULL | LST_TABLE frame not found in input frameset of the processing structure |
The input files must be tables with the slice dependent LSF parameters.
Definition at line 393 of file muse/muse_lsf.c.
References muse_processing::inframes, muse_frameset_find(), muse_lsf_params_load(), and muse_processing_append_used().
const muse_cpltable_def muse_lsfparams_def[] |
Definition of a lsf parameters table.
ifu
: IFU numberslice
: slice number within the IFUsensitivity
sensitivity, relative to the referencelsf_width
: LSF gauss-hermitean width [Angstrom]hermit3
: 3rd order hermitean coefficienthermit4
: 4th order hermitean coefficienthermit5
: 5th order hermitean coefficienthermit6
: 6th order hermitean coefficient Definition at line 173 of file muse/muse_lsf.c.