Order Detection (xsh_detect_order_edge)
[DRL Functions]

Defines

#define HALF_SLIC_WINDOW   5

Functions

static cpl_table * xsh_compute_flat_edges (cpl_frame *frame, xsh_order_list *list, xsh_instrument *instrument, const char *method)
 Measure flat edges (and eventually IFU slices) on master bias using Scharr X filter.
static void xsh_eval_y_avg_chunk (xsh_pre *pre, int xc, int yc, int chunk_y_hsize, int x_hsize, const int decode_bp, double *flux, double *noise)
 Evaluate by chunk in Y the total and mean flux and the corresponding errors around x,y input position.
static void xsh_detect_max_y (xsh_order_list *list, int chunk_hsize, cpl_polynomial *cen_poly, int cen_start, int cen_end, xsh_pre *pre, const int decode_bp, int *maxy)
 Detect Y position where flux is max.
static void xsh_detect_edges (xsh_order_list *list, int y, cpl_polynomial *cen_poly, xsh_pre *pre, int window_hsize, double *res_flux, double *res_noise, int chunk_hsize, double min_snr, double flux_frac, int min_size_x, const int decode_bp, int *x_min, float *x_cen_sdivn, int *xup, int *xlow, float *min_low, float *min_up)
 Detect order edges: at each y position determines low (left) and upper (right) order edges.
static void xsh_detect_slitlet_ratio (double *res_flux, int window_hsize, double min_low, double min_up, int xlow, int xup, double *ratio_low, double *ratio_up)
cpl_frame * xsh_detect_order_edge (cpl_frame *frame, cpl_frame *cen_order_tab_frame, xsh_detect_order_param *detectorder_par, xsh_instrument *instrument)
 Detect order edges and compute polynomial description of ordermin and order max.

Define Documentation

#define HALF_SLIC_WINDOW   5

Definition at line 58 of file xsh_detect_order.c.

Referenced by xsh_detect_order_edge(), and xsh_detect_slitlet_ratio().


Function Documentation

static cpl_table* xsh_compute_flat_edges ( cpl_frame *  frame,
xsh_order_list list,
xsh_instrument instrument,
const char *  method 
) [static]
static void xsh_detect_edges ( xsh_order_list list,
int  y,
cpl_polynomial *  cen_poly,
xsh_pre pre,
int  window_hsize,
double *  res_flux,
double *  res_noise,
int  chunk_hsize,
double  min_snr,
double  flux_frac,
int  min_size_x,
const int  decode_bp,
int *  x_min,
float *  x_cen_sdivn,
int *  xup,
int *  xlow,
float *  min_low,
float *  min_up 
) [static]

Detect order edges: at each y position determines low (left) and upper (right) order edges.

Parameters:
list order list structure
y y position at which flux is max
cen_poly polynomial description order centres
pre frame in pre format
window_hsize window half (X) size
res_flux data flux array pointer
res_noise data noise array pointer
chunk_hsize chunk half (Y) size
min_snr minimum signal to noise ratio
flux_frac flux fraction
min_size_x minimum x size of flat size
x_min output min x
x_cen_sdivn output singnal to noise ratio at central x
xup output upper x
xlow output lower x
min_low output flux min at low edge
min_up output flux min at upp edge
Returns:
void

Definition at line 707 of file xsh_detect_order.c.

References check, nx, threshold, x, XSH_ASSURE_NOT_NULL, xsh_eval_y_avg_chunk(), xsh_msg, xsh_msg_dbg_medium, and xsh_order_list_eval_int().

Referenced by xsh_detect_order_edge().

static void xsh_detect_max_y ( xsh_order_list list,
int  chunk_hsize,
cpl_polynomial *  cen_poly,
int  cen_start,
int  cen_end,
xsh_pre pre,
const int  decode_bp,
int *  maxy 
) [static]

Detect Y position where flux is max.

Parameters:
list order list structure
chunk_hsize chunk half size
cen_poly polynomial description order centres
cen_start start y order centers
cen_end end y order centers
pre frame in pre format
maxy found Y maximum
Returns:
void

Definition at line 640 of file xsh_detect_order.c.

References check, xsh_pre::nx, ny, xsh_pre::qual, x, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_eval_y_avg_chunk(), xsh_order_list_eval_int(), and y.

Referenced by xsh_detect_order_edge().

cpl_frame* xsh_detect_order_edge ( cpl_frame *  frame,
cpl_frame *  cen_order_tab_frame,
xsh_detect_order_param detectorder_par,
xsh_instrument instrument 
)

Detect order edges and compute polynomial description of ordermin and order max.

Parameters:
[in] frame The image frame [PRE]
[in] cen_order_tab_frame The frame [ORDER_TAB]
[in] detectorder_par The detection parameters
[in] instrument The instrument setting
Returns:
The edges order table containing polynomial description of the edges

< Y position

< Lower X position

< Upper X position

< Upper X position of center slice

< Lower X position of center slice

Definition at line 928 of file xsh_detect_order.c.

References xsh_order::absorder, assure, xsh_order_list::bin_x, xsh_order_list::bin_y, BOOLEAN_TO_STRING, xsh_order::cenpoly, check, xsh_detect_order_param::chunk_hsize, xsh_instrument::decode_bp, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, xsh_detect_order_param::fixed_slice, xsh_detect_order_param::flux_thresh, HALF_SLIC_WINDOW, xsh_order_list::header, xsh_order_list::list, xsh_detect_order_param::method, method, xsh_detect_order_param::min_order_size_x, xsh_detect_order_param::min_sn, xsh_pre::nx, ny, xsh_pre::ny, xsh_order::pol_degree, xsh_detect_order_param::search_window_hsize, xsh_order_list::size, size, xsh_order::sliclopoly, xsh_order::slicuppoly, xsh_detect_order_param::slitlet_low_factor, xsh_detect_order_param::slitlet_up_factor, xsh_order::starty, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_compute_flat_edges(), xsh_debug_level_get(), XSH_DEBUG_LEVEL_MEDIUM, xsh_detect_edges(), xsh_detect_max_y(), xsh_detect_slitlet_ratio(), XSH_FREE, xsh_free_polynomial(), xsh_free_propertylist(), xsh_free_table(), XSH_GET_TAG_FROM_LAMP, xsh_instrument_get_mode(), XSH_MODE_IFU, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_medium, xsh_msg_error, XSH_NAME_LAMP_MODE_ARM, XSH_NEW_PROPERTYLIST, xsh_order_list_eval_int(), xsh_order_list_free(), xsh_order_list_get_endy(), xsh_order_list_get_starty(), xsh_order_list_load(), xsh_order_list_save(), XSH_ORDER_TAB_EDGES, xsh_polynomial_fit_1d_create(), xsh_pre_free(), xsh_pre_load(), XSH_REGDEBUG, xsh_unwrap_vector(), and y.

Referenced by xsh_combine_flats_and_detect_edges().

static void xsh_detect_slitlet_ratio ( double *  res_flux,
int  window_hsize,
double  min_low,
double  min_up,
int  xlow,
int  xup,
double *  ratio_low,
double *  ratio_up 
) [static]

Definition at line 863 of file xsh_detect_order.c.

References HALF_SLIC_WINDOW, size, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_detect_order_edge().

static void xsh_eval_y_avg_chunk ( xsh_pre pre,
int  xc,
int  yc,
int  chunk_y_hsize,
int  x_hsize,
const int  decode_bp,
double *  flux,
double *  noise 
) [static]

Evaluate by chunk in Y the total and mean flux and the corresponding errors around x,y input position.

Parameters:
[in] pre The image frame
[in] xc The x center of chunk
[in] yc The y center of chunk
[in] chunk_y_hsize The half size of chunk in y
[in] x_hsize The half size of window in which we do the
[in] decode_bp bad pixel code
[out] flux The flux of chunk (must be allocated) size x_hsize*2+1
[out] noise The errors associated to chunk (must be allocated) size x_hsize*2+1

Definition at line 567 of file xsh_detect_order.c.

References check, xsh_pre::data, xsh_pre::errs, xsh_pre::nx, nx, xsh_pre::ny, ny, xsh_pre::qual, XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_detect_edges(), and xsh_detect_max_y().


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1