|
CR2RE Pipeline Reference Manual 1.6.2
|
Functions | |
| int | cr2res_extract_traces (const hdrl_image *img, const cpl_table *traces, const cpl_table *slit_func_in, const cpl_table *blaze_table_in, float blaze_norm, int reduce_order, int reduce_trace, cr2res_extr_method extr_method, int extr_height, int swath_width, int oversample, double smooth_slit, double smooth_spec, int niter, double kappa, double error_factor, int display, int disp_order_idx, int disp_trace, cpl_table **extracted, cpl_table **slit_func, hdrl_image **model_master) |
| Extracts all the passed traces at once. | |
| int | cr2res_extract_sum_vert (const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model) |
| Simple extraction function. | |
| int | cr2res_extract_median (const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model) |
| Simple extraction function with the median. | |
| int | cr2res_extract_sum_tilt (const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model) |
| Simple extraction function with curvature correction. | |
| cpl_table * | cr2res_extract_EXTRACT1D_create (cpl_bivector **spectrum, const cpl_table *trace_table) |
| Create the extract 1D table to be saved. | |
| cpl_table * | cr2res_extract_SLITFUNC_create (cpl_vector **slit_func, const cpl_table *trace_table) |
| Create the slit functions table to be saved. | |
| int | cr2res_extract_EXTRACT1D_get_spectrum (const cpl_table *tab, int order, int trace_nb, cpl_bivector **spec, cpl_bivector **spec_err) |
| Get a Spectrum and its error from the EXTRACT_1D table. | |
| int | cr2res_extract_SLIT_FUNC_get_vector (const cpl_table *tab, int order, int trace_nb, cpl_vector **vec) |
| Get a vector from the SLIT_FUNC table. | |
| int | cr2res_extract_slitdec_curved (const hdrl_image *img_hdrl, const cpl_table *trace_tab, const cpl_vector *slit_func_vec_in, int order, int trace_id, int height, int swath, int oversample, double smooth_slit, double smooth_spec, int niter, double kappa, double error_factor, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model) |
| Extract optimally (slit-decomposition) with polynomial slit. | |
| int | cr2res_extract2d_traces (const hdrl_image *img, const cpl_table *traces, int reduce_order, int reduce_trace, cpl_table **extracted) |
| Extract2d all the passed traces at once. | |
| int | cr2res_extract2d_trace (const hdrl_image *in, const cpl_table *trace_tab, int order, int trace_id, int npoints, const cpl_image *wavemap, const cpl_image *slitmap, cpl_bivector **spectrum, cpl_bivector **position, cpl_vector **wavelength, cpl_vector **slit_fraction) |
| Extraction2d function. | |
| cpl_table * | cr2res_extract_EXTRACT2D_create (cpl_bivector **spectrum, cpl_bivector **position, cpl_vector **wavelength, cpl_vector **slit_fraction, const cpl_table *trace_table) |
| Create the extract 2D table to be saved. | |
| int cr2res_extract2d_trace | ( | const hdrl_image * | in, |
| const cpl_table * | trace_tab, | ||
| int | order, | ||
| int | trace_id, | ||
| int | npoints, | ||
| const cpl_image * | wavemap, | ||
| const cpl_image * | slitmap, | ||
| cpl_bivector ** | spectrum, | ||
| cpl_bivector ** | position, | ||
| cpl_vector ** | wavelength, | ||
| cpl_vector ** | slit_fraction | ||
| ) |
Extraction2d function.
| img_in | full detector image |
| trace_tab | The traces table |
| order | The order to extract |
| trace_id | The Trace to extract |
| wavemap | Map of the wavelength for each pixel |
| slitmap | Map of the slit fraction for each pixel |
| spectrum | [out] the spectrum and error |
| position | [out] the x/y positions |
| wavelength | [out] the wavelength values |
| slit_fraction | [out] the slit_fraction values |
Return the position, value, wavelength, and slitfraction of each pixel inside a trace
Definition at line 2180 of file cr2res_extract.c.
References cr2res_convert_array_to_poly(), cr2res_get_trace_table_index(), cr2res_polynomial_eval_vector(), hdrl_image_get_error_const(), and hdrl_image_get_image_const().
Referenced by cr2res_extract2d_traces().
| int cr2res_extract2d_traces | ( | const hdrl_image * | img, |
| const cpl_table * | traces, | ||
| int | reduce_order, | ||
| int | reduce_trace, | ||
| cpl_table ** | extracted | ||
| ) |
Extract2d all the passed traces at once.
| img | Full detector image |
| traces | The traces table |
| reduce_order | The order to extract (-1 for all) |
| reduce_trace | The Trace to extract (-1 for all) |
| extracted | [out] the extracted spectra |
This func takes a single image (containing many orders), and a traces table.
Definition at line 2056 of file cr2res_extract.c.
References cr2res_extract2d_trace(), cr2res_extract_EXTRACT2D_create(), and cr2res_slit_pos_image().
| cpl_table * cr2res_extract_EXTRACT1D_create | ( | cpl_bivector ** | spectrum, |
| const cpl_table * | trace_table | ||
| ) |
Create the extract 1D table to be saved.
| spectrum | The extracted spectra of the different orders |
| trace_table | The trace table |
Definition at line 1049 of file cr2res_extract.c.
References cr2res_dfs_SPEC_colname(), cr2res_dfs_SPEC_ERR_colname(), cr2res_dfs_WAVELENGTH_colname(), and cr2res_trace_get_wl().
Referenced by cr2res_extract_traces().
| int cr2res_extract_EXTRACT1D_get_spectrum | ( | const cpl_table * | tab, |
| int | order, | ||
| int | trace_nb, | ||
| cpl_bivector ** | spec, | ||
| cpl_bivector ** | spec_err | ||
| ) |
Get a Spectrum and its error from the EXTRACT_1D table.
| tab | the EXTRACT_1D table |
| order | the order |
| trace_nb | the wished trace |
| spec | [out] The wavelength/spectrum bivector |
| spec_err | [out] The wavelength/spectrum error bivector |
Definition at line 1221 of file cr2res_extract.c.
References cr2res_dfs_SPEC_colname(), cr2res_dfs_SPEC_ERR_colname(), and cr2res_dfs_WAVELENGTH_colname().
Referenced by cr2res_extract_traces(), cr2res_photom_engine(), cr2res_qc_snr(), and cr2res_wave_apply().
| cpl_table * cr2res_extract_EXTRACT2D_create | ( | cpl_bivector ** | spectrum, |
| cpl_bivector ** | position, | ||
| cpl_vector ** | wavelength, | ||
| cpl_vector ** | slit_fraction, | ||
| const cpl_table * | trace_table | ||
| ) |
Create the extract 2D table to be saved.
| spectrum | value and error of the spectrum |
| position | x and y positions |
| wavelength | WL value |
| slit_fraction | slit fraction |
| traces | Trace wave file used for extraction |
Definition at line 2310 of file cr2res_extract.c.
References cr2res_dfs_POSITIONX_colname(), cr2res_dfs_POSITIONY_colname(), cr2res_dfs_SLIT_FRACTION_colname(), cr2res_dfs_SPEC_colname(), cr2res_dfs_SPEC_ERR_colname(), and cr2res_dfs_WAVELENGTH_colname().
Referenced by cr2res_extract2d_traces().
| int cr2res_extract_median | ( | const hdrl_image * | hdrl_in, |
| const cpl_table * | trace_tab, | ||
| int | order, | ||
| int | trace_id, | ||
| int | height, | ||
| cpl_vector ** | slit_func, | ||
| cpl_bivector ** | spec, | ||
| hdrl_image ** | model | ||
| ) |
Simple extraction function with the median.
| img_in | full detector image |
| trace_tab | The traces table |
| order | The order to extract |
| trace_id | The Trace to extract |
| height | number of pix above and below mid-line or -1 |
| slit_func | the returned slit function, normalized to sum=1 |
| spec | the returned spectrum, sum of rows |
| model | the reconstructed image |
This func takes a single image (containing many orders), a trace table, the order and trace numbers to extract (one each), and the extraction height. It uses the trace to shift the image columns by integer values, thereby straightening the order. The output spectra and slit function are then the collapsed (with the median) image in x and y, respectively. Also returned is the "model", i.e. an image reconstruction from the two extracted vectors.
Definition at line 655 of file cr2res_extract.c.
References cr2res_image_cut_rectify(), cr2res_trace_get_height(), cr2res_trace_get_ycen(), cr2res_vector_get_int(), hdrl_image_create(), hdrl_image_get_error_const(), and hdrl_image_get_image_const().
Referenced by cr2res_extract_traces().
| int cr2res_extract_SLIT_FUNC_get_vector | ( | const cpl_table * | tab, |
| int | order, | ||
| int | trace_nb, | ||
| cpl_vector ** | vec | ||
| ) |
Get a vector from the SLIT_FUNC table.
| tab | the SLIT_FUNC table |
| order | the order |
| trace_nb | the wished trace |
| vec | [out] The SLIT_FUNC vector |
Definition at line 1298 of file cr2res_extract.c.
References cr2res_dfs_SLIT_FUNC_colname().
Referenced by cr2res_extract_traces().
| int cr2res_extract_slitdec_curved | ( | const hdrl_image * | img_hdrl, |
| const cpl_table * | trace_tab, | ||
| const cpl_vector * | slit_func_vec_in, | ||
| int | order, | ||
| int | trace_id, | ||
| int | height, | ||
| int | swath, | ||
| int | oversample, | ||
| double | smooth_slit, | ||
| double | smooth_spec, | ||
| int | niter, | ||
| double | kappa, | ||
| double | error_factor, | ||
| cpl_vector ** | slit_func, | ||
| cpl_bivector ** | spec, | ||
| hdrl_image ** | model | ||
| ) |
Extract optimally (slit-decomposition) with polynomial slit.
| img_in | full detector image |
| trace_tab | The traces table |
| slit_func_vec_in | The input slit_func vector or NULL |
| order | The order to extract |
| trace_id | The Trace to extract |
| height | number of pix above and below mid-line or -1 |
| swath | width per swath |
| oversample | factor for oversampling |
| smooth_slit | smoothing along slit |
| smooth_spec | smoothing along spectrum |
| error_factor | error_factor |
| slit_func | the returned slit function |
| spec | the returned spectrum |
| model | the returned model |
This func takes a single image (containing many orders), and a single order definition in the form of central y-coords., plus the height. Swath width and oversampling are passed through.
The task of this function then is to
-cut out the relevant pixels of the order -shift im in y integers, so that nrows becomes minimal, adapt ycen accordingly -loop over swaths, in half-steps -derive a good starting guess for the spectrum, by median-filter average along slit, beware of cosmics -run cr2res_extract_slit_func_vert() -merge overlapping swath results by linear weights from swath-width to edge. -return re-assembled model image, slit-fu, spectrum, new mask. -calculate the errors and return them. This is done by comparing the variance of (im-model) to the poisson-statistics of the spectrum.
Definition at line 1370 of file cr2res_extract.c.
References cr2res_get_trace_wave_poly(), cr2res_image_cut_rectify(), cr2res_image_insert_rect(), cr2res_trace_get_height(), cr2res_trace_get_ycen(), cr2res_vector_get_rest(), hdrl_image_delete(), hdrl_image_get_error_const(), hdrl_image_get_image(), hdrl_image_get_image_const(), and hdrl_image_new().
Referenced by cr2res_extract_traces().
| cpl_table * cr2res_extract_SLITFUNC_create | ( | cpl_vector ** | slit_func, |
| const cpl_table * | trace_table | ||
| ) |
Create the slit functions table to be saved.
| slit_func | The slit functions of the different orders |
| trace_table | The trace table |
Definition at line 1159 of file cr2res_extract.c.
References cr2res_dfs_SLIT_FUNC_colname().
Referenced by cr2res_extract_traces().
| int cr2res_extract_sum_tilt | ( | const hdrl_image * | hdrl_in, |
| const cpl_table * | trace_tab, | ||
| int | order, | ||
| int | trace_id, | ||
| int | height, | ||
| cpl_vector ** | slit_func, | ||
| cpl_bivector ** | spec, | ||
| hdrl_image ** | model | ||
| ) |
Simple extraction function with curvature correction.
| img_in | full detector image |
| trace_tab | The traces table |
| order | The order to extract |
| trace_id | The Trace to extract |
| height | number of pix above and below mid-line or -1 |
| slit_func | the returned slit function, normalized to sum=1 |
| spec | the returned spectrum, sum of rows |
| model | the reconstructed image |
This func takes a single image (containing many orders), a trace table, the order and trace numbers to extract (one each), and the extraction height. It uses the trace to shift the image columns by integer values, thereby straightening the order. Additionally the image is corrected for the curvature by linear interpolation. The output spectra and slit function are then the collapsed image in x and y, respectively. Also returned is the "model", i.e. an image reconstruction from the two extracted vectors.
Definition at line 798 of file cr2res_extract.c.
References cr2res_get_trace_wave_poly(), cr2res_image_cut_rectify(), cr2res_trace_get_height(), cr2res_trace_get_ycen(), cr2res_vector_get_int(), hdrl_image_create(), hdrl_image_get_error_const(), and hdrl_image_get_image_const().
Referenced by cr2res_extract_traces().
| int cr2res_extract_sum_vert | ( | const hdrl_image * | hdrl_in, |
| const cpl_table * | trace_tab, | ||
| int | order, | ||
| int | trace_id, | ||
| int | height, | ||
| cpl_vector ** | slit_func, | ||
| cpl_bivector ** | spec, | ||
| hdrl_image ** | model | ||
| ) |
Simple extraction function.
| img_in | full detector image |
| trace_tab | The traces table |
| order | The order to extract |
| trace_id | The Trace to extract |
| height | number of pix above and below mid-line or -1 |
| slit_func | the returned slit function, normalized to sum=1 |
| spec | the returned spectrum, sum of rows |
| model | the reconstructed image |
This func takes a single image (containing many orders), a trace table, the order and trace numbers to extract (one each), and the extraction height. It uses the trace to shift the image columns by integer values, thereby straightening the order. The output spectra and slit function are then the collapsed image in x and y, respectively. Also returned is the "model", i.e. an image reconstruction from the two extracted vectors.
Definition at line 507 of file cr2res_extract.c.
References cr2res_image_cut_rectify(), cr2res_trace_get_height(), cr2res_trace_get_ycen(), cr2res_vector_get_int(), hdrl_image_create(), hdrl_image_get_error_const(), and hdrl_image_get_image_const().
Referenced by cr2res_extract_traces(), and cr2res_slit_curv_compute_order_trace().
| int cr2res_extract_traces | ( | const hdrl_image * | img, |
| const cpl_table * | traces, | ||
| const cpl_table * | slit_func_in, | ||
| const cpl_table * | blaze_table_in, | ||
| float | blaze_norm, | ||
| int | reduce_order, | ||
| int | reduce_trace, | ||
| cr2res_extr_method | extr_method, | ||
| int | extr_height, | ||
| int | swath_width, | ||
| int | oversample, | ||
| double | smooth_slit, | ||
| double | smooth_spec, | ||
| int | niter, | ||
| double | kappa, | ||
| double | error_factor, | ||
| int | display, | ||
| int | disp_order_idx, | ||
| int | disp_trace, | ||
| cpl_table ** | extracted, | ||
| cpl_table ** | slit_func, | ||
| hdrl_image ** | model_master | ||
| ) |
Extracts all the passed traces at once.
| img | Full detector image |
| traces | The traces table |
| slit_func_in | The input slit_func or NULL |
| blaze_table_in | The input blaze or NULL |
| blaze_norm | The blaze normalization or 0 |
| reduce_order | The order to extract (-1 for all) |
| reduce_trace | The Trace to extract (-1 for all) |
| extr_method | The wished extraction method |
| extr_height | number of pix above and below mid-line or -1 |
| swath_width | width per swath |
| oversample | factor for oversampling |
| smooth_slit | smoothing along slit |
| smooth_spec | smoothing along spectrum |
| error_factor | Factor to get errors scale correctly |
| display | Flag to allow display |
| disp_order_idx | The order index to display |
| disp_trace | The trace number to display |
| extracted | [out] the extracted spectra |
| slit_func | [out] the slit functions |
| model_master | [out] the model |
This func takes a single image (containing many orders), and a traces table.
Definition at line 183 of file cr2res_extract.c.
References cr2res_extract_EXTRACT1D_create(), cr2res_extract_EXTRACT1D_get_spectrum(), cr2res_extract_median(), cr2res_extract_SLIT_FUNC_get_vector(), cr2res_extract_slitdec_curved(), cr2res_extract_SLITFUNC_create(), cr2res_extract_sum_tilt(), cr2res_extract_sum_vert(), hdrl_image_delete(), hdrl_image_duplicate(), hdrl_image_get_pixel(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_mul_scalar(), and hdrl_image_set_pixel().