Data Structures | |
struct | gauss_res |
struct | CENTROIDS_STRUCT |
struct | CENTER_ORDER |
struct | START_ORDER |
Defines | |
#define | BAD_POSITION_FLAG 999999 |
#define | THRESH_POSITION_FLAG 9999999 |
Functions | |
static cpl_error_code | xsh_fit_gaussian (xsh_detect_continuum_param *detect_param, int x, int y, int nx, float *data, float *p_errs, struct gauss_res *result, xsh_instrument *instrument, int order, double threshold) |
static cpl_frame * | create_resid_tab (xsh_instrument *instrument, ORDERPOS_QC_PARAM *qcparam) |
static void | cumulate_qc_parameter (int order, xsh_order_list *list, CENTROIDS_STRUCT *pcent, int npts) |
static cpl_frame * | calculate_qc_parameters (ORDERPOS_QC_PARAM *qcparam, xsh_instrument *instrument) |
static int | comp_pos (const void *un, const void *deux) |
static void | set_qc_parameters (xsh_order_list *list, ORDERPOS_QC_PARAM *pqc, xsh_instrument *instrument) |
cpl_frame * | xsh_detect_continuum (cpl_frame *frame, cpl_frame *order_table, cpl_frame *spectral_frame, xsh_detect_continuum_param *detect_param, xsh_clipping_param *dcn_clipping, xsh_instrument *instr, cpl_frame **resid_frame) |
Detect order and compute polynomial description of ordermin and order max. Uses a guess order table if available. If not, tries to compute one (see function xsh_order_table_from_fmtchk). | |
static void | compute_dist_pixel (int *xdisp, int *pdist, int dist_order, int first, int last) |
static int | compute_abs_order (START_ORDER *start_x, int nb, cpl_frame *spectral_frame, xsh_detect_continuum_param *detect_param, xsh_instrument *instrument) |
static void | invert_startx (START_ORDER *pstart, int nb) |
static int | comp_center (const void *one, const void *two) |
static int | find_maximum (int *found, double *pos_x, int ix0, int max, double thresh) |
static int | search_max (xsh_pre *pre, int iy, int ix0, int ix1) |
static void | save_centers (CENTER_ORDER *pcent, int fpos, int npos, const char *arm) |
static void | save_pos_x (double *posx, int size, const char *arm) |
static void | fit_order_list (xsh_order_list *list, int npos, CENTER_ORDER *pcent, int degree) |
cpl_frame * | xsh_order_table_from_fmtchk (xsh_pre *pre, cpl_frame *spectral_frame, xsh_detect_continuum_param *detect_param, xsh_instrument *instrument) |
Variables | |
static int | Nb_noflux |
static int | Nb_nofit |
static double * | Deltas = NULL |
static double * | PosY = NULL |
static double * | PosX = NULL |
static double * | XorderPos = NULL |
static int * | Orders = NULL |
static int | DeltaSize = 0 |
static int | DeltaPoints = 0 |
int | CENTER_ORDER::pos_x |
int | CENTER_ORDER::pos_y |
double | CENTER_ORDER::flux |
int | START_ORDER::start_x |
Functions used to detect orders and compute polynomial description of min and max edges (in recipe xsh_orderpos)
#define BAD_POSITION_FLAG 999999 |
Definition at line 110 of file xsh_detect_continuum.c.
Referenced by xsh_detect_continuum().
#define THRESH_POSITION_FLAG 9999999 |
Definition at line 111 of file xsh_detect_continuum.c.
Referenced by xsh_detect_continuum().
static cpl_frame* calculate_qc_parameters | ( | ORDERPOS_QC_PARAM * | qcparam, | |
xsh_instrument * | instrument | |||
) | [static] |
Definition at line 388 of file xsh_detect_continuum.c.
References assure, check, create_resid_tab(), DeltaPoints, Deltas, Orders, PosX, PosY, ORDERPOS_QC_PARAM::residavg, ORDERPOS_QC_PARAM::residmax, ORDERPOS_QC_PARAM::residmin, ORDERPOS_QC_PARAM::residrms, XorderPos, XSH_FREE, and xsh_free_frame().
Referenced by xsh_detect_continuum().
static int comp_center | ( | const void * | one, | |
const void * | two | |||
) | [static] |
Definition at line 244 of file xsh_order_table_from_fmtchk.c.
References first, and CENTER_ORDER::order.
Referenced by xsh_order_table_from_fmtchk().
static int comp_pos | ( | const void * | un, | |
const void * | deux | |||
) | [static] |
Definition at line 418 of file xsh_detect_continuum.c.
References CENTROIDS_STRUCT::position.
Referenced by xsh_detect_continuum().
static int compute_abs_order | ( | START_ORDER * | start_x, | |
int | nb, | |||
cpl_frame * | spectral_frame, | |||
xsh_detect_continuum_param * | detect_param, | |||
xsh_instrument * | instrument | |||
) | [static] |
< Array of abs orders from spectral table
< Array of inetr order distances from ...
< Nb of orders in the spectral table
< The 'reddest' order (highest lambdas)
Definition at line 101 of file xsh_order_table_from_fmtchk.c.
References check, compute_dist_pixel(), xsh_instrument::config, xsh_spectralformat_list::dist_order, xsh_detect_continuum_param::dist_order, XSH_INSTRCONFIG::orders, xsh_spectralformat_list::size, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_CALLOC, XSH_FREE, xsh_instrument_get_arm(), xsh_msg, xsh_spectralformat_list_free(), and xsh_spectralformat_list_load().
Referenced by xsh_order_table_from_fmtchk().
static void compute_dist_pixel | ( | int * | xdisp, | |
int * | pdist, | |||
int | dist_order, | |||
int | first, | |||
int | last | |||
) | [static] |
Definition at line 86 of file xsh_order_table_from_fmtchk.c.
References xsh_msg.
Referenced by compute_abs_order().
static cpl_frame* create_resid_tab | ( | xsh_instrument * | instrument, | |
ORDERPOS_QC_PARAM * | qcparam | |||
) | [static] |
Definition at line 261 of file xsh_detect_continuum.c.
References check, DeltaPoints, Deltas, n, Orders, PosX, PosY, ORDERPOS_QC_PARAM::residavg, xsh_resid_order_tab::residavg, ORDERPOS_QC_PARAM::residmax, xsh_resid_order_tab::residmax, ORDERPOS_QC_PARAM::residmin, xsh_resid_order_tab::residmin, ORDERPOS_QC_PARAM::residrms, xsh_resid_order_tab::residrms, XorderPos, XSH_ASSURE_NOT_NULL, xsh_debug_level_get(), XSH_DEBUG_LEVEL_LOW, xsh_free_frame(), xsh_instrument_arm_tostring(), xsh_msg, XSH_ORDERPOS_RESID_TAB, xsh_resid_order_create(), xsh_resid_order_free(), and xsh_resid_order_save().
Referenced by calculate_qc_parameters().
static void cumulate_qc_parameter | ( | int | order, | |
xsh_order_list * | list, | |||
CENTROIDS_STRUCT * | pcent, | |||
int | npts | |||
) | [static] |
Definition at line 316 of file xsh_detect_continuum.c.
References xsh_order::absorder, xsh_order::cenpoly, CENTROIDS_STRUCT::centervalue, DeltaPoints, Deltas, DeltaSize, xsh_order::endy, xsh_order_list::list, Orders, CENTROIDS_STRUCT::position, PosX, PosY, xsh_order::starty, XorderPos, XSH_CALLOC, xsh_msg_dbg_low, xsh_msg_dbg_medium, and y.
Referenced by xsh_detect_continuum().
static int find_maximum | ( | int * | found, | |
double * | pos_x, | |||
int | ix0, | |||
int | max, | |||
double | thresh | |||
) | [static] |
Search a maximum in the pos_x array. The returned value is the INDEX in the array ==> [0,n-1].
found | ???? | |
pos_x | Array of flux [0,n-1] | |
ix0 | First position to search from [0,n-1] | |
max | Size of the array | |
thresh | minimum threshold |
Definition at line 266 of file xsh_order_table_from_fmtchk.c.
References xsh_msg, and xsh_msg_dbg_high.
Referenced by xsh_order_table_from_fmtchk().
static void fit_order_list | ( | xsh_order_list * | list, | |
int | npos, | |||
CENTER_ORDER * | pcent, | |||
int | degree | |||
) | [static] |
Definition at line 401 of file xsh_order_table_from_fmtchk.c.
References CENTER_ORDER::order, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, XSH_CALLOC, XSH_FREE, and xsh_order_list_fit().
Referenced by xsh_order_table_from_fmtchk().
static void invert_startx | ( | START_ORDER * | pstart, | |
int | nb | |||
) | [static] |
Definition at line 228 of file xsh_order_table_from_fmtchk.c.
References XSH_CALLOC.
Referenced by xsh_order_table_from_fmtchk().
static void save_centers | ( | CENTER_ORDER * | pcent, | |
int | fpos, | |||
int | npos, | |||
const char * | arm | |||
) | [static] |
Definition at line 338 of file xsh_order_table_from_fmtchk.c.
References CENTER_ORDER::flux, CENTER_ORDER::order, order, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, and xsh_stringcat_any().
Referenced by xsh_order_table_from_fmtchk().
static void save_pos_x | ( | double * | posx, | |
int | size, | |||
const char * | arm | |||
) | [static] |
Definition at line 386 of file xsh_order_table_from_fmtchk.c.
Referenced by xsh_order_table_from_fmtchk().
static int search_max | ( | xsh_pre * | pre, | |
int | iy, | |||
int | ix0, | |||
int | ix1 | |||
) | [static] |
Search the maximum in the intervall [ix0,ix1] at iy. Pixels are in the [1,n] space.
pre | PRE format image | |
iy | Y position [1,ny] | |
ix0 | X min position [1,nz] | |
ix1 | X max position [1,nx] |
Definition at line 317 of file xsh_order_table_from_fmtchk.c.
References xsh_pre::data.
Referenced by xsh_order_table_from_fmtchk().
static void set_qc_parameters | ( | xsh_order_list * | list, | |
ORDERPOS_QC_PARAM * | pqc, | |||
xsh_instrument * | instrument | |||
) | [static] |
Definition at line 428 of file xsh_detect_continuum.c.
References check, ORDERPOS_QC_PARAM::ndet, ORDERPOS_QC_PARAM::npred, QC_ORD_ORDERPOS_NDET, QC_ORD_ORDERPOS_NPRED, QC_ORD_ORDERPOS_RESIDAVG, QC_ORD_ORDERPOS_RESIDMAX, QC_ORD_ORDERPOS_RESIDMIN, QC_ORD_ORDERPOS_RESIDRMS, ORDERPOS_QC_PARAM::residavg, ORDERPOS_QC_PARAM::residmax, ORDERPOS_QC_PARAM::residmin, ORDERPOS_QC_PARAM::residrms, XSH_ASSURE_NOT_NULL, xsh_order_list_get_header(), and xsh_pfits_set_qc().
Referenced by xsh_detect_continuum().
cpl_frame* xsh_detect_continuum | ( | cpl_frame * | frame, | |
cpl_frame * | order_table, | |||
cpl_frame * | spectral_frame, | |||
xsh_detect_continuum_param * | detect_param, | |||
xsh_clipping_param * | dcn_clipping, | |||
xsh_instrument * | instr, | |||
cpl_frame ** | resid_frame | |||
) |
Detect order and compute polynomial description of ordermin and order max. Uses a guess order table if available. If not, tries to compute one (see function xsh_order_table_from_fmtchk).
[in] | frame | The frame which contains data |
[in] | order_table | The table data with theorical description of polynomial coefficient of centroid order or NULL |
[in] | spectral_frame | The spectral format table frame or NULL |
[in] | detect_param | The detect continuum parameters |
[in] | dcn_clipping | Pointer to sigma clipping parameters |
[in] | instr | The instrument settings |
[out] | resid_frame | table frame with measured residuals |
< PRE structure loaded from input frame
< Array of pixel values input image
< Array of pixel errors input image
< Nb of detected orders
Definition at line 502 of file xsh_detect_continuum.c.
References xsh_order::absorder, assure, BAD_POSITION_FLAG, calculate_qc_parameters(), xsh_order::cenpoly, gauss_res::centroid, check, comp_pos(), cumulate_qc_parameter(), xsh_pre::data, degree, DeltaPoints, xsh_order::endy, xsh_pre::errs, xsh_detect_continuum_param::fit_threshold, xsh_detect_continuum_param::fit_window, xsh_clipping_param::frac, xsh_order_list::header, xsh_order_list::list, ORDERPOS_QC_PARAM::max_pred, ORDERPOS_QC_PARAM::min_pred, mm, Nb_nofit, Nb_noflux, ORDERPOS_QC_PARAM::ndet, niter, xsh_clipping_param::niter, ORDERPOS_QC_PARAM::nposall, ORDERPOS_QC_PARAM::npossel, ORDERPOS_QC_PARAM::npred, xsh_pre::nx, nx, xsh_pre::ny, xsh_detect_continuum_param::poly_degree, xsh_detect_continuum_param::poly_step, xsh_clipping_param::res_max, xsh_detect_continuum_param::search_window, set_qc_parameters(), gauss_res::sigma, xsh_clipping_param::sigma, xsh_order_list::size, xsh_order::starty, starty, step, THRESH_POSITION_FLAG, x, xsh_add_temporary_file(), XSH_ASSURE_NOT_NULL, xsh_debug_level_get(), XSH_DEBUG_LEVEL_HIGH, xsh_fit_gaussian(), XSH_FREE, xsh_free_polynomial(), xsh_free_propertylist(), xsh_free_vector(), XSH_GET_TAG_FROM_ARM, XSH_MALLOC, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_low, xsh_msg_dbg_medium, xsh_msg_warning, XSH_NEW_PROPERTYLIST, xsh_order_list_dump(), xsh_order_list_free(), xsh_order_list_load(), xsh_order_list_save(), xsh_order_list_verify(), XSH_ORDER_TAB_CENTR, xsh_polynomial_fit_1d_create(), xsh_pre_free(), xsh_pre_get_ny(), xsh_pre_load(), and y.
Referenced by main(), and xsh_orderpos().
static cpl_error_code xsh_fit_gaussian | ( | xsh_detect_continuum_param * | detect_param, | |
int | x, | |||
int | y, | |||
int | nx, | |||
float * | data, | |||
float * | p_errs, | |||
struct gauss_res * | result, | |||
xsh_instrument * | instrument, | |||
int | order, | |||
double | threshold | |||
) | [static] |
Definition at line 116 of file xsh_detect_continuum.c.
References gauss_res::area, gauss_res::centroid, check, xsh_detect_continuum_param::fit_window, gauss_res::mse, Nb_nofit, Nb_noflux, gauss_res::offset, xsh_detect_continuum_param::running_window, xsh_detect_continuum_param::search_window, gauss_res::sigma, XSH_ASSURE_NOT_NULL, xsh_debug_level_get(), XSH_DEBUG_LEVEL_MEDIUM, XSH_FREE, xsh_free_vector(), xsh_instrument_arm_tostring(), XSH_MALLOC, xsh_msg_dbg_high, xsh_msg_dbg_medium, and xsh_tools_running_median_1d_get_max().
Referenced by xsh_detect_continuum().
cpl_frame* xsh_order_table_from_fmtchk | ( | xsh_pre * | pre, | |
cpl_frame * | spectral_frame, | |||
xsh_detect_continuum_param * | detect_param, | |||
xsh_instrument * | instrument | |||
) |
< the pixel X position is the index in pos_x + 1 !
Definition at line 454 of file xsh_order_table_from_fmtchk.c.
References xsh_order::absorder, xsh_instrument::arm, check, comp_center(), compute_abs_order(), xsh_instrument::config, xsh_pre::data, degree, xsh_order::endy, find_maximum(), fit_order_list(), CENTER_ORDER::flux, xsh_detect_continuum_param::fmtchk_follow_sn, xsh_detect_continuum_param::fmtchk_search_sn, xsh_detect_continuum_param::fmtchk_step, xsh_detect_continuum_param::fmtchk_window, invert_startx(), xsh_order_list::list, nx, xsh_pre::ny, ny, CENTER_ORDER::order, XSH_INSTRCONFIG::orders, xsh_detect_continuum_param::poly_degree, CENTER_ORDER::pos_x, CENTER_ORDER::pos_y, save_centers(), save_pos_x(), search_max(), xsh_order::starty, XSH_ARM_VIS, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_debug_level_get(), XSH_DEBUG_LEVEL_LOW, XSH_FREE, XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), xsh_instrument_get_config(), xsh_msg, xsh_msg_dbg_high, xsh_order_list_create(), xsh_order_list_save(), XSH_ORDER_TAB_GUESS, xsh_pre_get_nx(), and xsh_pre_get_ny().
int DeltaPoints = 0 [static] |
Definition at line 258 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), cumulate_qc_parameter(), and xsh_detect_continuum().
double* Deltas = NULL [static] |
Definition at line 254 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), and cumulate_qc_parameter().
int DeltaSize = 0 [static] |
Definition at line 257 of file xsh_detect_continuum.c.
Referenced by cumulate_qc_parameter().
double CENTER_ORDER::flux [inherited] |
Definition at line 86 of file xsh_model_kernel.c.
Referenced by save_centers(), xsh_model_order_edges_tab_create(), and xsh_order_table_from_fmtchk().
int Nb_nofit [static] |
Definition at line 96 of file xsh_detect_continuum.c.
Referenced by xsh_detect_continuum(), and xsh_fit_gaussian().
int Nb_noflux [static] |
Definition at line 96 of file xsh_detect_continuum.c.
Referenced by xsh_detect_continuum(), and xsh_fit_gaussian().
int* Orders = NULL [static] |
Definition at line 256 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), and cumulate_qc_parameter().
int CENTER_ORDER::pos_x [inherited] |
Definition at line 84 of file xsh_model_kernel.c.
Referenced by fit_order_edge_list(), fit_order_list(), save_centers(), xsh_model_order_edges_tab_create(), and xsh_order_table_from_fmtchk().
int CENTER_ORDER::pos_y [inherited] |
Definition at line 85 of file xsh_model_kernel.c.
Referenced by fit_order_edge_list(), fit_order_list(), save_centers(), xsh_model_order_edges_tab_create(), and xsh_order_table_from_fmtchk().
double * PosX = NULL [static] |
Definition at line 254 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), and cumulate_qc_parameter().
double * PosY = NULL [static] |
Definition at line 254 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), and cumulate_qc_parameter().
int START_ORDER::start_x [inherited] |
Definition at line 66 of file xsh_order_table_from_fmtchk.c.
double * XorderPos = NULL [static] |
Definition at line 255 of file xsh_detect_continuum.c.
Referenced by calculate_qc_parameters(), create_resid_tab(), and cumulate_qc_parameter().