gctl_toolkits/archive/sh2xyz/README.md

72 lines
2.4 KiB
Markdown
Raw Normal View History

2024-09-10 20:25:18 +08:00
## Forward calculation of topographic or gravitational data using spherical harmonic coefficients
### Introduction
### Files and folders
1. **CMakeLists.txt** CMake project file;
2. **\*.h and \*.cpp** Source files;
3. **README.md** This file;
4. **example** Example files.
#### Source file lists
```shell
main.cpp
NALF-SFCM.h
progressBar_imp.h
sh2xyz.h
sysDefine.h
```
### Installation
This program is a toolkit of a [software collection](https://gitee.com/yizhangss/toolkits) that is developed and maintained by Dr. Yi Zhang (zhangyiss@icloud.com) , which could be compiled and installed using the [CMake](https://cmake.org) software. Follow the three step instructions bellow, if you want to compile this program out of the collection.
1. Uncomment the first two lines in the `CMakeLists.txt` file,
```cmake
cmake_minimum_required(VERSION 3.15.2)
project(<project_name>)
```
1. Compile the program as
```shell
mkdir build && cd build && make
```
3. Move or symlink the executable file to any directory included in your $PATH, for instance, `/usr/local/bin`.
### Usage
```bash
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.
```bash
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:
![sh2xyz example](example/example.png)