sinfo_utils.h

00001 /*
00002  * This file is part of the ESO SINFO Pipeline
00003  * Copyright (C) 2004,2005 European Southern Observatory
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00018  */
00019 
00020 /*
00021  * $Author: kmirny $
00022  * $Date: 2010/09/30 14:00:03 $
00023  * $Revision: 1.5 $
00024  * $Name: HEAD $
00025  *
00026  */
00027 #ifndef SINFO_UTILS_H
00028 #define SINFO_UTILS_H
00029 
00030 
00031 #ifdef HAVE_CONFIG_H
00032 #  include <config.h>
00033 #endif
00034 #include <math.h>
00035 #include <sinfo_msg.h>
00036 #include <sinfo_error.h>
00037 #include <cpl.h>
00038 /*
00039  * The purpose of this target is to
00040  * decrease the amount of messages
00041  * printed at the debug level.
00042  *
00043  * If set to non-zero, even more messages
00044  * are printed at the debug level
00045  * (sometimes 50 - 100 MB)
00046  *
00047  */
00048 #ifndef WANT_BIG_LOGFILE
00049 #define WANT_BIG_LOGFILE 0
00050 #endif
00051 
00052 /*
00053  * Set to 1 to show timing
00054  * information on msg-level = info
00055  */
00056 #ifndef WANT_TIME_MEASURE
00057 #define WANT_TIME_MEASURE 0
00058 #endif
00059 
00060 
00061 #if WANT_TIME_MEASURE
00062 #define SINFO_TIME_START(what) sinfo_msg("Timing (%s, l%d) %s start", \
00063                                        __FILE__, __LINE__, what)
00064 #define SINFO_TIME_END         sinfo_msg("Timing (%s, l%d) end", \
00065                                        __FILE__, __LINE__)
00066 #else
00067 #define SINFO_TIME_START(what) sinfo_msg_debug("Timing (%s, l%d) %s start", \
00068                                              __FILE__, __LINE__, what)
00069 #define SINFO_TIME_END         sinfo_msg_debug("Timing (%s, l%d) end", \
00070                                              __FILE__, __LINE__)
00071 #endif
00072 
00073 
00074 
00075 
00076 #ifndef stringify
00077 #ifndef make_str
00078 #define stringify(X) #X
00079 #define make_str(X) stringify(X)
00080 #endif
00081 #endif
00082 
00083 #define TWOSQRT2LN2 2.35482004503095
00084 
00085 #ifndef M_PI
00086 #define M_PI 3.1415926535897932384626433832795
00087 #endif
00088 
00089 #define COS_DEG(x) cos(((x)/180)*M_PI)
00090 #define SIN_DEG(x) sin(((x)/180)*M_PI)
00091 #define ACOS_DEG(x) (acos(x)*180/M_PI)
00092 
00093 
00094 
00095 long sinfo_round_double(double x);
00096 int
00097 sinfo_parameter_get_default_flag ( const cpl_parameter* p );
00098 
00099 #endif

Generated on 3 Mar 2013 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1