34#define CR2RES_PIPELINE_AUTHORS \
35 "Yves Jung, Thomas Marquart, Ansgar Wehrhahn, Nikolai Piskunov"
37#define CR2RES_NB_DETECTORS 3
38#define CR2RES_NB_DECKER_POSITIONS 3
39#define CR2RES_DETECTOR_SIZE 2048
40#define CR2RES_DETECTOR_OVEREXP_THRESH 37000
41#define CR2RES_SATURATED_LINES_THRESH 4000000
42#define CR2RES_APPROX_SLIT_HEIGHT 175
45#define CR2RES_GAIN_CHIP1 2.15
46#define CR2RES_GAIN_CHIP2 2.19
47#define CR2RES_GAIN_CHIP3 2.00
50 CR2RES_DECKER_INVALID,
78 const cpl_vector * ycen);
80 const cpl_vector * ycen);
83 const cpl_table * extracta,
84 const cpl_table * extractb);
89 cpl_table * trace_wave,
94 const cpl_table * trace_wave,
95 cpl_polynomial *** coef_slit,
96 cpl_polynomial *** coef_wave,
100 const cpl_table * trace_wave,
101 cpl_image ** slitpos,
102 cpl_image ** wavelength) ;
105 const cpl_image * img_in,
106 const cpl_vector * ycen,
109 const cpl_image * rect_in,
110 const cpl_vector * ycen,
111 cpl_image * img_out );
113 const cpl_polynomial * poly,
114 const cpl_vector * vec);
117 const cpl_table * blaze,
127const char * cr2res_extract_filename(
const cpl_frameset *,
const char *) ;
131 const cpl_frameset * in,
137 const cpl_polynomial * poly,
141 const cpl_image * ima_data,
144 cpl_image ** ima_errs) ;
147 const cpl_bivector * extracted_spec,
148 const cpl_bivector * catalog,
153int cr2res_vector_erase_element(
157int cr2res_vector_abs(
158 cpl_vector * vector);
160int cr2res_util_optimal_filter_1d(
167 const double * Weights,
171 const cpl_image * img,
172 const cpl_image * weight,
176cpl_polynomial * cr2res_polyfit_2d(
177 const cpl_vector * x,
178 const cpl_vector * y,
179 const cpl_vector * z,
180 const cpl_size degree[2]
double cr2res_mjd_obs_now(void)
Get the current MJD-OBS.
int cr2res_format_setting2(char *setting_id)
Format the setting.
int cr2res_format_setting(char *setting_id)
Format the setting.
double cr2res_ra_hms2deg(int hh, int mm, double ss)
Convert the RA from hh mm ss to degrees.
cpl_image * cr2res_image_cut_rectify(const cpl_image *img_in, const cpl_vector *ycen, int height)
Cut a bent order into a rectangle, shifting columns.
char * cr2res_decker_print_position(cr2res_decker dpos)
Get the decker position string for display.
int * cr2res_vector_get_int(const cpl_vector *ycen)
cpl_error_code cr2res_detector_shotnoise_model(const cpl_image *ima_data, const double gain, const double ron, cpl_image **ima_errs)
compute photon count error in [ADU]
cpl_polynomial * cr2res_fit_interorder(cpl_image *img, cpl_table *trace_wave, cpl_size order_x, cpl_size order_y)
Fit a 2D Polynomial to the interorder regions.
double cr2res_dec_hms2deg(int dd, int mm, double ss)
Convert the DEC from dd mm ss to degrees.
double cr2res_vector_get_mad(cpl_vector *invec, double *mad)
Get MAD from a vector.
cpl_polynomial * cr2res_convert_array_to_poly(const cpl_array *arr)
Convert an array to polynomial.
cpl_vector * cr2res_threshold_spec(const cpl_vector *invector, int smooth, double thresh)
Find the regions with over-average values in a vector.
double * cr2res_vector_get_rest(const cpl_vector *ycen)
cpl_vector * cr2res_polynomial_eval_vector(const cpl_polynomial *poly, const cpl_vector *vec)
Evaluate a polynomial on a vector.
int cr2res_order_idx_to_real(int order_idx, int order_zp)
Convert the order_idx into order_real.
double cr2res_utils_get_center_mjd(const cpl_frameset *frameset)
Calculate the middle of the exposures in the frameset.
cpl_array * cr2res_convert_poly_to_array(const cpl_polynomial *poly, int size)
Convert a polynomial to array.
double cr2res_util_blaze_stat(const cpl_table *blaze, int *ngood, double *blaze_tot)
Computes the average of the blaze.
cpl_image * cr2res_util_optimal_filter_2d(const cpl_image *img, const cpl_image *weight, double lam_x, double lam_y)
Apply the optimal filter in the 2D case.
int cr2res_is_short_wavelength(const char *setting_id)
Identify Short Wavelength.
char * cr2res_get_root_name(const char *filename)
Find out the root part of a basename (name without extension).
int cr2res_plot_wavecal_result(const cpl_bivector *extracted_spec, const cpl_bivector *catalog, const char *title, double wmin, double wmax)
Plot the spectrum with the catalog.
cpl_frameset * cr2res_extract_frameset_several_tags(const cpl_frameset *in, const char **tags, int ntags)
Extract the frames whose tag is within a list from a frameset.
cpl_table * cr2res_combine_extracted(const cpl_table *extracta, const cpl_table *extractb)
Combine two extracted spectra by resampling one to the other's WL.
int cr2res_slit_pos_image(const cpl_table *trace_wave, cpl_image **slitpos, cpl_image **wavelength)
get a image of the slitposition (and wavelength) along the slit
int cr2res_slit_pos(const cpl_table *trace_wave, cpl_polynomial ***coef_slit, cpl_polynomial ***coef_wave, int *size)
Create the polynomials needed to calculate the slit pos and wavelength at any point x,...
int cr2res_order_real_to_idx(int order_real, int order_zp)
Convert the order_real into order_idx.
cpl_frameset * cr2res_extract_frameset(const cpl_frameset *, const char *)
Extract the frames with the given tag from a frameset.
int cr2res_image_insert_rect(const cpl_image *rect_in, const cpl_vector *ycen, cpl_image *img_out)
Re-insert a rectangular cut-out of an order into the full frame.
char * cr2res_get_base_name(const char *filename)
Find out the base name of a file (i.e. without prefix path)
const char * cr2res_get_license(void)
Get the pipeline copyright and license.