26 #ifndef UVES_UTILS_WRAPPERS_H
27 #define UVES_UTILS_WRAPPERS_H
35 #include <uves_cpl_size.h>
37 #include <uves_propertylist.h>
38 #include <irplib_utils.h>
51 #define uves_sprintf(...) cpl_sprintf(__VA_ARGS__)
54 uves_image_filter_median(
const cpl_image * img,
const cpl_matrix * mx);
58 uves_image_filter_linear(
const cpl_image *img,
const cpl_matrix * mx);
63 const char *uves_find_frame(
const cpl_frameset *frames,
const char **wanted,
64 int N,
int *found,
const cpl_frame **
frame);
65 cpl_error_code uves_cast_image(cpl_image **image, cpl_type to_type);
66 cpl_error_code uves_crop_image(cpl_image **image,
int x1,
int y_1,
int x2,
int y2);
69 const char *keyword, cpl_type keywordtype,
71 cpl_error_code uves_get_parameter(
const cpl_parameterlist *parameters,
72 const char *context,
const char *recipe_id,
73 const char *name, cpl_type type,
void *value);
74 cpl_error_code uves_set_parameter(cpl_parameterlist *parameters,
75 const char *context,
const char *name,
76 cpl_type type,
void *value);
77 cpl_error_code uves_set_parameter_default(cpl_parameterlist *parameters,
80 cpl_type type,
void *value);
82 void uves_image_reject_all(cpl_image *image);
84 cpl_size uves_get_nextensions(
const char *filename);
85 int uves_select_table_rows(cpl_table *t,
const char *column,
86 cpl_table_select_operator
operator,
88 int uves_erase_invalid_table_rows(cpl_table *t,
const char *column);
89 int uves_erase_table_rows(cpl_table *t,
const char *column,
90 cpl_table_select_operator
operator,
92 int uves_extract_table_rows_local(cpl_table *t,
const char *column,
93 cpl_table_select_operator
operator,
double value);
95 cpl_table *uves_extract_table_rows(
const cpl_table *t,
const char *column,
96 cpl_table_select_operator
operator,
102 void uves_sort_table_1(cpl_table *t,
const char *column1,
104 void uves_sort_table_2(cpl_table *t,
const char *column1,
105 const char *column2,
bool reverse1,
107 void uves_sort_table_3(cpl_table *t,
const char *column1,
108 const char *column2,
const char *column3,
109 bool reverse1,
bool reverse2,
bool reverse3);
112 cpl_error_code uves_fit(
const cpl_matrix *x,
const cpl_matrix *sigma_x,
113 const cpl_vector *y,
const cpl_vector *sigma_y,
114 cpl_vector *a,
const int ia[],
115 int (*f)(
const double x[],
const double a[],
117 int (*dfda)(
const double x[],
const double a[],
121 cpl_matrix **covariance);
124 uves_fit_1d(cpl_vector *x,
const cpl_vector *sigma_x,
125 cpl_vector *y,
const cpl_vector *sigma_y,
126 cpl_fit_mode fit_pars,
bool fit_back,
127 double *x0,
double *sigma,
double *area,
double *offset,
double *slope,
128 double *mse,
double *red_chisq,
129 cpl_matrix **covariance,
130 int (*f) (
const double x[],
const double a[],
double *result),
131 int (*dfda)(
const double x[],
const double a[],
double result[]),
135 uves_fit_1d_image(
const cpl_image *image,
const cpl_image *noise,
136 const cpl_binary *image_badmap,
137 bool horizontal,
bool fix_back,
bool fit_back,
138 int xlo,
int xhi,
int y_0,
139 double *x0,
double *sigma,
double *norm,
double *background,
141 double *mse,
double *red_chisq,
142 cpl_matrix **covariance,
143 int (*f) (
const double x[],
const double a[],
double *result),
144 int (*dfda)(
const double x[],
const double a[],
double result[]),
148 void uves_propertylist_append_property(
uves_propertylist *result,
const cpl_property *p);
150 cpl_error_code uves_table_erase_selected_dfs02356(cpl_table *t);
151 int uves_table_and_selected_invalid(cpl_table *t,
const char *column);
153 void uves_raise_to_median_frac(cpl_table *t,
const char *column,
double fraction);
154 void uves_free(
const void *mem);
155 void uves_free_image(cpl_image **i);
156 void uves_free_mask(cpl_mask **m);
157 void uves_free_imagelist(cpl_imagelist **i);
158 void uves_free_table(cpl_table **t);
159 void uves_free_table_const(
const cpl_table **t);
162 void uves_free_property(cpl_property **p);
163 void uves_free_polynomial(cpl_polynomial **p);
164 void uves_free_matrix(cpl_matrix **m);
165 void uves_free_vector(cpl_vector **v);
166 void uves_free_bivector(cpl_bivector **b);
167 void uves_free_stats(cpl_stats **s);
168 void uves_unwrap_vector(cpl_vector **v);
169 void uves_unwrap_vector_const(
const cpl_vector **v);
170 void uves_unwrap_bivector_vectors(cpl_bivector **b);
171 void uves_free_parameterlist(cpl_parameterlist **p);
172 void uves_free_frameset(cpl_frameset **f);
173 void uves_free_frame(cpl_frame **f);
174 void uves_free_array(cpl_array **a);
175 void uves_free_int(
int **i);
176 void uves_free_int_const(
const int **i);
177 void uves_free_float(
float **f);
178 void uves_free_double(
double **d);
179 void uves_free_string(
char **s);
180 void uves_free_string_const(
const char **s);
182 uves_image_filter_mode(
const cpl_image* b,
183 const cpl_matrix * ker,
184 cpl_filter_mode filter);