detresponse/util.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Chin, Jolien Creighton
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /*
00021  * Author: David Chin <dwchin@umich.edu> +1-734-709-9119
00022  * $Id: util.h,v 1.8 2007/06/08 15:29:43 bema Exp $
00023  */
00024 #ifndef _DETRESPONSE_UTIL_H
00025 #define _DETRESPONSE_UTIL_H
00026 
00027 /* macro for minimum of two arguments */
00028 #define DETRESPONSE_MIN(a, b) (((a) < (b)) ? (a) : (b))
00029 
00030 /* wrap fopen(3) and allocation functions a la GNU */
00031 FILE *xfopen(const char *path, const char *mode);
00032 int xfclose(FILE * stream);
00033 void *xmalloc(size_t length);
00034 void *xrealloc(void *p, size_t length);
00035 void *xcalloc(size_t nmemb, size_t length);
00036 
00037 /* print detector parameters */
00038 void PrintLALDetector(LALDetector * const detector);
00039 
00040 /* print source params */
00041 void print_source(const LALSource * source);
00042 
00043 /* print time info */
00044 void print_time_info(const LALTimeIntervalAndNSample * time_info);
00045 
00046 /* print detector response */
00047 void print_response(const LALDetAMResponse *resp);
00048 
00049 int mystrncasecmp(char *s1, char *s2, unsigned int n);
00050 
00051 /* strlcpy is non-standard, so emulate it here */
00052 size_t mystrlcpy(char *dst, const char *src, size_t size);
00053 /* strlcat is non-standard, so emulate it here */
00054 size_t mystrlcat(char *dst, const char *src, size_t size);
00055 
00056 void square_timeseries(REAL4TimeSeries *ts);
00057 void add_timeseries(REAL4TimeSeries * sum, REAL4TimeSeries * a,
00058                     REAL4TimeSeries * b);
00059 
00060 void set_detector_params(LALStatus * status,
00061                          LALFrDetector * frdet, LALDetector * det,
00062                          const char * name,
00063                          REAL8 vertex_longitude,
00064                          REAL8 vertex_latitude,
00065                          REAL4 vertex_elevation,
00066                          REAL4 x_altitude,
00067                          REAL4 x_azimuth,
00068                          REAL4 y_altitude,
00069                          REAL4 y_azimuth);
00070 
00071 REAL8 deg_to_rad(REAL8 degrees);
00072 
00073 #endif

Generated on Tue Oct 14 02:32:35 2008 for LAL by  doxygen 1.5.2