Maintained Software - Robert L. Parker

Over the years my colleagues and I have written a number of useful programs that are in wide use in research institutions. They are all written in Fortran, come with extensive documentation. Several packages are briefly described below, with links to online documentation. On this page you will find information about plotxy (in the next section), and also color, magmap, dplus, psd, and contour.


The most venerable program is plotxy, originally written by Loren Shure and myself in the 1980s. This package allows the user, either interactively at the terminal, or though scripts, to create graphs in the x-y plane. These days there are dozens of such programs, but plotxy gives the user complete of control of almost every aspect of the graph (eg, overall size, text font, line weight, math and Greek symbols, color palette specification) often absent from the other systems. Control of this kind is essential for production of diagrams for publication: for a scholarly discussion of good practice in the graphical display of scientific data see these class notes by Duncan Agnew (reproduced with permission), largely illustrated with plotxy.

Although matlab effortlessly generates simple graphics during the development stages of a project, production of publication-quality figures is much more tiresome. Control of figure and text size, arrangement on the page, annotation is handled in matlab by a confusing combination of pull-down menus, and function calls, some requiring handle graphics, others not, and documentation is diffuse. In contrast, plotxy offers full control within a uniform framework, documented in one place.

The example above is a figure drawn with plotxy (mapped to jpeg and somewhat degraded) by Andrew Barbour at IGPP, UCSD. Note the different fonts, line weights, the use of filled space, and the graceful numerical axis annotation. The plotxy script for a graph such as this is fairly complex.

The user manual in PDF form is available on this link: plotxydoc; for quick reference see quickplotxy. The status command will report the date of the version you are running. The Fortran-77 source code is available here. A script and the data files for the examples given in the PDF file can be found here.


Contour diagrams are not supported by plotxy. The program color meets this need. The function to be contoured must be sampled on a rectangular lattice of points. The program displays values between specified levels with a uniform color. The levels can be outlined in black, or not, as required. Operation follows the same model as plotxy: commands entered at the terminal or via a script, and a PostScript file describing the graphic is created. Notes can be superimposed on the contour map, as can symbols and other curves, such as coastlines.

For drawing contour maps over the surface of the earth, an automatic mapping facility is provided to Hammer-Aitoff equal-area projection from values on a standard latitude-longitude grid; see the magnetic field maps which were generated by the script at this link. The jpeg conversion of the original PostScript file has muted the colors in this plot.

Matlab's color contouring (contourc) is reasonably good, unlike its plain contouring facilities, which are amateurish. But, as usual, axis control, graph placement and sizing are tricky.

The user manual in PDF form is at the link: colordoc; for a quick reference see quickcolor. The Fortran-77 source code can be downloaded from this link.


The one-dimensional magnetotelluric (MT) inverse problem with discrete and noisy data has simple solution in terms of the spectral function of the admittance, which is the ratio Ey(&omega)/i&omega Bx(&omega) measured at the surface over a range of frequencies &omega . See Chapter 5 in Geophysical Inverse Theory, 1994, by R. L. Parker. When the admittance observations are not exactly compatible with a one-dimensional conductivity profile (which is usually the case) the conductivity function with the smallest misfit to observation, in the sense of the sum of squared discrepancies, is a singular profile, a series of delta functions in conductivity, separated by insulating layers. Structures of this type belong to a set called D+.

The best-fitting solutions to a finite set of admittance data is computed by the program Dplus. It is very useful to determine the smallest possible data misfit that a one-dimensional system can generate without having to perform a nonlinear search in model space, the general but uncertain procedure. Data quality control can be assessed: for example, a large misfit at one frequency can be a clue to the presence of an erroneous data point, or an unrealistic error estimate. Data quality can also be checked in admittances for TE and TM modes in 2-D conductivity structures, although then compatibility with a 1-D profile under each station is only approximate.

Dplus accepts data in a variety of formats and units, and can also generate a plot file for plotxy showing the model response and the optimal profile in D+. Documentation in PDF format is at the link: dplusdoc; Fortran-77 source code is here and a Matlab M-file is here. Please e-mail me if you find this program useful.


In geomagnetism and paleomagnetism is commonly desired to make maps of magnetic field components or directions over the surface of the Earth or the core, based on Spherical harmonic representations. Magmap provides an easy interface to do this. The program supplies several map projections, including Hammer-Aitoff equal area, Lambert equal area, Mercator, and plain lat-long. The radial field Br at the core's surface is plotted in this graphic for two spherical harmonic models: a new field model and for IGRF1900. Here Hammer-Aitoff projection is used. The magmap script making this plot can be found here.

Magmap creates diskfiles containing regular two-dimensional arrays of numbers, sampling the required element to be plotted, and also provides scripts for mapping the contours of the function through the program color or contour.

Magmap also has facilities for calculating field elements for any point, on or above the Earth's surface, or within the body of the Earth. The program has available IGRF field models from 1900 to 2000, but can also read Gauss coefficients (spherical harmonics) from a diskfile. All conventional normalizations of the spherical harmonics are catered for.

The user manual in PDF form is at the link: magmapdoc; for a quick reference see quickmagmap. Fortran-77 source is at this link.


P.S.D. stands for the Power Spectral Density, often simply referred to as the power spectrum, a property of stationary stochastic time series that usually provides remarkable insights into the physical processes in question. Loosely speaking, the PSD gives the energy density in each frequency band; it is a statistic of the underlying random process, and so it can only be estimated from a given realization, that is, a given finite collection of data. There are probably dozens of different estimation algorithms for the job. The program psd provides a small number of easily used methods, with the intent of providing a good spectral estimate without requiring the user to set too many tuning parameters.

Specifically, psd is based on the sine multitaper approach of Riedel and Sidorenko to spectral estimation. All spectral estimators smooth the spectrum in order to reduce variance; the S-R method applies smoothing that varies with frequency to minimize the sum of variance and bias at each point.

The user can leave all the choices to the program, or he or she can request higher resolution (with smooth) at the expense of increased variance, or apply a prewhitening FIR filter, among other options. The input data need not be evenly spaced in time - spline interpolation is provided. Graphical output (see below) is generated during the run via plotxy.

The power spectrum shown in the example was created from a time series of the water level in the Salton Sea, with a simple script, which explores the effects of several different parameter settings: in black, default settings; in red, increased resolution by a factor of two; in blue, a fixed number of tapers in each frequency band.

The user manual in PDF form is at the link: psddoc; for quick reference see quickpsd. The Fortran-77 source can be found on this link. A slimmed-down matlab version is also available here, but it performs only sine multitaper analysis with a fixed set of parameters.


As an alternative to color for contouring is the old-fashioned approach of drawing labeled level lines without shaded areas of colors or grey. For many purposes this is quite acceptable and, since it is far cheaper to publish line drawings than color plates, the program contour may be the method of choice.

The example above was created with a contour script. It shows two contour maps superimposed, one with solid, the other with dashed level lines, and coastlines.

Color and contour are very similar, although contour is somewhat more flexible in providing annotation and labels as well as addition lines on the finished plot. The user manual in PDF form can be found by going to the link contourdoc; the quick reference HTML file is at quickcontour. Fortran-77 source can be found here.


For a class in complex analysis I wrote a set of scripts for matlab that enabled the student to explore analytic functions. The user has the responsibility of writing a matlab function script defining the function he or she wishes to explore. The main script, zmap.m, generates an array and displays the results as a contour plot of magnitude and phase, together with the site of the singularities and branch cuts. An example is shown below. The function displayed is

f(z) = -1/(0.2 + i - [z2 - 1]1/2) .

You can see the pole and branch cut clearly in this graph.

Other kinds of displays, such as perspective plots, or graphs of the real and imaginary parts are also provided. Simple scripts also allow the user to zoom in or out and to move around the plane to locate points of interest.

A script is provided to perform path integrals numerically in the plane, on lines input with the mouse.

A brief description of the capabilities can be found at zlabdoc; and the quick reference guide is at quickzlab. The matlab source scripts are in zlab.m.