TwoDMeshPlot.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton, Teviet 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 /********************************* <lalVerbatim file="TwoDMeshPlotHV">
00021 Author: Creighton, T. D.
00022 $Id: TwoDMeshPlot.h,v 1.7 2007/06/08 14:41:52 bema Exp $
00023 **************************************************** </lalVerbatim> */
00024 
00025 /********************************************************** <lalLaTeX>
00026 
00027 \section{Header \texttt{TwoDMeshPlot.h}}
00028 \label{s:TwoDMeshPlot.h}
00029 
00030 Provides routines to plot two-dimensional parameter meshes.
00031 
00032 \subsection*{Synopsis}
00033 \begin{verbatim}
00034 #include "TwoDMeshPlot.h"
00035 \end{verbatim}
00036 
00037 \noindent This header covers routines that display 2-dimensional
00038 parameter meshes as generated by the routines in \verb@TwoDMesh.h@.
00039 The output is written to a C \verb@FILE@-type stream using
00040 \verb@fprintf()@ The routines do not provide a system-level interface
00041 to open or close file streams; they simply assume that they have been
00042 passed an open, writable stream.  Nonetheless, their use of stream I/O
00043 means that they cannot be included in LAL (although executables, in
00044 particular the \verb@TwoDMesh.h@ test programs, may statically link
00045 against their object files).
00046 
00047 ******************************************************* </lalLaTeX> */
00048 
00049 #ifndef _TWODMESHPLOT_H
00050 #define _TWODMESHPLOT_H
00051 
00052 #include <lal/LALStdlib.h>
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #pragma }
00057 #endif
00058 
00059 NRCSID( TWODMESHPLOTH, "$Id: TwoDMeshPlot.h,v 1.7 2007/06/08 14:41:52 bema Exp $" );
00060 
00061 /********************************************************** <lalLaTeX>
00062 \subsection*{Error conditions}
00063 ****************************************** </lalLaTeX><lalErrTable> */
00064 #define TWODMESHPLOTH_ENUL    1
00065 #define TWODMESHPLOTH_EOUT    2
00066 #define TWODMESHPLOTH_EMEM    3
00067 #define TWODMESHPLOTH_EMETRIC 4
00068 #define TWODMESHPLOTH_ENOPLOT 5
00069 
00070 #define TWODMESHPLOTH_MSGENUL    "Unexpected null pointer in arguments"
00071 #define TWODMESHPLOTH_MSGEOUT    "Output handle points to a non-null pointer"
00072 #define TWODMESHPLOTH_MSGEMEM    "Memory allocation error"
00073 #define TWODMESHPLOTH_MSGEMETRIC "Non-positive metric"
00074 #define TWODMESHPLOTH_MSGENOPLOT "Nothing to plot"
00075 /******************************************** </lalErrTable><lalLaTeX>
00076 
00077 \subsection*{Constants}
00078 
00079 \idx[Constant]{TWODMESHPLOTH\_XSIZE}
00080 \idx[Constant]{TWODMESHPLOTH\_YSIZE}
00081 \idx[Constant]{TWODMESHPLOTH\_XMARG}
00082 \idx[Constant]{TWODMESHPLOTH\_YMARG}
00083 \begin{center}\begin{tabular}{|ccp{4.5in}|}\hline
00084 \texttt{<}\textit{name}\texttt{>} & value & description \\
00085 \hline
00086 \tt XSIZE & 540 & \vspace{-1.4ex}Horizontal size of plotting area (points = 1/72$''$) \\
00087 \tt YSIZE & 720 & \vspace{-1.4ex}Vertical size of plotting area (points) \\
00088 \tt XMARG &  36 & \vspace{-1.4ex}Distance from left of page to plotting area (points) \\
00089 \tt YMARG &  36 & \vspace{-1.4ex}Distance from bottom of page to plotting area (points) \\
00090 \hline
00091 \end{tabular}\end{center}
00092 \vspace{-.1in}The values in the table above are stored in the
00093 constants \verb@TWODMESHPLOTH_@\texttt{<}\textit{name}\texttt{>}.
00094 
00095 ******************************************************* </lalLaTeX> */
00096 
00097 #define TWODMESHPLOTH_XSIZE 540 /* horizontal plot size (points) */
00098 #define TWODMESHPLOTH_YSIZE 720 /* vertical plot size (points) */
00099 #define TWODMESHPLOTH_XMARG  36 /* horizontal margin (points) */
00100 #define TWODMESHPLOTH_YMARG  36 /* vertical margin (points) */
00101 
00102 /********************************************************** <lalLaTeX>
00103 
00104 \subsection*{Types}
00105 
00106 \subsubsection*{Structure \texttt{TwoDMeshPlotStruc}}
00107 \idx[Type]{TwoDMeshPlotStruc}
00108 
00109 \noindent This structure stores parameters specifying how to plot a
00110 PostScript diagram of the parameter mesh.  The fields are:
00111 
00112 \begin{description}
00113 \item[\texttt{REAL4 theta}] Angle from the horizontal direction of the
00114 plot counterclockwise to the $x$-coordinate axis of the mesh, in
00115 degrees.
00116 
00117 \item[\texttt{REAL4 xScale, yScale}] Plotting scale of the mesh
00118 coordinate axes, in points per unit $x$ or $y$ (a point is 1/72 of an
00119 inch).
00120 
00121 \item[\texttt{REAL4 bBox[4]}] Bounding box surrounding the figure in
00122 plot coordinates, measured in points.
00123 
00124 \item[\texttt{BOOLEAN autoscale}] If true, \verb@xScale@ and
00125 \verb@yScale@ will be adjusted so that the drawn figure will lie
00126 within the \verb@bBox@.  If false, \verb@bBox@ will be adjusted to
00127 enclose the figure, given \verb@xScale@ and \verb@yScale@.
00128 
00129 \item[\texttt{REAL4 clipBox[4]}] Four components $x_\mathrm{min}$,
00130 $y_\mathrm{min}$, $x_\mathrm{max}$, $y_\mathrm{max}$ (in that order)
00131 specifying the corners of a box in the $x$-$y$ coordinate system
00132 outside of which no marks will be made.  If either max value is less
00133 than or equal to the corresponding min value, \verb@clipBox@ will be
00134 ignored.
00135 
00136 \item[\texttt{UINT4 nLevels}] The number of levels of recursive
00137 submeshes to plot.  If zero, the mesh will not be plotted (although
00138 the boundary may be).
00139 
00140 \item[\texttt{UINT4 nBoundary}] \emph{half} the number of points to
00141 plot along the boundary of the parameter region.  At least 4 points
00142 are required; if \verb@plotBoundary@$<2$, none will be plotted.
00143 
00144 \item[\texttt{INT2 *plotPoints}] An array from \verb@[0]@ to
00145 \verb@[nLevels]@ indicating how to plot the mesh points at each
00146 recursive level: a value of 0 means don't plot mesh points, a positive
00147 value means to plot filled circles of that diameter (in points), a
00148 negative value means to plot empty circles of that diameter (in
00149 points).
00150 
00151 \item[\texttt{BOOLEAN *plotTiles}] An array from \verb@[0]@ to
00152 \verb@[nLevels]@ indicating whether to plot the tiles around each mesh
00153 point, at each recursive level.
00154 
00155 \item[\texttt{BOOLEAN *plotEllipses}] An array from \verb@[0]@ to
00156 \verb@[nLevels]@ indicating whether to plot the mismatch ellipses
00157 around each mesh point, at each recursive level.
00158 
00159 \item[\texttt{TwoDMeshParamStruc *params}] An array from \verb@[0]@ to
00160 \verb@[nLevels]@ of parameter structures used to generate the meshes
00161 at each recursive level (making the assumption that \emph{all}
00162 submeshes of the same level used the same parameters).  In general
00163 only the \verb@getMetric()@ and \verb@mThresh@ fields are used from
00164 parameter structures after the first.
00165 \end{description}
00166 
00167 ******************************************************* </lalLaTeX> */
00168 
00169 typedef struct tagTwoDMeshPlotStruc {
00170   /* public */
00171   REAL4 theta;
00172   REAL4 xScale, yScale;
00173   REAL4 bBox[4];
00174   BOOLEAN autoscale;
00175   REAL4 clipBox[4];
00176   UINT4 nLevels;
00177   UINT4 nBoundary;
00178   INT2 *plotPoints;
00179   BOOLEAN *plotTiles;
00180   BOOLEAN *plotEllipses;
00181   TwoDMeshParamStruc *params;
00182 
00183   /* private */
00184   BOOLEAN clip;             /* whether to use clipBox, above */
00185   REAL4 cosTheta, sinTheta; /* cosine and sine of theta, above */
00186 } TwoDMeshPlotStruc;
00187 
00188 
00189 /* <lalLaTeX>
00190 \vfill{\footnotesize\input{TwoDMeshPlotHV}}
00191 </lalLaTeX> */
00192 
00193 
00194 /* Function prototypes. */
00195 
00196 /* <lalLaTeX>
00197 \newpage\input{TwoDMeshPlotC}
00198 </lalLaTeX> */
00199 void
00200 LALPlotTwoDMesh( LALStatus         *stat,
00201                  FILE              *stream,
00202                  TwoDMeshNode      *mesh,
00203                  TwoDMeshPlotStruc *params );
00204 
00205 /* <lalLaTeX>
00206 \newpage\input{TwoDMeshTestC}
00207 </lalLaTeX> */
00208 
00209 #ifdef __cplusplus
00210 #pragma {
00211 }
00212 #endif
00213 
00214 #endif /* _TWODMESHPLOT_H */

Generated on Tue Oct 7 02:40:43 2008 for LAL by  doxygen 1.5.2