visir_utils.h

00001 /* $Id: visir_utils.h,v 1.77 2012/02/02 10:25:41 jtaylor Exp $
00002  *
00003  * This file is part of the VISIR Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: jtaylor $
00023  * $Date: 2012/02/02 10:25:41 $
00024  * $Revision: 1.77 $
00025  * $Name: visir-3_5_0 $
00026  */
00027 
00028 #ifndef VISIR_UTILS_H
00029 #define VISIR_UTILS_H
00030 
00031 /*-----------------------------------------------------------------------------
00032                                    Includes
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                                    Defines
00046  -----------------------------------------------------------------------------*/
00047 
00048 #ifndef VISIR_STAR_MAX_RADIUS
00049    /* 2 arcminutes in degrees */
00050 #  define VISIR_STAR_MAX_RADIUS (2.0/60.0)
00051 #endif
00052 
00053 /* Plotting errors will be ignored */
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 /* FIXME: Copy to visir_error_reset() */
00100 #define visir_error_reset(...)                                                \
00101  irplib_error_recover(cleanstate, __VA_ARGS__)
00102 
00103 /*-----------------------------------------------------------------------------
00104                                        Prototypes
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

Generated on Mon Feb 6 15:23:49 2012 for VISIR Pipeline Reference Manual by  doxygen 1.5.8