Provides structures, functions and macro definitions for modules that generate MATHEMATICA notebooks.
Currently, the only modules using this header file are LALMath3DPlot()
, which generates 3D animated plots of template banks having three parameters and LALMathNDPlot()
which plots the 3-dimensional projections of a bank that is N-dimensional.
This header file defines macros containing MATHEMATICA syntax that is otherwise messy to implement into C source files. Here is how to use these macros to make your own program generate a MATHEMATICA notebook.
The result is very readable/changeable source similar in style to most markup languages. An example program might look like:
Prototypes | |
void | LALMath3DPlot (LALStatus *status, Math3DPointList *first, INT4 *ntiles, REAL4 *pointSize) |
This function is for plotting 3D template banks by creating a MATHEMATICA notebook. More... | |
void | LALMathNDPlot (LALStatus *stat, MathNDPointList *first, INT4 *ntiles, REAL4 *pointSize) |
This function is for plotting N-Dimensional template banks by creating a MATHEMATICA notebook. More... | |
Data Structures | |
struct | Math3DPointList |
This type is used by LALMath3DPlot.c as an input structure to plot 3-dimensional template banks. More... | |
struct | MathNDPointList |
This type is similar to Math3DPointList except the coordinates are stored as data in the REAL4Vector coordinates . More... | |
Files | |
file | LALMath3DPlotTest.c |
Tests LALMath3DPlot(). | |
file | LALMathNDPlotTest.c |
Tests LALMathNDPlot(). | |
Error Codes | |
#define | LALMATHEMATICAH_ENULL 1 |
NULL pointer to a LALMathematica.h input structure. More... | |
#define | LALMATHEMATICAH_EFILE 2 |
Could not open file to write a Mathematica Notebook. More... | |
#define | LALMATHEMATICAH_EVAL 3 |
Invalid parameter value. More... | |
Macros | |
See the source file LALMath3DPlot.c for an example of how to use these macros to generate a MATHEMATICA notebook in your own program.
Notice that the file pointer must be named "nb" in order to use the macros defined in this header. When grouping several cell objects together the last object in the list should have an underscored END tag instead of an END tag without an underscore. Although the notebook will compile (usually) if you use the tags without an ending underscore, the dangling comma is taken as a null member of the list of grouped cells. Therefore, when you view the notebook in MATHEMATICA you may see the word "NULL" printed on a line. That is an indication that you should use the underscore version of the tag which preceeded the "NULL" statement. | |
#define | BEG_NOTEBOOK fprintf(nb, "Notebook[{\n") |
#define | END_NOTEBOOK fprintf(nb, "}]\n") |
#define | BEG_TITLECELL fprintf(nb, "Cell[\"") |
#define | END_TITLECELL fprintf(nb, "\", \"Title\"],\n") |
#define | END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n") |
#define | BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n") |
#define | END_GROUPCELLC fprintf(nb, "}, Closed ]],\n") |
#define | END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n") |
#define | BEG_SECTIONCELL fprintf(nb, "Cell[\"") |
#define | END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n") |
#define | END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n") |
#define | BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(") |
#define | END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n") |
#define | END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n") |
#define | BEG_TEXTCELL fprintf(nb, "Cell[\"\<") |
#define | END_TEXTCELL fprintf(nb, "\>\", \"Text\"],\n") |
#define | END_TEXTCELL_ fprintf(nb, "\>\", \"Text\"]\n") |
void LALMath3DPlot | ( | LALStatus * | stat, |
Math3DPointList * | first, | ||
INT4 * | ntiles, | ||
REAL4 * | pointSize | ||
) |
This function is for plotting 3D template banks by creating a MATHEMATICA notebook.
The notebook renders the templates as points in a three dimensional lattice. The plot is animated so the user can see the template bank from different perspectives. See this figure.
Currently the plot doesn't show the contour of the templates; it renders them as spheres. In the case of metrics with disimilar scales along the principle directions you will notice considerable space between points accordingly.
stat | LALStatus structure pointer |
first | Math3DPointList stucture pointer |
ntiles | pointer to the number of templates you plan to plot. This may be called as NULL. If it is called with a value this function will check to see if the Math3DPointList has the correct number of templates. If it does not a warning will be printed. |
pointSize | \(\epsilon[0,1]\) which specifies the relative size of each point to the final display area. (e.g. 1 would fill the entire plot.) This may be called as NULL and a calculated value will be assigned. (It's only a rough guess) |
Definition at line 59 of file LALMath3DPlot.c.
void LALMathNDPlot | ( | LALStatus * | stat, |
MathNDPointList * | first, | ||
INT4 * | ntiles, | ||
REAL4 * | pointSize | ||
) |
This function is for plotting N-Dimensional template banks by creating a MATHEMATICA notebook.
The notebook renders the templates as points in all of the 3-Dimensional projection permutations. Each projection may be animated so the user can see the template bank from different perspectives.
stat | LALStatus structure pointer |
first | MathNDPointList stucture pointer |
ntiles | INT4 pointer to the number of templates you plan to plot. This may be called as NULL. If it is called with a value this function will check to see if the MathNDPointList has the correct number of templates. If it does not a warning will be printed. |
pointSize | \(\epsilon[0,1]\) which specifies the relative size of each point to the final display area. (e.g. 1 would fill the enire plot.) This may be called as NULL and a calculated value will be assigned. (Its only a rough guess) |
Definition at line 66 of file LALMathNDPlot.c.
#define LALMATHEMATICAH_ENULL 1 |
NULL pointer to a LALMathematica.h input structure.
Definition at line 102 of file LALMathematica.h.
#define LALMATHEMATICAH_EFILE 2 |
Could not open file to write a Mathematica Notebook.
Definition at line 103 of file LALMathematica.h.
#define LALMATHEMATICAH_EVAL 3 |
Invalid parameter value.
Definition at line 104 of file LALMathematica.h.
#define BEG_NOTEBOOK fprintf(nb, "Notebook[{\n") |
Definition at line 145 of file LALMathematica.h.
#define END_NOTEBOOK fprintf(nb, "}]\n") |
Definition at line 146 of file LALMathematica.h.
#define BEG_TITLECELL fprintf(nb, "Cell[\"") |
Definition at line 147 of file LALMathematica.h.
#define END_TITLECELL fprintf(nb, "\", \"Title\"],\n") |
Definition at line 148 of file LALMathematica.h.
#define END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n") |
Definition at line 149 of file LALMathematica.h.
#define BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n") |
Definition at line 150 of file LALMathematica.h.
#define END_GROUPCELLC fprintf(nb, "}, Closed ]],\n") |
Definition at line 151 of file LALMathematica.h.
#define END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n") |
Definition at line 152 of file LALMathematica.h.
#define BEG_SECTIONCELL fprintf(nb, "Cell[\"") |
Definition at line 153 of file LALMathematica.h.
#define END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n") |
Definition at line 154 of file LALMathematica.h.
#define END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n") |
Definition at line 155 of file LALMathematica.h.
#define BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(") |
Definition at line 156 of file LALMathematica.h.
#define END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n") |
Definition at line 157 of file LALMathematica.h.
#define END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n") |
Definition at line 158 of file LALMathematica.h.
#define BEG_TEXTCELL fprintf(nb, "Cell[\"\<") |
Definition at line 159 of file LALMathematica.h.
#define END_TEXTCELL fprintf(nb, "\>\", \"Text\"],\n") |
Definition at line 160 of file LALMathematica.h.
#define END_TEXTCELL_ fprintf(nb, "\>\", \"Text\"]\n") |
Definition at line 161 of file LALMathematica.h.