00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VISIR_UTILS_H
00029 #define VISIR_UTILS_H
00030
00031
00032
00033
00034
00035 #include <cpl.h>
00036
00037 #include "irplib_utils.h"
00038 #include "irplib_tools.h"
00039
00040 #include "irplib_plugin.h"
00041
00042 #include "visir_spectro.h"
00043
00044
00045
00046
00047
00048 #ifndef VISIR_STAR_MAX_RADIUS
00049
00050 # define VISIR_STAR_MAX_RADIUS (2.0/60.0)
00051 #endif
00052
00053
00054 #define visir_vector_plot(ARG1, ARG2, ARG3, ARG4) \
00055 do { \
00056 cpl_errorstate prestate = cpl_errorstate_get(); \
00057 if (cpl_plot_vector(ARG1, ARG2, ARG3, ARG4)) \
00058 irplib_error_recover(prestate, "Could not plot vector"); \
00059 } while (0)
00060
00061 #define visir_bivector_plot(ARG1, ARG2, ARG3, ARG4) \
00062 do { \
00063 cpl_errorstate prestate = cpl_errorstate_get(); \
00064 if (cpl_plot_bivector(ARG1, ARG2, ARG3, ARG4)) \
00065 irplib_error_recover(prestate, "Could not plot bivector"); \
00066 } while (0)
00067
00068 #define visir_table_plot(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
00069 do { \
00070 cpl_errorstate prestate = cpl_errorstate_get(); \
00071 if (cpl_plot_column(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)) \
00072 irplib_error_recover(prestate, "Could not plot table"); \
00073 } while (0)
00074
00075 #define visir_image_plot(ARG1, ARG2, ARG3, ARG4) \
00076 do { \
00077 cpl_errorstate prestate = cpl_errorstate_get(); \
00078 if (cpl_plot_image(ARG1, ARG2, ARG3, ARG4)) \
00079 irplib_error_recover(prestate, "Could not plot image"); \
00080 } while (0)
00081
00082 #define visir_image_col_plot(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00083 do { \
00084 cpl_errorstate prestate = cpl_errorstate_get(); \
00085 if (cpl_plot_image_col(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) \
00086 irplib_error_recover(prestate, "Could not plot image columns"); \
00087 } while (0)
00088
00089 #define visir_image_row_plot(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
00090 do { \
00091 cpl_errorstate prestate = cpl_errorstate_get(); \
00092 if (cpl_plot_image_row(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) \
00093 irplib_error_recover(prestate, "Could not plot image raws"); \
00094 } while (0)
00095
00096
00097 #define visir_error_set(ERRCODE) cpl_error_set(cpl_func, ERRCODE)
00098
00099
00100 #define visir_error_reset(...) \
00101 irplib_error_recover(cleanstate, __VA_ARGS__)
00102
00103
00104
00105
00106
00107 double * visir_utils_get_wls(const irplib_framelist *);
00108 cpl_image * visir_create_disk_intimage(int, int, int, int, int);
00109 cpl_image * visir_create_ring_intimage(int, int, int, int, int, int);
00110 double visir_image_sigma_clip(const cpl_image *, double *);
00111 double visir_img_phot_sigma_clip(const cpl_image *);
00112 cpl_error_code visir_get_subpixel_maxpos(const cpl_image *,
00113 cpl_size, cpl_size,
00114 double *, double *);
00115 cpl_error_code visir_fftxcorrelate(const cpl_image *, const cpl_image *,
00116 cpl_boolean, double *, double *);
00117
00118 int visir_star_find(const cpl_vector *, const cpl_vector *, double, double,
00119 double, double *);
00120
00121 cpl_error_code visir_star_convert(const char *, int, int, double, char, int,
00122 int, double, const double *, int, double *,
00123 double *);
00124
00125 double visir_star_dist_min(const double *, const double *, int, int *, int *);
00126
00127 cpl_table * visir_table_new_xypos(const cpl_imagelist * images, const char *);
00128
00129 int visir_vector_minpos(const cpl_vector *);
00130
00131 cpl_error_code visir_bivector_load(cpl_bivector *, FILE *);
00132
00133 const char ** visir_framelist_set_tag(irplib_framelist *,
00134 char * (*)(const cpl_frame *,
00135 const cpl_propertylist *, int),
00136 int *);
00137
00138 cpl_error_code visir_qc_append_background(cpl_propertylist *,
00139 const irplib_framelist *, int, int);
00140
00141 cpl_error_code visir_qc_append_capa(cpl_propertylist *,
00142 const irplib_framelist *);
00143
00144 cpl_error_code visir_qc_append_filter(cpl_propertylist *,
00145 const irplib_framelist *);
00146 cpl_error_code visir_qc_append_exptime(cpl_propertylist *,
00147 const irplib_framelist *);
00148 #endif