The basic commands of Open GENIE plus multiline commands, for example IF - ELSE - ENDIF statements can be combined into gcl procedures. Below is a list of examples, these are arranged, so that the programs can be easily run by Open GENIE test routines, or by someone trying to get an idea of what Open GENIE can do. Most programs have their own directory, with the data required taken from files stored in this area.
It is best that these programs are loaded and run from the appropriate directory. For example, use the the file dopamine.gcl in the directory /usr/local/genie/examples/simple_graphics. Firstly open a genie command console, change to the appropriate directory, and then load the desired program using, e.g.
>>cd "/usr/local/genie/examples/simple_graphics"
>>load "dopamine.gcl"
and run these programs using the name of the file, minus the extension, in this case:
>>dopamine
The full directory path shown above is taken from a typical UNIX system, you should use the appropriate path for your system. The examples directory always exists directly below the main genie directory, with individual example programs in varuous sub-directories. All the examples currently available are listed below, under their sub-directories (shown in bold) with filenames (shown in italics).
![]() | analysis |
focus_example.gcl - this example puts the necessary defaults into a workspace, that is required for focusing data from an IRIS raw data file.
integrate_example.gcl - integrates a single spectra and a set of single spectra
rebin_example.gcl - rebins the data to the same range, but different number of time channels, then integrates the spectra. The procedure then rebins to a given X range, to a set of given X values, and to linear steps in a given range and then integrated. The data is then rebinned using logarithmic steps and integrated.
![]() | contour |
contour_test.gcl - draws a filled colour contour plot, and then overplots two sets of contour lines,
![]() | iris |
add.gcl - procedure to analyse IRIS diffraction data. Developed by P. Marshall
![]() | data |
This directory holds the data used for some of the procedures in the examples section.
![]() | ex1 |
dssdemo.gcl - this demonstrates the use of different plot styles, with error bars and line plots of linear and logarithmic scales.
![]() | io |
contains various examples of programs concerned with the input and output of data from genie.
ascii_file.gcl - demonstrates the use of Open GENIE routines to read/write ASCII data using the ASCIIFILE command.
ascii_io.gcl - demonstrates the use of Open GENIE routines to output and input data in a fixed easy reading ASCII file format using the Get and Put command.
intermediate_file.gcl - gives an example of the use of the Open GENIE routines to manipulate intermediate files.
raw_file.gcl - example of the use of Open GENIE routines to read and manipulate spectra from ISIS raw files.
ccsl.gcl -
![]() | modules |
This directory gives examples of wrapping routines - c_example.gcl and fortran_example.gcl - for the calling of a module from within Open GENIE written in gcl, and examples of a such modules for C and FORTRAN- c_example.c and fortran_example.f
![]() | newget |
In this section examples are given of C, C++, and FORTRAN files, which can be used like the get() function of Open GENIE.
![]() | peak |
pktest.gcl - a procedure which generates data from a quadratic equation and then fits a cubic equation to the data, with the linear part of the function inputted by the user and then held constant. The data, the fit and the residuals are then plotted.
![]() | prisma |
diffuse.gcl, phon.gcl - examples of publication graphics by Mark Harris. Loads ASCII data from a file creating a graph and plotting observed and theoretical data as markers and lines respectively.
![]() | report |
report.gcl - this procedure demonstrates the ability to read data using an external FORTRAN program, and the use of CONTOUR and CELL_ARRAY commands in making a colour contour plot on data taken on MARI.
![]() | simple_graphics |
boxes.gcl - this procedure draws boxes on the plot window with corners chosen by the operator.
dopamine.gcl - this procedure reads in a .PRO file. It then plots two ranges of observed data as points with the calculated data plotted as a line. The difference between the calculated and data plot below. The data file OPT17.PRO was obtained from a Rietveld fit of a structural model of deuterated dopamine hydrobromide to HRPD data.
funcplot.gcl - this plots a function of your own specification by writing a module "on the fly" and then using this module to generate the data points.
test_mutitplot.gcl - a procedure which produces a multi-plot from a spectra, and then Examples of multiplots constructs a multiplot from a 2-D array.
textcirc.gcl - draws the string "A simple text string" in a circle.
arcs.gcl - uses a module to draw arcs.
![]() | slides |
slides.gcl - this procedure is a slide demonstration of Open GENIEs main features.
![]() | two_d_graphics |
contour_test.gcl - displays a contour plot of a set of neutron inelastic spectra taken on IRIS.
glad.gcl - draws a colour intensity map of S(Q, w) data taken on MARI, which also allows you to see slices of the intensity variation with constant energy, and momentum.
funcplot2.gcl - this plots a function of your own specification by writing a module "on the fly" and then using this module to generate two dimensional data points.
![]() | new_graphics |
basics.gcl - combined demonstration of various graphics commands, such as multi_plot and contour.
![]() | NeXus |
nexus.gcl - gives an example of the use of the Open GENIE routines to manipulate NeXus files.
![]() | three_d_graphics |
solid_objects.gcl - demonstrates the creation of 3d objects, such as balls, cones, and rods.
IsoSurfaceTest.gcl - Plots an iso-surface through a 3-D "unit cell" array of density using the IsoSurface command.
LatticePlaneTest.gcl - Plots a light shaded semi_transparent slice through a 3-D unit cell lattice using the LatticePlane command..
LatticeSliceTest.gcl - Plots a density-coloured slice through a 3-D unit cell array of data using the LatticeSlice command.
PlaneTest.gcl - Plots a (convex) planar polygon using the Plane command.
SurfaceTest.gcl - Plots a 3-D surface for a 2-D (unit cell) array of data using the Surface command.
funcplot.gcl - This plots a function of your own specification by writing a module "on the fly" and then using this module to generate data for a Surface plot.
cover.gcl - Extends the above with 3d "Open Genie" text.
funcplot2.gcl - a variation on funcplot.gcl using a different colour table.
iso_funcplot.gcl - This plots a function of your own specification by writing a module "on the fly" and then using this module to generate data for an IsoSurface plot.
mari_plot.gcl - Generattes a Surface plot using the same data used by report.gcl in the report directory.
sphere.gcl - Uses a module to generate data points for plotting a sphere with the IsoSurface command.