CR2RE Pipeline Reference Manual 1.6.8
Functions
Slit Curvature

Functions

int cr2res_slit_curv_compute_order_trace (const hdrl_image *img, const cpl_table *trace_wave, const int order, const int trace, const int height, const int window, const cpl_size change_degree, const int slit_degree, cpl_polynomial **slit_poly_a, cpl_polynomial **slit_poly_b, cpl_polynomial **slit_poly_c)
 Get the slit curvature directly from the image.
 
hdrl_image * cr2res_slit_curv_gen_map (const cpl_table *trace_wave, int order, int trace_id, int spacing_pixels, int full_trace)
 Compute the slit_curv map from the trace_wave table.
 
cpl_polynomial * cr2res_slit_curv_build_poly (cpl_polynomial *slit_poly_a, cpl_polynomial *slit_poly_b, cpl_polynomial *slit_poly_c, cpl_size x)
 Create the slit curvature polynomial for x position.
 

Detailed Description

Function Documentation

◆ cr2res_slit_curv_build_poly()

cpl_polynomial * cr2res_slit_curv_build_poly ( cpl_polynomial *  slit_poly_a,
cpl_polynomial *  slit_poly_b,
cpl_polynomial *  slit_poly_c,
cpl_size  x 
)

Create the slit curvature polynomial for x position.

Parameters
slit_poly_aPolynomial for the a coefficient
slit_poly_bPolynomial for the b coefficient
slit_poly_cPolynomial for the c coefficient
xThe x position (1->2048)
Returns
the slit curvature polynomial or NULL in error case

Definition at line 557 of file cr2res_slit_curv.c.

Referenced by cr2res_slit_curv_gen_map().

◆ cr2res_slit_curv_compute_order_trace()

int cr2res_slit_curv_compute_order_trace ( const hdrl_image *  img,
const cpl_table *  trace_wave,
const int  order,
const int  trace,
const int  height,
const int  window,
const cpl_size  change_degree,
const int  slit_degree,
cpl_polynomial **  slit_poly_a,
cpl_polynomial **  slit_poly_b,
cpl_polynomial **  slit_poly_c 
)

Get the slit curvature directly from the image.

Parameters
imgThe input image
trace_waveThe trace wave, with the order tracing
orderThe order to determine the curvature for
traceThe trace to determine the curvature for
Returns
0 if ok, -1 in error case

To determine the curvature we perform several steps. First, find all peaks in the spectrum. Next for each peak, fit a Gaussian with a shifted peak (as a function of the vertical offset y) to the image. The shift of the peak determines the curvature. Finally fit the curvature coefficients to all peaks along the order.

All coefficients are given in the global reference frame The transformation to the local frame is given by: a(x) += - x + yc * b(x) + yc * yc * c(x) b(x) += 2 * yc * c(x)

Definition at line 133 of file cr2res_slit_curv.c.

References cr2res_etalon_find_peaks(), cr2res_extract_sum_vert(), cr2res_image_cut_rectify(), cr2res_trace_get_ycen(), hdrl_image_delete(), hdrl_image_get_image_const(), and hdrl_image_new().

◆ cr2res_slit_curv_gen_map()

hdrl_image * cr2res_slit_curv_gen_map ( const cpl_table *  trace_wave,
int  order,
int  trace_id,
int  spacing_pixels,
int  full_trace 
)

Compute the slit_curv map from the trace_wave table.

Parameters
trace_waveThe trace wave table
orderThe order number or -1 for all
trace_idThe trace_id number or -1 for all
spacing_pixelsThe space in pixels between the traces
full_traceDraw on the full detector or only in the trace
Returns
the slit_curv_map image or NULL in error case

The returned image must be deallocated with hdrl_image_delete()

Definition at line 429 of file cr2res_slit_curv.c.

References cr2res_convert_array_to_poly(), cr2res_slit_curv_build_poly(), hdrl_image_get_image(), and hdrl_image_new().