High-Level Data Reduction Library 1.6.0
High-Level data reduction routines for ESO pipelines
Loading...
Searching...
No Matches
Hdrl_response

Functions

hdrl_parameterhdrl_response_telluric_evaluation_parameter_create (const hdrl_spectrum1Dlist *telluric_models, hdrl_data_t w_step, cpl_size half_win, cpl_boolean normalize, cpl_boolean shift_in_log_scale, const cpl_bivector *quality_areas, const cpl_bivector *fit_areas, hdrl_data_t lmin, hdrl_data_t lmax)
 ctor for the hdrl_parameter for the telluric evaluation
 
hdrl_parameterhdrl_response_fit_parameter_create (const cpl_size radius, const cpl_array *fit_points, const hdrl_data_t wrange, const cpl_bivector *high_abs_regions)
 ctor for the hdrl_parameter for the final interpolation of the response
 
hdrl_response_resulthdrl_response_compute (const hdrl_spectrum1D *obs_s, const hdrl_spectrum1D *ref_s, const hdrl_spectrum1D *E_x, const hdrl_parameter *telluric_par, const hdrl_parameter *velocity_par, const hdrl_parameter *calc_par, const hdrl_parameter *fit_par)
 Computation of the response.
 
const hdrl_spectrum1Dhdrl_response_result_get_final_response (const hdrl_response_result *res)
 Getter for the final response contained inside the hdrl_response_result.
 
const hdrl_spectrum1Dhdrl_response_result_get_selected_response (const hdrl_response_result *res)
 Getter for the selected response contained inside the hdrl_response_result.
 
const hdrl_spectrum1Dhdrl_response_result_get_raw_response (const hdrl_response_result *res)
 Getter for the raw response contained inside the hdrl_response_result.
 
const hdrl_spectrum1Dhdrl_response_result_get_corrected_obs_spectrum (const hdrl_response_result *res)
 Getter for the corrected observed spectrum contained in hdrl_response_result.
 
cpl_size hdrl_response_result_get_best_telluric_model_idx (const hdrl_response_result *res)
 Getter of the index of the telluric model used for telluric correction contained in hdrl_response_result.
 
hdrl_data_t hdrl_response_result_get_avg_diff_from_1 (const hdrl_response_result *res)
 Getter of the value |mean - 1|, where mean is the average of the ratio between the corrected observed spectrum and its smoothed fit.
 
hdrl_data_t hdrl_response_result_get_stddev (const hdrl_response_result *res)
 Getter of the standard deviation of the ratio between the corrected observed spectrum and its smoothed fit.
 
hdrl_data_t hdrl_response_result_get_telluric_shift (const hdrl_response_result *res)
 Getter of the shift applied to the telluric model.
 
hdrl_data_t hdrl_response_result_get_doppler_shift (const hdrl_response_result *res)
 Getter of the doppler shift used to correct the model.
 
void hdrl_response_result_delete (hdrl_response_result *res)
 Destructor for hdrl_response_result.
 
hdrl_spectrum1Dhdrl_response_evaluate_telluric_models (const hdrl_spectrum1D *obs_s, const hdrl_parameter *ev, hdrl_data_t *telluric_shift, hdrl_data_t *mean_minus_1, hdrl_data_t *stddev, cpl_size *best_model_index)
 
hdrl_spectrum1Dhdrl_response_evaluate_telluric_model (const hdrl_spectrum1D *obs_s_arg, const hdrl_spectrum1D *telluric_s_arg, const hdrl_data_t w_step, const cpl_size half_win, const cpl_boolean normalize, const cpl_boolean shift_in_log_scale, const cpl_bivector *quality_areas, const cpl_bivector *fit_areas, const hdrl_data_t lmin, const hdrl_data_t lmax, double *mean_minus_1, double *stddev, double *telluric_shift)
 

Detailed Description

Function Documentation

◆ hdrl_response_compute()

hdrl_response_result * hdrl_response_compute ( const hdrl_spectrum1D obs_s,
const hdrl_spectrum1D ref_s,
const hdrl_spectrum1D E_x,
const hdrl_parameter telluric_par,
const hdrl_parameter velocity_par,
const hdrl_parameter calc_par,
const hdrl_parameter fit_par 
)

Computation of the response.

Parameters
obs_sObserved spectrum
ref_sReference std star spectrum
E_xAtmospheric Extinction
telluric_parTelluric correction parameter, NULL if telluric correction is skipped. See hdrl_response_telluric_evaluation_parameter_create for details.
velocity_parDoppler shift estimation and compensation. NULL if compensation has to be skipped. See hdrl_spectrum1D_shift_fit_parameter_create for more details.
calc_parParameter for the core computation of the response, e.g. exposure time. See hdrl_response_parameter_create for more details.
fit_parParameter for the final interpolation of the response, see hdrl_response_fit_parameter_create for more details.
Returns
hdrl_response_result or NULL in case of error, see below.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: if any among calc_par, fit_par or the spectra are NULL
  • CPL_ERROR_ILLEGAL_OUTPUT: Any of the algorithmical steps can fail. This usually means that the output of that step can be NULL, if that is the case we abort triggering a CPL_ERROR_ILLEGAL_OUTPUT

◆ hdrl_response_evaluate_telluric_model()

hdrl_spectrum1D * hdrl_response_evaluate_telluric_model ( const hdrl_spectrum1D obs_s_arg,
const hdrl_spectrum1D telluric_s_arg,
const hdrl_data_t  w_step,
const cpl_size  half_win,
const cpl_boolean  normalize,
const cpl_boolean  shift_in_log_scale,
const cpl_bivector *  quality_areas,
const cpl_bivector *  fit_areas,
const hdrl_data_t  lmin,
const hdrl_data_t  lmax,
double *  mean_minus_1,
double *  stddev,
double *  telluric_shift 
)

◆ hdrl_response_evaluate_telluric_models()

hdrl_spectrum1D * hdrl_response_evaluate_telluric_models ( const hdrl_spectrum1D obs_s,
const hdrl_parameter ev,
hdrl_data_t telluric_shift,
hdrl_data_t mean_minus_1,
hdrl_data_t stddev,
cpl_size *  best_model_index 
)

◆ hdrl_response_fit_parameter_create()

hdrl_parameter * hdrl_response_fit_parameter_create ( const cpl_size  radius,
const cpl_array *  fit_points,
const hdrl_data_t  wrange,
const cpl_bivector *  high_abs_regions 
)

ctor for the hdrl_parameter for the final interpolation of the response

Parameters
radiusRadius of the median filter used to smooth the response before the final interpolation
fit_pointsMedian points where the fit will be calculated
wrangeRange around the median point where the median is calculated
high_abs_regionsHigh absorption regions that should be skipped when calculating the fit. If NULL no skipping is done.
Returns
hdrl_parameter or NULL in case of error, see below.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: if any of the required pointers are NULL
  • CPL_ERROR_ILLEGAL_INPUT: radius or wrange is less or equal 0

◆ hdrl_response_result_delete()

void hdrl_response_result_delete ( hdrl_response_result res)

Destructor for hdrl_response_result.

Parameters
reshdrl_response_result to be destroyed

◆ hdrl_response_result_get_avg_diff_from_1()

hdrl_data_t hdrl_response_result_get_avg_diff_from_1 ( const hdrl_response_result res)

Getter of the value |mean - 1|, where mean is the average of the ratio between the corrected observed spectrum and its smoothed fit.

Parameters
reshdrl_response_result
Returns
the value |mean - 1|, where mean is the average of the ratio between the corrected observed spectrum and its smoothed fit. This value can be used to assess the quality of the match of the telluric model with the provided observed spectrum. If telluric correction was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_best_telluric_model_idx()

cpl_size hdrl_response_result_get_best_telluric_model_idx ( const hdrl_response_result res)

Getter of the index of the telluric model used for telluric correction contained in hdrl_response_result.

Parameters
reshdrl_response_result
Returns
the index (0-based) of the telluric model used for telluric correction. If telluric correction was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_corrected_obs_spectrum()

const hdrl_spectrum1D * hdrl_response_result_get_corrected_obs_spectrum ( const hdrl_response_result res)

Getter for the corrected observed spectrum contained in hdrl_response_result.

Parameters
reshdrl_response_result
Returns
the observed spectrum corrected by the telluric model. If telluric correction was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_doppler_shift()

hdrl_data_t hdrl_response_result_get_doppler_shift ( const hdrl_response_result res)

Getter of the doppler shift used to correct the model.

Parameters
reshdrl_response_result
Returns
the doppler shift used to correct the model. If doppler corection was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_final_response()

const hdrl_spectrum1D * hdrl_response_result_get_final_response ( const hdrl_response_result res)

Getter for the final response contained inside the hdrl_response_result.

Parameters
reshdrl_response_result
Returns
response or NULL in case of error. The final response is the final product of the algorithm.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_raw_response()

const hdrl_spectrum1D * hdrl_response_result_get_raw_response ( const hdrl_response_result res)

Getter for the raw response contained inside the hdrl_response_result.

Parameters
reshdrl_response_result
Returns
the raw response or NULL in case of error. The raw response is the ratio between the observed spectrum and the reference one, corrected for e.g. gain, atmospheric extinction, etc.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_selected_response()

const hdrl_spectrum1D * hdrl_response_result_get_selected_response ( const hdrl_response_result res)

Getter for the selected response contained inside the hdrl_response_result.

Parameters
reshdrl_response_result
Returns
selected response or NULL in case of error. The selected response is the raw response sampled in the fit points. This response is going then to be interpolated, creating the final response.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_stddev()

hdrl_data_t hdrl_response_result_get_stddev ( const hdrl_response_result res)

Getter of the standard deviation of the ratio between the corrected observed spectrum and its smoothed fit.

Parameters
reshdrl_response_result
Returns
the standard deviation of the ratio between the corrected observed spectrum and its smoothed fit. This value can be used to assess the quality of the match of the telluric model with the provided observed spectrum. If telluric correction was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_result_get_telluric_shift()

hdrl_data_t hdrl_response_result_get_telluric_shift ( const hdrl_response_result res)

Getter of the shift applied to the telluric model.

Parameters
reshdrl_response_result
Returns
shift applied to the selected telluric model. This value can be used to assess the quality of the match of the telluric model with the provided observed spectrum. If telluric correction was disabled the output of this function is not defined.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: res is NULL

◆ hdrl_response_telluric_evaluation_parameter_create()

hdrl_parameter * hdrl_response_telluric_evaluation_parameter_create ( const hdrl_spectrum1Dlist telluric_models,
hdrl_data_t  w_step,
cpl_size  half_win,
cpl_boolean  normalize,
cpl_boolean  shift_in_log_scale,
const cpl_bivector *  quality_areas,
const cpl_bivector *  fit_areas,
hdrl_data_t  lmin,
hdrl_data_t  lmax 
)

ctor for the hdrl_parameter for the telluric evaluation

Parameters
telluric_modelsThe available telluric models
w_stepSampling step to use when upsampling model and observed spectrum to calculate the cross correlations
half_winHalf the search window to be used to find the peak of the cross correlation
normalizeCPL_TRUE if the cross correlation should be normalized, CPL_FALSE otherwise
shift_in_log_scaleCPL_TRUE if the cross correlation has to be calculated in logarithmic scale. CPL_FALSE otherwise.
quality_areasAreas where the quality of the fit of the telluric model has to be evaluated.
fit_areasAreas where the median points are extracted from, in order to generate the final quality parameters of the telluric model
lminMinimum wavelength used to calculate the cross-correlation (in log scale if shift_in_log_scale = TRUE)
lmaxMaximum wavelength used to calculate the cross-correlation (in log scale if shift_in_log_scale = TRUE)
Returns
hdrl_parameter or NULL in case of error, see below.

Possible cpl-error-code set in this function:

  • CPL_ERROR_NULL_INPUT: if any of the pointers are NULL
  • CPL_ERROR_ILLEGAL_INPUT: if w_step <= 0 or half_win <= 0 or lmin >= lmax