Andrea Gatti

Harmonic Manipulator HD 1.0

  • Speed improvements
  • Computation of J2n coefficients from ellipsoid parameters
  • Adding functionality: Removing the ellipsoidal component from a model is now taking into account the different standard definition of GM and rTer. New flags have been added (--eGOCE --sGOCE --eWGS84 ...), "--eXXXX" indicates the standard to be used to remove the reference ellipsoid "--sXXXX" indicates the standard for the synthesis, for more information type manipulator --help.

  • Adding four built-in ellipsoid, they can be used with the flags:
    —-eGOCE: GOCE standard ellispoid
    —-eSPW: SPW standard ellispoid
    —-eWGS84: WGS84 ellipsoid
    —-eGRS80: GRS80 ellipsoid
    —-eINI: load the ellipsoid parameters from INI file

  • Adding four built-in standards, they can be used with the flags:
    —-sGOCE: GOCE standard gm and rTer
    —-sSPW: SPW standard gm and rTer
    —-sWGS84: WGS84 gm and rTer
    —-sGRS80: GRS80 gm and rTer
    —-sINI: load the gm and rTer parameters from INI file

  • Execution time estimation for grids is now more precise

WARNING: ini file structure has been changed - new, see the attached new config file
now we have:
parameter = value
instead of
[ parameter ]
another valid syntax is:
parameter =

  • The SVN repo contains the latest updates AND a linux binary (compiled on a Fedora machine with gcc).

  • Fixed: File in gfz format were read incorrectly when the exponential symbol was “D”.

News from the version

LATEST NEWS 18 May 2013:
+ Minor fix: When selecting Dg computation the output variable name was Te instead of Dg. The bug didn't affect the result of computation

This software computes synthesis of spherical harmonics models on sparse
coordinates or grids provided in geodetic or spherical (geocentric) coordinates.

The SW is able to provide these outputs:

  • T - Anomalous potential
  • N - Geoid undulation
  • Dg - Gravity anomaly
  • First derivatives (lambda, theta, radial)
  • First derivatives (east, north, radial)
  • Second Derivatives (All the combinations)
  • Third radial derivate of T
Order Type Computed outputs
0 0 T
0 2 N = T/ɣ = T/gamma
1 0 Tl, Tt, Tr
1 1 Te, Tn, Tr
1 2 Dg
2 0 Tll, Tlt, Tlr, Ttt, Ttr, Trr
2 1 Tee, Ten, Ter, Tnn, Tnr, Trr
2 3 Trr
3 3 Trrr

Notice that the synthesis is applied to the given coefficients modifying the zonal J2, J4, J6, J8 to remove the normal field effect. To avoid any modification run the code with the parameter "-f" or set it in the parameter file.

News from the version

  • Minor fix: When selecting Dg computation the output variable name was Te instead of Dg. The bug didn't affect the result of computation

News from the version 0.9.6

  • adding the ability to read GOCE TIM R4 (gfz model), it is formatted differently

News from the version 0.9.5

  • adding intel redistributable libs to the Mac binary package
  • computation of Trrr added
  • convention fix: (change in the convetion used for the computation of Dg: now a - (minus) is added in front of the value previously obtained)

News from the version 0.9.4

  • a bug on the computation of geographic grids has been found and corrected
  • the output variables are now grids with the name of the functional computed (in .mat array) ; reshape is not needed anymore

News from the version 0.9.3

  • New faster algorithm that works on grids (old one still available with --legacy option - it was a little bit more precise at the poles)

Various minor bug fixes
Different order to return the derivatives, now it reflects the ENU notation

News from the version

  • Improved visualization (and minor bug fixes)

Bug fix: j2l coefficients where added without normalization (2*l+1) (bug present since v0.9.2)

News from the version 0.9.2

  • Added support to compute Trr alone
  • Added support to remove the normal field to full coefficients models (j2, j4, j6, j8)

Bug fix: Geographic second order derivatives were swapped with the geocentric ones and vice-versa (bug present since v0.0)

News from the version 0.9.1

Bug Fix: wrong read of the r/h variable when stored in a Matlab file. (bug present since v0.9)

News from the version 0.9

  • Added support to read GFZ model files
  • Added support to read coordinates from plain text files
  • Added support to write results to plain text files
  • Added support to compile without MATLAB support (to compile without matlab support add -DNO_MAT to your compilation flags)
  • Added a combo binary without MATLAB support/requirements


  • 64 bit system (support for quadruple precision float),
  • redistributable Mathworks Matlab libraries (to read and write .mat files) - not necessary for the no_Mat version
  • redistributable libiomp5md (dll or dylib) for openmp parallel support (intel omp)
  • terminal/console with ANSI support

all the necessary external libraries / programs to satisfy those prerequisites for a Windows system are contained in the additional resources zip file.

Development system

The software has been compiled with Intel Composer 12 and tested on Mac OS X 10.7.x (up to degree and order 2190)

Installation instructions for Windows systems

  1. download the combo installer for Windows
  2. uncompress it
  3. download example data starting from here

Usage instructions for Windows systems

  1. open the command window (console)
  2. change the current directory to the one containing the binary
  3. run "ansi151\x64\ansicon.exe" to activate the ANSI support in the command window
  4. prepare the inputs file in MATLAB
  5. modify the parameters in the config file
  6. run manipulator.exe
  7. open the produced file in MATLAB and see the results.

Input and output files

The current version of the software only accepts .mat file as input,
and it creates .mat output.


Coefficients of a model must be stored in two variables called: cnm and snm they must be full matrixes.

e.g. EGM2008 up to 2190 it is composed by two matrixes each of the size of 2190x2190

Optionally it is possible to load GFZ format models - change the parameter [UseGFZ] in the .ini file


The matlab file containing the coordinates must have 3 variables:

  • theta, lambda, r in case of geocentric coordinates
  • theta, lambda, h in case of geodetic coordinates

theta and lambda must be expressed in radians

Optionally it is possible to load the coordinates from plain text files
Those file must contain 3 columns (theta, lambda, r/h)
The first row of the text file must contain the dimension of the three
In case of Grids saved in a plain text file, columns without different size must be padded with zeros.

Example: 2 by 3 grid
Input file (discard row numbers):
line 1: 2 3 2
line 2: 0.11000e1 0.01000e1 2.50e5
line 3: 0.12000e1 0.02000e1 2.50e5
line 4: 0.0 0.03000e1 0.0

SPARSE DATA ------------------------------------------------

The software compute the output for each point (theta(i), lambda(i), r(i)/h(i))

GRIDS -------------------------------------------------------------

If grid mode is selected, the arrays must have this size:

  • theta [#divTheta x 1]
  • lambda [#divLambda x 1]
  • r/h [#divTheta x 1]

and the final output will be a matrix (or more) with this size [#divTheta x #divLambda]


Under Mac OS X, if you receive a message like:

dyld: Library not loaded: @rpath/libmat.dylib
Referenced from: /Users/Andrea/bin/manipulator
Reason: image not found
Trace/BPT trap: 5

you have to type:
export DYLD_LIBRARY_PATH=/Applications/MATLAB.app/bin/maci64:${DYLD_LIBRARY_PATH}
(adjust your MATLAB path accordingly to your system)

and now you can launch ./manipulator


For any question, comment or request contact me at
andrea.gatti @ polimi.it