34 #include <uves_cpl_size.h>
39 #include <uves_utils_polynomial.h>
40 #include <uves_extract_iterate.h>
41 #include <uves_extract_profile.h>
42 #include <uves_chip.h>
52 #if defined HAVE_DECL___FUNC__ && !HAVE_DECL___FUNC__
55 #define __func__ "<fct.id>"
69 #ifndef WANT_BIG_LOGFILE
70 #define WANT_BIG_LOGFILE 0
77 #ifndef WANT_TIME_MEASURE
78 #define WANT_TIME_MEASURE 0
83 #define UVES_TIME_START(what) uves_msg("Timing (%s, l%d) %s start", \
84 __FILE__, __LINE__, what)
85 #define UVES_TIME_END uves_msg("Timing (%s, l%d) end", \
88 #define UVES_TIME_START(what) uves_msg_debug("Timing (%s, l%d) %s start", \
89 __FILE__, __LINE__, what)
90 #define UVES_TIME_END uves_msg_debug("Timing (%s, l%d) end", \
97 #define stringify(X) #X
98 #define make_str(X) stringify(X)
102 #define TWOSQRT2LN2 2.35482004503095
105 #define M_PI 3.1415926535897932384626433832795
108 #define SPEED_OF_LIGHT 299792458
110 #define COS_DEG(x) cos(((x)/180)*M_PI)
111 #define SIN_DEG(x) sin(((x)/180)*M_PI)
112 #define ACOS_DEG(x) (acos(x)*180/M_PI)
120 const cpl_image *spectrum,
const cpl_image *sky,
121 const cpl_image *cosmic_image,
122 const uves_extract_profile *profile,
146 uves_round_double(
double x)
148 return (x >=0) ? (long)(x+0.5) : (long)(x-0.5);
162 uves_max_double(
double x,
double y)
164 return (x >=y) ? x : y;
177 uves_max_int(
int x,
int y)
179 return (x >=y) ? x : y;
193 uves_min_double(
double x,
double y)
195 return (x <=y) ? x : y;
208 uves_min_int(
int x,
int y)
210 return (x <=y) ? x : y;
226 uves_error_fraction(
double x,
double y,
double dx,
double dy)
231 return sqrt( dx*dx/(y*y) + x*x*dy*dy/(y*y*y*y) );
239 char *
uves_initialize(cpl_frameset *frames,
const cpl_parameterlist *parlist,
240 const char *recipe_id,
const char *short_descr);
241 cpl_error_code
uves_end(
const char *recipe_id,
const cpl_frameset *frames);
244 const char *bunit,
const double bscale,
245 double crval1 ,
double crval2,
246 double crpix1 ,
double crpix2,
247 double crdelt1,
double crdelt2);
253 int ncom,
enum uves_chip);
255 const cpl_image *image2,
const cpl_image *noise2,
261 const cpl_image *master_dark,
266 const char *X1,
const char *X2,
const char *Y,
268 const char *polynomial_fit,
269 const char *residual_square,
270 const char *variance_fit,
271 double *mean_squared_error,
double *red_chisq,
273 int maxdeg1,
int maxdeg2,
double min_rms,
276 const double *min_val,
277 const double *max_val,
278 int npos,
double positions[][2]);
282 const char *X1,
const char *X2,
const char *Y,
284 int degree1,
int degree2,
285 const char *polynomial_fit,
const char *residual_square,
286 const char *variance_fit,
287 double *mse,
double *red_chisq,
292 const char *X,
const char *Y,
const char *sigmaY,
294 const char *polynomial_fit,
const char *residual_square,
295 double *mean_squared_error,
const double kappa);
300 const char *column_y,
int *istart );
302 double uves_spline_hermite(
double xp,
const double *x,
const double *y,
int n,
int *istart );
304 double uves_spline_cubic(
double xp,
double *x,
float *y,
float *y2,
int n,
int *kstart );
310 const char *residual2,
316 int fibre_ID,
double fibre_offset,
int fibre_mask);
319 int uves_moffat(
const double x[],
const double a[],
double *result);
321 int uves_gauss(
const double x[],
const double a[],
double *result);
325 void uves_check_version(
void);
326 void uves_frameset_dump(cpl_frameset*
set);
339 uves_image_smooth_x(cpl_image * inp,
const int r);
341 uves_image_smooth_y(cpl_image * inp,
const int r);
344 uves_image_smooth_mean_x(cpl_image * inp,
const int r);
347 uves_image_smooth_median_x(cpl_image * inp,
const int r);
349 uves_image_smooth_fft(cpl_image * inp,
const int fx);
352 uves_ksigma_stack(
const cpl_imagelist *imlist,
double klow,
double khigh,
int kiter);
357 const cpl_table *ordertable,
359 const cpl_vector* gain_vals,
364 const cpl_table *ordertable,
366 const cpl_image* mflat);
375 const cpl_parameterlist *parameters,
376 const cpl_table *ordertable,
377 const cpl_table *linetable,
380 const int first_abs_order,
381 const int last_abs_order,
382 const int slit_size);