sh2xyz : Forward calculation of topographic or gravitational data using spherical harmonic coefficients.
Installation
You need to compile the executable file sh2xyz using the makefile. Please change the variable CC in the makefile to the compiler you use. Parallel computing is enable using the -fopenmp flag, delete it if you don’t want the parallel computing.
CC = g++-8 -fopenmp
If you don’t have gcc installed.
- For Mac OS users, install
gccusing Homebrew by
brew install gcc
- For Linux users, install
gccby
apt-get install gcc
After the gcc is installed. Use make the compile the program. Then move or symlink the executable file sh2xyz to any directory included in your $PATH, for instance, /usr/local/bin.
Usage
sph2xyz -t<table> -r<lonmin>/<lonmax>/<latmin>/<latmax>[/<altitude>] -i<dlon>/<dlat> -d<type> -f<ln>/<lm>/<hn>/<hm> [-p<loc-file>] [-s<refr>/<refR>] [-g<GM>/<R>] [-n<type>] [-c<col1>,<col2>,<col3>,<col4>] [-z<alti-file>[+d<col1>,<col2>,<col3>]] [-h] > out-file
Options
- -t: Input filename of the coefficients.
- -r: Initialize the range of observation points. Altitude of the points is optional (will be 0 if no set).
- -i: Intervals of the observation points.
- -d: Types of forward calculation.
- -f: Starting and ending order/degree that will be used for calculation.
- -p: Interpolate the forward calculated data to spherical locations read from the file.
- -s: short and long semi-radius of the reference coordinate system.
- -g: Model parameters of gravity models. This option must be set if we are calculating gravitational data.
- -n: Normalization type of the Associated Legendre Function.
- -c: Select input columns of the coefficients.
- -z: Initialize the observation’s altitudes from the a input file.
- -h: Show help information.
Examples
To forward calculating an example.SHcoeffs which maximal degree/order are both 360.
sh2xyz -t example.SHcoeffs -r -180/180/-90/90/0 -i 0.5/0.5 -f 0/0/360/360 -s 10000/10000 > example.txt
The calculated data is shown as below:
