Open Source Software


Spherical harmonics and localization: the definitive suite

bcoupling Calculates the boxcar coupling matrix
bpboxcap Calculates the power spectrum of zonal boxcar caps or belts
galpha Spatial eigensolutions of the localization problem (Simons, Dahlen and Wieczorek 3.15/5.7)
gammap Calculates a matrix important to calculate the variance of multitaper estimates
gammab Calculates another matrix important to calculate the variance of multitaper estimates
glmalpha Spectral eigensolutions of the localization problem (Simons, Dahlen and Wieczorek 4.6/5.2)
mcoupling Calculates the individual multitaper coupling matrix
mcouplings Calculates the eigenvalue-weighted multitaper coupling matrix
multivar Calculates the multitaper estimation variance
mvarratios Calculates the eigenvalue-weighted multitaper estimation variance
multivar Calculates the multitaper estimation variance, the fast way
periodovar Calculates the periodogram estimation variance
plm Associated Legendre functions (Dahlen & Tromp B.48)
ulmmp Single-degree transformation matrix that maps real to complex harmonics
ummp Block-transformation matrix that maps real to complex harmonics
plm Associated Legendre functions (Dahlen & Tromp B.48)
xlm Normalized associated Legendre polynomials (Dahlen & Tromp B.58)
ylm Normalized real spherical harmonics (Dahlen & Tromp B.72)
pxyerh Error handling for PLM, XLM and YLM
pxynrm Normalization verification (Dahlen & Tromp B.49/B.59/B.73)
randsphere Calculates points randomly distributed on a spherical surface
whitevariance Calculates the multitaper estimation variance, the slow way

Spatiospectral localization on the sphere

africa Coordinates and splining of Africa
amazon Coordinates and splining of the Amazon basin
australia Coordinates and splining of Australia
bezier Smooths a geograhic curve by B-spline fitting
boxcap Calculates zonal polar boxcar tapers
boxcaptarget Targets a zonal polar boxcar tapers to a point on the sphere
caploc Calculates the location of a spherical cap
christoffeldarboux Verifies various Christoffel-Darboux theorems
dlmlmp Calculates the axisymmetric spatiospectral concentration kernel
dphpatch Calculates the integration domain of a spherical patch
dphregion Calculates the integration domain of a closed spherical surface
england Coordinates and splining of England
eurasia Coordinates and splining of Eurasia
greenland Coordinates and splining of Greenland
grunbaum Calculates circular single-cap tapers of a single angular order
grunbaum2 Calculates circular double-cap tapers of a single angular order
kernelc Finds the kernel whose eigenfunctions are optimally concentrated
legendreprodint Integrates products of Legendre functions
localization Finds bandlimited functions localized to a closed spherical domain
namerica Coordinates and splining of North America
nsubm Calculates partial Shannon number at a single angular order
orinoco Coordinates and splining of the Orinoco basin
orthocheck Checks orthogonality, determines integration points, calculates eigenvalues
phicurve Finds longitude crossings at query latitudes for closed spherical curves
samerica Coordinates and splining of South America
spharea Computes areas of closed domains on the unit sphere
sdwallcons Calculates localization solutions to all of Earth's continents
sdwcap Calculates circular single-cap tapers of a single angular order
sdwcap2 Calculates circular double-cap tapers of a single angular order
sdwtarget Targets a single-order circular taper to a point on the sphere
sinsin Performs longitudinal integral with (co)sine functions
sincos Performs longitudinal integral with (co)sine functions
coscos Performs longitudinal integral with (co)sine functions
coscosexp Performs longitudinal integral with (co)sine functions and complex exponentials
sincosexp Performs longitudinal integral with (co)sine functions and complex exponentials

The Spherical Harmonics Transform and its Inverse

addmabout Find the running index in a block array with SH degrees and orders
addmin Repeats the degrees in a vector l+1 times
addmoff Calculates total number of orders belonging to an alternative SH expansion
addmon Lists degrees and orders belonging to a SH expansion
addmout Lists degrees and orders belonging to an alternative SH expansion
addmup Calculates total number of orders belonging to a SH expansion
blanco Calculates spherical harmonics rotation (Wigner-D) matrix, method I
cpx2rsh Converts complex to real spherical harmonics coefficients
datafit Least-squares solutions to a linear system with (un)known data covariance
dlmb Calculates spherical harmonics rotation (Wigner-D) matrix, method II
gaunt Calculates Gaunt coefficients using three different algorithms
gausslegendre Performs Gauss-Legendre quadrature
gausslegendrecof Calculates weights and abscissas for Gauss-Legendre integration
geopotential Plots geopotential fields for Earth, Moon and Mars
guseinov Calculates Clebsch-Gordan and Gaunt coefficients using binomial coefficients
legendrecof Calculates roots and coefficients of Legendre polynomials
legendreroots Calculates roots of Legendre polynomials
libbrecht Libbrecht's algorithm to calculate high-order Legendre functions
plm2pot Reads in and scales geopotential coeffficients
plm2rot Rotation of spherical harmonics coefficients using Euler angles
plm2spec Calculates the power spectrum of real spherical harmonic coefficients
plm2th Inverse single-order spherical harmonic transform
plm2xyz Inverse spherical harmonic transform
plotonsphere Plots data on a sphere
plotonearth Plots data on an Earth sphere with continents
plotplm Plots spherical harmonics in various ways
pl2th Inverse Legendre transform
rotenberg Calculates Wigner symbol values from Rotenberg's peculiar notation
rsh2cpx Converts real to complex spherical harmonics coefficients
rotcof Rotation of spherical harmonics coefficients around z-axis
shcos Retrieves spherical harmonics cosine coefficients from matrix listing
shsin Retrieves spherical harmonics sine coefficients from matrix listing
simpson Performs Simpson quadrature
sinsinexp Performs longitudinal integral with (co)sine functions and complex exponentials
sixj Calculates Wigner 6j coefficients, from lookup table
th2pl Forward Legendre transform
th2plm Forward single-order spherical harmonic transform
threej Calculates Wigner 3j coefficients, from lookup table
topography Plots topography fields for Earth, Moon and Mars
trapeze Performs trapezoidal quadrature
triangle Checks the triangle inequality
wignercycle Calculates Wigner 3j coefficients, for lookup table
wigner0j Calculates zero-bottom-row Wigner 3j coefficients, by recursion
wigner3j Calculates Wigner 3j coefficients, by recursion... so-so algorithm
wigner3jm Calculates Wigner 3j coefficients, by recursion... better algorithm
wigner6j Calculates Wigner 6j coefficients, by recursion
xyz2plm Forward spherical harmonic transform
zeroj Calculates zero-bottom-row Wigner 3j coefficients, from lookup table

Earthquake early warning

wtALL Analyzes a whole directory of data in SAC form and prints results to a file
wtALL_diagnostics The actual results of the above analysis used and interpreted by Simons et al., EPSL (2006)
allen1 One of a sequence of programs related to Simons et al., EPSL (2006)
allen2 One of a sequence of programs related to Simons et al., EPSL (2006)
allen3 One of a sequence of programs related to Simons et al., EPSL (2006)
allen4 One of a sequence of programs related to Simons et al., EPSL (2006)
allen5 One of a sequence of programs related to Simons et al., EPSL (2006)
allen6 One of a sequence of programs related to Simons et al., EPSL (2006)
allen7 One of a sequence of programs related to Simons et al., EPSL (2006)
allen8 One of a sequence of programs related to Simons et al., EPSL (2006)
allen9 One of a sequence of programs related to Simons et al., EPSL (2006)
locident An auxiliary program to the above codes used to Simons et al., EPSL (2006)
statident An auxiliary program to the above codes used to Simons et al., EPSL (2006)
installen Computes the instantaneous frequency of a signal

The Wavelet Transform and its Inverse in Various Incarnations

abank Analysis filter bank
compres Figures out compression level of the wavelet approximation
decay Figures out the decay of the wavelet coefficients
denoise Denoises a signal by wavelet thresholding
dnums Figures out the number of scaling and wavelet coefficients
dyadplot Plots wavelet and scaling coefficients on dyadic grid
even Returns logical downsampling array
fbank Filter bank illustration of perfect reconstruction
graphs Computes graphs of wavelets and scaling functions
intersub Interpolation subdivision for interpolating boundary filters
iwt Inverse wavelet transform (this is the main routine)
landd Returns lengths and downsampling arrays
liftco Wavelet coefficients and lifting steps
makewc Makes and saves data base with wavelet coefficients
plotnorm Plots data on unit interval
polyphase Returns the polyphase forms for a given filter pair
prodco Checks the product filter
sbank Synthesis filter bank
succapp Successive approximation of a signal by wavelet analysis
succaplot Plots successive wavelet approximation of a signal
tenlectures63 Reproduces Figure 6.3 of Daubechies' "Ten Lectures" book
threshold Thresholds wavelet or scaling coefficients
wavetour710 Reproduces Figure 7.10 of Mallat's "Wavelet Tour" book
wavetour714 Reproduces Figure 7.14 of Mallat's "Wavelet Tour" book
wc Lists wavelet filter coefficients
wigner Computes the alias-free Wigner-Ville distribution
wt Forward wavelet transform (this is the main routine)
wtimax Makes a wavelet time axis for polyphase and lifting implementations
wtlift Fast discrete wavelet transform by (integer) lifting

Robust power estimation and 1-D spectral analysis

bracewell Illustrates the real/imaginary properties of the Fourier transform
fhanning Calculates a Hann window for spectral analysis
jackknife Returns delete-one sampling matrix for a set of values
pchave Chave's method of robust spectral estimation
pchavedemo Illustration of Chave's method of spectral estimation
spectrogram Calculation of the spectrogram
specdensplot Calculates and then nicely plots the spectral density using PCHAVE
timdomplot Reads and then nicely plots seismic data using READSAC
timspecplot Calculates and then nicely plots the spectrogram using SPECTROGRAM

Lithospheric flexure, loading and 2-D spectral analysis

annulus Calculates a 2-dimensional annulus
bayram Calculates a Hermite-multiple window spectral estimate
choice Picks a set of Hermite multitapers
cohen Calculates the smoothing kernel for a Cohen's class spectral estimator
forsyth Predicts coherence and admittance using Forsyth's (1985) method
geninv Calculates the generalized inverse
halfmazi Calculates maximum and half maximum along an azimuth in a 2-D data set
halfmiso Calculates maximum and half maximum of an azimuthally averaged 2-D data set
hermite Computes Hermite-polynomial multitapers
hermitian Makes a matrix Hermitian so its inverse Fourier transform is real
knum2 Makes a Hermitian two-dimensional wavenumber scale
laguerre Computes Laguerre polynomials
loading Computes topography, gravity and their relation for an arbitrary loading model
loading1 A demo version of loading
maxazi Calculates mean and maximum of mean azimuthal line integral of a data set.
mckenzie Predicts coherence and admittance using McKenzie's (2003) method
mtm3 Two-dimensional multi-taper analysis with Slepian tapers
mtm4 Two-dimensional multi-taper analysis with Hermite tapers
parker Computes terrain/Bouguer corrections using Parker's (1972) method
planef Calculates and/or draws a plane
planefit Calculates a best-fitting plane through a data set
randphase Returns random phase angles
syncoh Creates a data set with a known coherence to another one
transl Predicts transitional coherence wavelength for a loading model

Image Analysis Bits and Pieces

blockcorr Calculates correlation coefficients between tiles of two images
blockcorr2 Uses BLOCKCORR to find best-fitting shifts to align two images
blockcorr3 Uses BLOCKCORR2 to successively correlate a series of images
blockisolate Retrieves a submatrix from within a larger matrix
blockisolate2 Retrieves a subregion from within a larger area, in physical coordinates
blockmean Calculates means of submatrices within a matrix
blocktile Calculates (the number of) overlapping squares tiling a matrix
innermerge Writes newly aligned images from parameters calculated by BLOCKCORR3

Seismic Processing Bits and Pieces

readsac Reads SAC-formatted binary seismograms
writesac Writes SAC-formatted binary seismograms
lowpass Low pass filtering
bandpass Bandpass filtering
hipass High pass filtering
stalta STA/LTA triggering algorithm
wtevents Makes a diagnostic wavelet analysis plot of a seismogram

Surface-wave ray tracing and azimuthal anisotropy

acor2ind Matches a physical coordinate to a sequential equal-area grid cell index
aind2sub Returns row and 'column' index given a sequential equal-area grid cell number
apex Calculates highest points on a great circle
asub2ind Returns a sequential equal-area grid cell number given a row and 'column' index
authalic Calculates an equal-area grid for a regional tomography experiment
clutser Simplified clustering algorithm to equalize coverage in discrete cells
distgrc Calculates coordinates of points at a certain distance on a great circle
eqplot Plots an equal-area grid as calculated by AUTHALIC
fillauth Fills the cells of an equal-area grid from AUTHALIC with prescribed colors
fridplot Plots a regular grid
grcazim Calculates points lying on a great circle of specified azimuth
grcircle Calculates great circle points through a pair of points
grcdist Calculates uncorrected great-circle distance
gridcheck Check if grid dimensions are up to containing all event/station pairs
gridlod2 Loads the three-dimensionsal grid defined by GRIDINFO and INAMAK3D
gridsec Performs surface-wave ray tracing and calculates sensitivity matrix elements - with demo
lcsg Loads all matrices with information written by and for SURFTRACE
lcsd Loads some matrices with information written by SURFTRACE
neqplot Plots a clustered grid as calculated by CLUTSER
surfaz Calculates azimuthal coverage from the matrices written by SURFTRACE
surfdens Calculates ray path density from the matrices written by SURFTRACE
surftrace Uses GRIDSEC to calculate and write the matrices for inversion (this is the main routine)
truecourse Calculates the true course at the first point between great-circle points

Auxiliary functions, for graphics, indexing, etc.

adrc Adds a row and a column to a matrix suitable for plotting
bindens Density plot for data where histograms are made for the y-data only
binsearch Performs a binary search through a presorted array
boxtex Makes rectangular boxes filled with text
circ Plots circles and circle segments
cor2ind Switches between physical coordinates and matrix indices
dat2col Converts data values to indices in one of multiple color maps
decibel Converts a range of values to decibel
defval Supplies default value to a named variable
degamini Undoes gamini which replicates elements of a vector
deggies Put degree signs on a graph
demmap Applies colormap suitable to plot Earth's topography
difer Evaluates the difference between two quantities
errorfill Plots error bars as shaded regions
errorxy Plots symmetric error bars on data in the the x and y direction
errorxy2 Plots asymmetric error bars on data in the the x and y direction
ext2lrtb Transforms 'extent' to 'left-right-top-bottom' coordinates for use with FILLBOX
fftaxis Makes a frequency axis for Fourier transformed data
fftaxis1D Makes a frequency axis for Fourier transformed time series
figdisp Suggests print command for figures
fig2print Makes the figure window wysiwyg
fillbox Makes rectangular boxes filled with color
flipflop Flips and duplicates a matrix suitable for spectral analysis
fralmanac An almanac with Earth and planetary data
fsize Determines a file size
gamini Replicates elements of a vector
gamini2 Replicates elements of a matrix
gauss Makes a 1-D gaussian
gauss2 Makes a 2-D gaussian
getcol Converts a color symbol into RGB values
getkids Gets axis children
getpos Gets axis handle positions
grey Defines a scaled grey color
imagef Plots a map using pixel-centered coordinates
imagefnan Plots a map with NaN's using pixel-centered coordinates
indeks Returns the ith entry of a matrix
ind2cor Switches between matrix indices and physical coordinates
insert Insert elements at certain positions into a vector
isav Returns azimuthally isotropic average of a two-dimensional array
kelicol Uses the color scheme designed by Hrafnkell Kárason
krijetem Creates figure panels and handles
kindeks Returns the ith column of a matrix
latitude Yields coordinates for a line of latitude
label Puts smart labels on figure panels
laxis Positions an axis on top of another one for easy annotation
lcs2spr Converts the format written by SURFTRACE to a conventionally sparse matrix
ldetrend Removes best-fitting linear trend from data
letter Returns letters from the alphabet
linazim Plots directional data on a map
longitude Yields coordinates for a meridian
loadb Loads binary data
longitude Yields coordinates for a meridian
lrtb2ext Transforms 'left-right-top-bottom' to 'extent' coordinates for use with FILLBOX
ls2cell Collects directory contents in a cell array
longticks Produces outward facing tickmarks
matranges A supremely useful function to make index vectors
minmax Finds the minimum and maximum value of a matrix
mollweide Projects data into a Mollweide projection
movev Moves a figure object vertically
moveh Moves a figure object horizontally
moving Computes moving average of a signal
nolabels Dispenses with axis labels
noticks Dispenses with axis ticks
nounder Gets rid of a filename underscore
number Adds numbers to the entries in a vector
openup Makes the axis slightly more than "tight"
osdep Changes flag according to the operating system
parse Performs some simple string parsing
pauli Returns a Pauli-type matrix useful in the generation of Toeplitz matrices
plotcont Plots continental outlines from a database
plotplates Plots plate boundaries from a database
plotprop Plots geographically distributed properties as color-scaled dots
pref Gets a filename prefix
recindex Returns the mapping of one array into another
revolve Transforms a radial profile into a cylindrically symmetric data set
rindeks Returns the ith row of a matrix
rotdom Rotates a data domain over a specified angle
rots Rotates the Slepian polar-cap basis around the z-axis
rottick Rotates tick mark labels on a graph
rotx Rotates vector in three dimensions around the x-axis
roty Rotates vector in three dimensions around the y-axis
rotz Rotates vector in three dimensions around the z-axis
row2stats Find statistics of data presented belonging to different groups
scale Scales data values to fall within some range
seemax Equalizes axis ranges on plots
serre Brings subplot panels closer together
shrink Reduces width and height of a figure object
shuffle Shuffles the rows or entries in a matrix or vector
skip Reduces a vector by skipping certain positins
spr2lcs Converts a conventionally sparse matrix to the format written by SURFTRACE
star69 Returns calling function name it it exists
subnum Returns a figure panel subnumber
suf Gets a filename suffix
supertit Finds space for a title spanning several panels
top Moves a graphics handle to the top of the stack
tridiag Constructs a tridiagonal matrix
unproject Unprojects a simple coordinate transformation on a map
writeb Writes binary data
xtraxis Adds a second axis to a plot
xtraxis1d Adds a logarithmic wavelength axis to a wavenumber plot
xtraxis1dlin Adds a linear wavelength axis to a wavenumber plot

Data sets, coefficients, colormaps, etc

conm.mat Continental data for use in PLOTCONT
cont.mtl Continental data for use in PLOTCONT
cost.mtl Continental data for use in PLOTCONT
Daubechies.mat Daubechies' wavelet coefficients for use in WC
CDF.mat Cohen, Daubechies, Feauveau wavelet coefficients for use in WC
CDFI.mat Cohen, Daubechies, Feauveau integer wavelet coefficients for use in WC
gji2002lonlat Simons et al. (GJI, 2002) data set for use in the GRIDSEC demo
generic.m An example program with information pertaining to the depth grid for GRIDLOD2
gridinfo An example file with information pertaining to a surface grid for GRIDLOD2
inamak3d An example file with information pertaining to a depth grid for GRIDLOD2
kelim.mat A color scheme designed by Hrafnkell Kárason for use in KELICOL
plates.mtl Plate boundary data for use in PLOTPLATES
platm.mat Plate boundary data for use in PLOTPLATES
Earth.mat Earth data for use in FRALMANAC
Mars.mat Mars data for use in FRALMANAC
Moon.mat Moon data for use in FRALMANAC
SHM.mat Spherical harmonic data for use in FRALMANAC
XYZ.mat Spatial data for use in FRALMANAC
topo.mat A color scheme good to plot Earth's topography for use in DEMMAP


Frederik Simons home
Last modified: Thu May 8 11:55:54 EDT 2008
Valid HTML 4.0 Transitional