Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
TwoDMeshPlot.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Jolien Creighton, Teviet Creighton
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20
21#ifndef _TWODMESHPLOT_H
22#define _TWODMESHPLOT_H
23
24#include <lal/LALStdlib.h>
25
26#if defined(__cplusplus)
27extern "C" {
28#elif 0
29} /* so that editors will match preceding brace */
30#endif
31
32/**
33 * \author Creighton, T. D.
34 * \defgroup TwoDMeshPlot_h Header TwoDMeshPlot.h
35 * \ingroup lalpulsar_templbank
36 * \brief Provides routines to plot two-dimensional parameter meshes.
37 *
38 * ### Synopsis ###
39 *
40 * \code
41 * #include "TwoDMeshPlot.h"
42 * \endcode
43 *
44 * This header covers routines that display 2-dimensional
45 * parameter meshes as generated by the routines in \ref TwoDMesh_h.
46 * The output is written to a C \c FILE-type stream using
47 * fprintf(). The routines do not provide a system-level interface
48 * to open or close file streams; they simply assume that they have been
49 * passed an open, writable stream. Nonetheless, their use of stream I/O
50 * means that they cannot be included in LAL (although executables, in
51 * particular the \ref TwoDMesh_h test programs, may statically link
52 * against their object files).
53 */
54/** @{ */
55
56/** \name Error Codes */
57/** @{ */
58#define TWODMESHPLOTH_ENUL 1
59#define TWODMESHPLOTH_EOUT 2
60#define TWODMESHPLOTH_EMEM 3
61#define TWODMESHPLOTH_EMETRIC 4
62#define TWODMESHPLOTH_ENOPLOT 5
63
64#define TWODMESHPLOTH_MSGENUL "Unexpected null pointer in arguments"
65#define TWODMESHPLOTH_MSGEOUT "Output handle points to a non-null pointer"
66#define TWODMESHPLOTH_MSGEMEM "Memory allocation error"
67#define TWODMESHPLOTH_MSGEMETRIC "Non-positive metric"
68#define TWODMESHPLOTH_MSGENOPLOT "Nothing to plot"
69/** @} */
70
71/**
72 * \name Constants
73 * \brief The values in the table above are stored in the constants \c TWODMESHPLOTH_<tt><</tt>\e name<tt>></tt>.
74 */
75/** @{ */
76#define TWODMESHPLOTH_XSIZE 540 /**< Horizontal size of plotting area (points = \f$ 1/72'' \f$ ) */
77#define TWODMESHPLOTH_YSIZE 720 /**< Vertical size of plotting area (points) */
78#define TWODMESHPLOTH_XMARG 36 /**< Distance from left of page to plotting area (points) */
79#define TWODMESHPLOTH_YMARG 36 /**< Distance from bottom of page to plotting area (points) */
80/** @} */
81
82/**
83 * \brief This structure stores parameters specifying how to plot a PostScript diagram of the parameter mesh.
84 */
85typedef struct tagTwoDMeshPlotStruc {
86 REAL4 theta; /**< Angle from the horizontal direction of the plot counterclockwise to the \f$ x \f$ -coordinate axis of the mesh, in degrees */
87 REAL4 xScale, yScale; /**< Plotting scale of the mesh coordinate axes, in points per unit \f$ x \f$ or \f$ y \f$ (a point is 1/72 of an inch) */
88 REAL4 bBox[4]; /**< Bounding box surrounding the figure in plot coordinates, measured in points. */
89 BOOLEAN autoscale; /**< If true, \c xScale and \c yScale will be adjusted so that the drawn figure will lie
90 * within the \c bBox. If false, \c bBox will be adjusted to enclose the figure, given \c xScale and \c yScale.
91 */
92 REAL4 clipBox[4]; /**< Four components \f$ x_\mathrm{min} \f$ , \f$ y_\mathrm{min} \f$ , \f$ x_\mathrm{max} \f$ , \f$ y_\mathrm{max} \f$ (in that order)
93 * specifying the corners of a box in the \f$ x \f$ - \f$ y \f$ coordinate system outside of which no marks will be made; if either
94 * max value is less than or equal to the corresponding min value, \c clipBox will be ignored.
95 */
96 UINT4 nLevels; /**< The number of levels of recursive submeshes to plot. If zero, the mesh will not be plotted (although the boundary may be) */
97 UINT4 nBoundary; /**< \e half the number of points to plot along the boundary of the parameter region; at least 4 points are required;
98 * if \c plotBoundary \f$ <2 \f$ , none will be plotted.
99 */
100 INT2 *plotPoints; /**< An array from <tt>[0]</tt> to <tt>[nLevels]</tt> indicating how to plot the mesh points at each
101 * recursive level: a value of 0 means don't plot mesh points, a positive value means to plot filled
102 * circles of that diameter (in points), a negative value means to plot empty circles of that diameter (in points)
103 */
104 BOOLEAN *plotTiles; /**< An array from <tt>[0]</tt> to <tt>[nLevels]</tt> indicating whether to plot the tiles around each mesh
105 * point, at each recursive level.
106 */
107 BOOLEAN *plotEllipses;/**< An array from <tt>[0]</tt> to <tt>[nLevels]</tt> indicating whether to plot the mismatch ellipses
108 * around each mesh point, at each recursive level.
109 */
110 TwoDMeshParamStruc *params;/**< An array from <tt>[0]</tt> to <tt>[nLevels]</tt> of parameter structures used to generate the meshes
111 * at each recursive level (making the assumption that \e all submeshes of the same level used the same parameters);
112 * in general only the <tt>getMetric()</tt> and \c mThresh fields are used from parameter structures after the first.
113 */
114 /* private */
115 BOOLEAN clip; /**< [private] whether to use clipBox, above */
116 REAL4 cosTheta, sinTheta; /**< [private] cosine and sine of theta, above */
118
119
120/** \cond DONT_DOXYGEN */
121/* Function prototypes. */
122void
124 FILE *stream,
125 TwoDMeshNode *mesh,
127
128/** \endcond */
129
130/** @} */
131
132#if 0
133{
134 /* so that editors will match succeeding brace */
135#elif defined(__cplusplus)
136}
137#endif
138
139#endif /* _TWODMESHPLOT_H */
unsigned char BOOLEAN
int16_t INT2
uint32_t UINT4
float REAL4
void LALPlotTwoDMesh(LALStatus *stat, FILE *stream, TwoDMeshNode *mesh, TwoDMeshPlotStruc *params)
Plots a hierarchical mesh of templates on an 2-dimensional parameter space.
Definition: TwoDMeshPlot.c:97
This structure represents a single node in a linked list of mesh points, specified in the coordinate ...
Definition: TwoDMesh.h:124
This structure stores the parameters required by the two-dimensional mesh placement functions.
Definition: TwoDMesh.h:142
This structure stores parameters specifying how to plot a PostScript diagram of the parameter mesh.
Definition: TwoDMeshPlot.h:85
REAL4 theta
Angle from the horizontal direction of the plot counterclockwise to the -coordinate axis of the mesh...
Definition: TwoDMeshPlot.h:86
UINT4 nLevels
The number of levels of recursive submeshes to plot.
Definition: TwoDMeshPlot.h:96
BOOLEAN clip
[private] whether to use clipBox, above
Definition: TwoDMeshPlot.h:115
INT2 * plotPoints
An array from [0] to [nLevels] indicating how to plot the mesh points at each recursive level: a valu...
Definition: TwoDMeshPlot.h:100
BOOLEAN * plotTiles
An array from [0] to [nLevels] indicating whether to plot the tiles around each mesh point,...
Definition: TwoDMeshPlot.h:104
BOOLEAN autoscale
If true, xScale and yScale will be adjusted so that the drawn figure will lie within the bBox.
Definition: TwoDMeshPlot.h:89
BOOLEAN * plotEllipses
An array from [0] to [nLevels] indicating whether to plot the mismatch ellipses around each mesh poin...
Definition: TwoDMeshPlot.h:107
TwoDMeshParamStruc * params
An array from [0] to [nLevels] of parameter structures used to generate the meshes at each recursive ...
Definition: TwoDMeshPlot.h:110
UINT4 nBoundary
half the number of points to plot along the boundary of the parameter region; at least 4 points are r...
Definition: TwoDMeshPlot.h:97