|
ERIS Pipeline Reference Manual 1.8.15
|
Functions | |
| cpl_error_code | enlu_divide_slit_response (located_imagelist *jitters) |
| Divide LSS 2d-spectra by the slit response. | |
| cpl_error_code | enlu_divide_slit_response_worker (hdrl_image *himage_2d, cpl_image *response_1d) |
| Worker function to divide a 2d image by a 1d response. | |
| cpl_matrix * | enlu_linepos_2d (const hdrl_image *spectrum2d, const cpl_size slice_index, const cpl_vector *guess_pos) |
| Fit the line peaks of a wave calibration spectrum. | |
| double | enlu_linepos_1d (const cpl_vector *spectrum1d, const double guess_pos, const cpl_size half_width) |
| Fit line peak. | |
| cpl_error_code | enlu_trace_save (const char *pro_catg, const hdrl_image *image, const cpl_image *confidence, const cpl_size ntraces, const cpl_polynomial *traces[ntraces], const cpl_size nspectra, const cpl_vector *spectra[nspectra], const cpl_size nlines, const cpl_polynomial *lines[nlines], cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *filename, const char *recipe_name) |
| Save a trace result. | |
| cpl_polynomial * | enlu_warp_poly_load_from_table (const cpl_table *table) |
| Load a LSS warp polynomial from a cpl_table. | |
| cpl_table * | enlu_warp_poly_save_to_table (const cpl_polynomial *poly) |
| Save an LSS polynomial to a cpl_table. | |
| cpl_error_code enlu_divide_slit_response | ( | located_imagelist * | jitters | ) |
Divide LSS 2d-spectra by the slit response.
| jitters | The list of LSS 2d-spectra to be processed. |
The routine iterates throug the jitter images to be processed. For each, it calculates the response value along the slit by collapsing the background spectrum in the dispersion direction (usually all jitters will have the same background but possibly not always). The routine normalises the slit response and then divides the jitter image and error arrays by it. This works because all slit offsets should see the same sky background spectrum.
Definition at line 63 of file eris_nix_lss_utils.c.
References enlu_divide_slit_response_worker(), and hdrl_image_get_image().
| cpl_error_code enlu_divide_slit_response_worker | ( | hdrl_image * | himage_2d, |
| cpl_image * | response_1d | ||
| ) |
Worker function to divide a 2d image by a 1d response.
| hdrl_image | The image whose x-vectors are to be divided. |
| cpl_image | The 1-d image to be the divisor. |
Definition at line 157 of file eris_nix_lss_utils.c.
References hdrl_image_get_pixel(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_reject(), and hdrl_image_set_pixel().
Referenced by enlu_divide_slit_response().
| double enlu_linepos_1d | ( | const cpl_vector * | spectrum1d, |
| const double | guess_pos, | ||
| const cpl_size | half_width | ||
| ) |
Fit line peak.
This routine is given a 1d spectrum with a guess at the position of a line in it. A section between +2 and -2 pixels of the guess position is cut out of the spectrum, and a parabola fitted to the flux values. The position of the parabola maximum is returned as the fitted line position.
The routine will return NaN if entered with the CPL error code set. The routine will return NaN, and set CPL error code to CPL_ERROR_NULL_INPUT if called with spectrum1d NULL. The routine will return NaN if any of the spectral elements in the fitted section is NaN. The routine will return NaN if the fitted peak lies outside the range of the fitted section.
Definition at line 343 of file eris_nix_lss_utils.c.
Referenced by enlu_linepos_2d().
| cpl_matrix * enlu_linepos_2d | ( | const hdrl_image * | spectrum2d, |
| const cpl_size | slice_index, | ||
| const cpl_vector * | guess_pos | ||
| ) |
Fit the line peaks of a wave calibration spectrum.
The function fits line peaks across the 2d wave calibration spectrum from a slit spectrograph.
Starting in the middle x position, and iterating upward in x across the right hand side of the 2d image, the routine looks at y-slices in turn.
For each slice the 1d spectrum and the current guess vector are passed to enlu_linepos_1d, which returns a vector of fitted positions. Successful fits in that vector are stored in the return matrix, and used as the 'guess' for the next slice. In this way, the routine can follow the curve of lines with x if the movement is gentle.
Unsuccessful fits in the vector are not stored in the return matrix and do not propagate to the next 'guess', instead the current 'guess'is carried over. This is intended to make the 'guess' more robust against noisy pixels which can throw the fit off in isolated cases, and once the guess goes wrong the algorithm fails.
The process is repeated for the left side of the 2d spectrum, starting in the middle and iterating downward in x.
The routine will return NULL if entered with the CPL error code set.
The routine will return NULL, and set CPL error code to CPL_ERROR_NULL_INPUT if called with spectrum2d or guess_pos NULL.
The routine will return NULL, and set CPL error code to CPL_ERROR_ILLEGAL_INPUT if guess_pos has 0 elements.
Elements of the return matrix for which the fit failed will be set to NaN.
Definition at line 241 of file eris_nix_lss_utils.c.
References enlu_linepos_1d(), hdrl_image_get_image_const(), and hdrl_image_get_size_x().
| cpl_error_code enlu_trace_save | ( | const char * | pro_catg, |
| const hdrl_image * | image, | ||
| const cpl_image * | confidence, | ||
| const cpl_size | ntraces, | ||
| const cpl_polynomial * | traces[ntraces], | ||
| const cpl_size | nspectra, | ||
| const cpl_vector * | spectra[nspectra], | ||
| const cpl_size | nlines, | ||
| const cpl_polynomial * | lines[nlines], | ||
| cpl_frameset * | frameset, | ||
| const cpl_parameterlist * | parlist, | ||
| const char * | filename, | ||
| const char * | recipe_name | ||
| ) |
Save a trace result.
| pro_catg | The value of the ESO.PRO.CATG keyword |
| image | The trace data |
| confidence | The confidence array |
| spectrum | The trace spectrum |
| frameset | The list of input frames for the recipe |
| parlist | The list of input parameters |
| filename | The name of the output file |
| recipe_name | The recipe name |
Definition at line 432 of file eris_nix_lss_utils.c.
References enlu_warp_poly_save_to_table(), enu_dfs_save_himage(), enu_mef_extension_list_delete(), enu_mef_extension_list_new(), enu_mef_new_image(), enu_mef_new_table(), and enu_mef_new_vector().
| cpl_polynomial * enlu_warp_poly_load_from_table | ( | const cpl_table * | table | ) |
Load a LSS warp polynomial from a cpl_table.
| table | The cpl_table with the informaion. |
Loads a cpl_polynomial used for warping the LSS 2d-spectrum that has been previously saved to a cpl_table by enlu_warp_poly_save_to_table.
The polynomial is expected to be of degree 2 but can have entries for any number of powers.
Definition at line 537 of file eris_nix_lss_utils.c.
| cpl_table * enlu_warp_poly_save_to_table | ( | const cpl_polynomial * | poly | ) |
Save an LSS polynomial to a cpl_table.
| poly | The cpl_polynomial to save. |
Saves a 1 or 2-d cpl_polynomial to a cpl_table.
The polynomial is expected to be 1 or 2d but can have entries for any number of powers.
Definition at line 599 of file eris_nix_lss_utils.c.
Referenced by enlu_trace_save().