initial upload

This commit is contained in:
张壹 2024-09-12 18:48:58 +08:00
parent ee4e8ecfe9
commit fe029b814e
31 changed files with 407351 additions and 36 deletions

36
.gitignore vendored
View File

@ -1,34 +1,2 @@
# ---> C++ .DS_Store
# Prerequisites build/
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app

3
CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.15.2)
project(DiffRTP VERSION 1.0)
add_subdirectory(src)

Binary file not shown.

View File

@ -0,0 +1,167 @@
function varrtp=rtpvariable(magc,incv);
% *****************************************************************
% *** RTP with variable geomagnetic parameters
% *** Uses a Taylor series expansion in the space domain
% *** GRJ Cooper July 2002
% ******************************************************************
% *** magc ; input data (even no of datapoints in each dir)
% *** incv ; dataset of field inc over dataset - must be exactly
% *** the same size as magc. If omitted then inc is specified only
% *** at the dataset corners, and interpolated from there
% ******************************************************************
% *** Type rtpvariable with no input parameters for demo application
% ******************************************************************
dtr=pi/180; azimuth=0;
% interpolate inc variation over dataset using linear polynomial
if nargin==0
disp('Loading demo data');
load rtpdemodata;
end;
[nr,nc]=size(magc);
if nargin<2 % Specify inc variation only at corners
disp('Generating grid of inclination data from values at grid corners');
a=zeros(4,3); yval=zeros(4,1);
a(1,1)=1; a(1,2)=nr; a(1,3)=1; yval(1,1)=-30;
a(2,1)=1; a(2,2)=nr; a(2,3)=nc; yval(2,1)=-30;
a(3,1)=1; a(3,2)=1; a(3,3)=1; yval(3,1)=-90;
a(4,1)=1; a(4,2)=1; a(4,3)=nc; yval(4,1)=-90;
p=pinv(a)*yval;
[xi,yi]=meshgrid(1:nc,1:nr);
incv=p(1)+p(2)*yi+p(3)*xi;
end;
incv=incv*dtr; inc=incv(nr/2,nc/2); % inclination at centre of grid
nmax=max([nr nc]); npts=(2^nextpow2(nmax));
cdiff=floor((npts-nc)/2); rdiff=floor((npts-nr)/2);
disp('Computing rtp');
rtpdata=rtp(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc);
incv=incv-inc;
disp('Computing dx1');
drtp1=taylortp1(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc);
disp('Computing dx2');
drtp2=taylortp1(drtp1,npts,nr,nc,rdiff,cdiff,azimuth,inc);
disp('Computing dx3');
drtp3=taylortp1(drtp2,npts,nr,nc,rdiff,cdiff,azimuth,inc);
disp('Computing rtpvar');
varrtp=rtpdata+drtp1.*incv+0.5*drtp2.*incv.^2+0.1666666*drtp3.*incv.^3; % 3 terms - modify as required
figure(1);
subplot(1,2,1); imagesc(magc); axis equal; axis tight; axis xy; title('Data'); axis off;
hold on; contour(magc,6,'k'); hold off;
subplot(1,2,2); imagesc((incv+inc)/dtr); axis equal; axis tight; axis xy; title('Inclination Variation');
axis off; colorbar;
currfig=get(0,'CurrentFigure'); set(currfig,'numbertitle','off');
set(currfig,'name','RTP Datasets');
figure(2);
subplot(1,3,1); imagesc(drtp1); axis equal; axis tight; axis xy; title('1st Derivative'); axis off;
subplot(1,3,2); imagesc(drtp2); axis equal; axis tight; axis xy; title('2nd Derivative'); axis off;
subplot(1,3,3); imagesc(drtp3); axis equal; axis tight; axis xy; title('3rd Derivative'); axis off;
currfig=get(0,'CurrentFigure'); set(currfig,'numbertitle','off');
set(currfig,'name','RTP Derivatives');
figure(3);
subplot(1,2,1); imagesc(rtpdata); axis equal; axis tight; axis xy; title('After Standard RTP'); axis off;
hold on; contour(rtpdata,6,'k'); hold off;
subplot(1,2,2); imagesc(varrtp); axis equal; axis tight; axis xy; title('c) After Differential RTP'); axis off;
hold on; contour(varrtp,6,'k'); hold off;
colormap('jet');
currfig=get(0,'CurrentFigure'); set(currfig,'numbertitle','off');
set(currfig,'name','RTP with Variable Inclination Over Survey Area');
%**************************************************************************
function drtp=taylortp1(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc); % Rtp derivatives
dtheta=0.01; dtr=pi/180;
rtpdata1=rtp(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc);
rtpdata2=rtp(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc+dtheta);
drtp=(rtpdata2-rtpdata1)/dtheta;
% *************************************************************************
function rtpdata=rtp(magc,npts,nr,nc,rdiff,cdiff,azimuth,inc);
gf=taper2d(magc,npts,nc,nr,cdiff,rdiff);
f=fft2(gf,npts,npts);
fx=f;
% Direction cosines
L=cos(azimuth)*cos(inc);
M=sin(azimuth)*cos(inc);
N=sin(inc);
wn=2.0*pi/(npts-1);
for I=1:npts/2
for J=1:npts/2
U=I*wn; V=J*wn;
temp=U*U+V*V;
temp1=L*U+M*V;
temp2=N*N*temp-temp1*temp1;
base=temp2*temp2+4.0*N*N*temp1*temp1*temp;
Rpart=temp*temp2/base;
Ipart=-2.0*N*temp1*(temp^1.5)/base;
temp3=real(f(I,J));
temp4=imag(f(I,J));
fx(I,J)=real(Rpart*temp3-temp4*Ipart)+i*real(Rpart*temp4+Ipart*temp3);
temp1=-L*U+M*V;
temp2=N*N*temp-temp1*temp1;
base=temp2*temp2+4.0*N*N*temp1*temp1*temp;
Rpart=temp*temp2/base;
Ipart=-2.0*N*temp1*(temp^1.5)/base;
temp3=real(f(npts-I+1,J));
temp4=imag(f(npts-I+1,J));
fx(npts-I+1,J)=real(Rpart*temp3-temp4*Ipart)+i*real(Rpart*temp4+Ipart*temp3);
temp1=L*U-M*V;
temp2=N*N*temp-temp1*temp1;
base=temp2*temp2+4.0*N*N*temp1*temp1*temp;
Rpart=temp*temp2/base;
Ipart=-2.0*N*temp1*(temp^1.5)/base;
temp3=real(f(I,npts-J+1));
temp4=imag(f(I,npts-J+1));
fx(I,npts-J+1)=real(Rpart*temp3-temp4*Ipart)+i*real(Rpart*temp4+Ipart*temp3);
temp1=-L*U-M*V;
temp2=N*N*temp-temp1*temp1;
base=temp2*temp2+4.0*N*N*temp1*temp1*temp;
Rpart=temp*temp2/base;
Ipart=-2.0*N*temp1*(temp^1.5)/base;
temp3=real(f(npts-I+1,npts-J+1));
temp4=imag(f(npts-I+1,npts-J+1));
fx(npts-I+1,npts-J+1)=real(Rpart*temp3-temp4*Ipart)+i*real(Rpart*temp4+Ipart*temp3);
end;
end;
fxinv=ifft2(fx); rtpdata=real(fxinv(1+rdiff:nr+rdiff,1+cdiff:nc+cdiff));
%**************************************************************************
function gf=taper2d(g,npts,nc,nr,cdiff,rdiff);
gf=zeros(npts); gf(rdiff+1:rdiff+nr,cdiff+1:cdiff+nc)=g;
for J=cdiff+1:cdiff+nc
for I=1:rdiff
gf(I,J)=gf(2*rdiff-I+1,J)*((1+sin(-pi/2+(I-1)*pi/rdiff))*0.5);
gf(npts-I+1,J)=gf(npts-2*rdiff+I,J)*((1+sin(-pi/2+(I-1)*pi/rdiff))*0.5);
end;
end;
for I=rdiff+1:rdiff+nr
for J=1:cdiff
gf(I,J)=gf(I,2*cdiff-J+1)*((1+sin(-pi/2+(J-1)*pi/(cdiff)))*0.5);
gf(I,npts-J)=gf(I,npts-2*cdiff+J)*((1+sin(-pi/2+(J-1)*pi/(cdiff)))*0.5);
end;
end;
for J=1:cdiff
for I=1:rdiff
gf(I,J)=gf(rdiff+1,J)*((1+sin(-pi/2+(I-1)*pi/(rdiff)))*0.5);
gf(npts-I,J)=gf(npts-rdiff,J)*((1+sin(-pi/2+(I-1)*pi/(rdiff)))*0.5);
end;
end;
for J=cdiff+nc:npts
for I=1:rdiff
gf(I,J)=gf(rdiff+1,J)*((1+sin(-pi/2+(I-1)*pi/(rdiff)))*0.5);
gf(npts-I,J)=gf(npts-rdiff,J)*((1+sin(-pi/2+(I-1)*pi/(rdiff)))*0.5);
end;
end;

194
README.html Normal file
View File

@ -0,0 +1,194 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x53d8;&#x78c1;&#x5316;&#x53c2;&#x6570;&#x5316;&#x6781;&#xff08;DRTP&#xff09;</title>
<style>
/* From extension vscode.github */
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.vscode-dark img[src$=\#gh-light-mode-only],
.vscode-light img[src$=\#gh-dark-mode-only],
.vscode-high-contrast:not(.vscode-high-contrast-light) img[src$=\#gh-light-mode-only],
.vscode-high-contrast-light img[src$=\#gh-dark-mode-only] {
display: none;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
font-size: 14px;
line-height: 1.6;
}
</style>
<style>
.task-list-item {
list-style-type: none;
}
.task-list-item-checkbox {
margin-left: -20px;
vertical-align: middle;
pointer-events: none;
}
</style>
<style>
:root {
--color-note: #0969da;
--color-tip: #1a7f37;
--color-warning: #9a6700;
--color-severe: #bc4c00;
--color-caution: #d1242f;
--color-important: #8250df;
}
</style>
<style>
@media (prefers-color-scheme: dark) {
:root {
--color-note: #2f81f7;
--color-tip: #3fb950;
--color-warning: #d29922;
--color-severe: #db6d28;
--color-caution: #f85149;
--color-important: #a371f7;
}
}
</style>
<style>
.markdown-alert {
padding: 0.5rem 1rem;
margin-bottom: 16px;
color: inherit;
border-left: .25em solid #888;
}
.markdown-alert>:first-child {
margin-top: 0
}
.markdown-alert>:last-child {
margin-bottom: 0
}
.markdown-alert .markdown-alert-title {
display: flex;
font-weight: 500;
align-items: center;
line-height: 1
}
.markdown-alert .markdown-alert-title .octicon {
margin-right: 0.5rem;
display: inline-block;
overflow: visible !important;
vertical-align: text-bottom;
fill: currentColor;
}
.markdown-alert.markdown-alert-note {
border-left-color: var(--color-note);
}
.markdown-alert.markdown-alert-note .markdown-alert-title {
color: var(--color-note);
}
.markdown-alert.markdown-alert-important {
border-left-color: var(--color-important);
}
.markdown-alert.markdown-alert-important .markdown-alert-title {
color: var(--color-important);
}
.markdown-alert.markdown-alert-warning {
border-left-color: var(--color-warning);
}
.markdown-alert.markdown-alert-warning .markdown-alert-title {
color: var(--color-warning);
}
.markdown-alert.markdown-alert-tip {
border-left-color: var(--color-tip);
}
.markdown-alert.markdown-alert-tip .markdown-alert-title {
color: var(--color-tip);
}
.markdown-alert.markdown-alert-caution {
border-left-color: var(--color-caution);
}
.markdown-alert.markdown-alert-caution .markdown-alert-title {
color: var(--color-caution);
}
</style>
</head>
<body class="vscode-body vscode-light">
<h3 id="变磁化参数化极drtp">变磁化参数化极DRTP</h3>
<h4 id="简介">简介</h4>
<p>drtp程序可计算变磁化参数磁偏角与磁倾角的化极磁异常适用于大陆磁异常数据的化极处理。程序可计算或读入标准IGRF程序生成的主磁场参数并计算相应的化极磁异常。程序适用于网格化的总场磁异常数据的处理网格文件的格式为netCDF格式。</p>
<h4 id="程序用法">程序用法</h4>
<p>如下所示drtp程序可通过命令行调用参数为配置文件的名称包含路径</p>
<pre><code class="language-cxx">./drtp &lt;config-file&gt;
</code></pre>
<p>配置文件为普通文本文件,注释行以<code>#</code>号开始。文件中每一行包含一条选项配置,格式为:</p>
<pre><code class="language-shell">&lt;key&gt; = &lt;value&gt;
</code></pre>
<h5 id="选项列表">选项列表</h5>
<p>如下为程序可识别的选项键值与相应的选项格式:</p>
<pre><code class="language-shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">Directory to the netcdf file of the deltaT anomalies</span>
input-grid = &lt;file&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Directory to the output netcdf file</span>
output-grid = &lt;file&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Names of data attribute of the netcdf file. The default is x,y,z.</span>
grid-para = &lt;x-axis&gt;,&lt;y-axis&gt;,&lt;data&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Directory to the executable of the geomag.exe program</span>
geomag-exe = &lt;exe&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Parameters needed by the geomag.exe program</span>
geomag-para = &lt;para&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Directory to the output file of the geomag.exe program</span>
geomag-output = &lt;file&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Directory to the IGRF model file</span>
IGRF = &lt;file&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Call the geomag.exe program to calculate the geomagnetic parameters</span>
call-geomag = yes|no
<span class="hljs-meta prompt_"># </span><span class="language-bash">Use a <span class="hljs-built_in">set</span> of mean geomagnetic parameters defined by the user. Use this option to run a non-differential RTP process.</span>
mean-geomag = &lt;inc&gt;/&lt;dec&gt;
<span class="hljs-meta prompt_"># </span><span class="language-bash">Differential orders of the taylor series. Must be between 1 and 5. The default order is 2.</span>
taylor-order = &lt;order&gt;
</code></pre>
<p>不同计算流程所需的选项如下:</p>
<ol>
<li>非变参数化极(普通化极)</li>
</ol>
<pre><code class="language-shell">input-grid mean-geomag output-grid(optional) grid-para(optional)
</code></pre>
<ol start="2">
<li>变参数化极无IGRF参数文件</li>
</ol>
<pre><code class="language-shell">input-grid output-grid(optional) geomag-exe geomag-para geomag-output IGRF call-geomag(yes) taylor-order(optional) grid-para(optional)
</code></pre>
<ol start="3">
<li>变参数化极有IGRF参数文件</li>
</ol>
<pre><code class="language-shell">input-grid output-grid(optional) geomag-output call-geomag(no) taylor-order(optional) grid-para(optional)
</code></pre>
</body>
</html>

View File

@ -1,2 +1,49 @@
# DRTP ### 变磁化参数化极DRTP
#### 简介
drtp程序可计算变磁化参数磁偏角与磁倾角的化极磁异常适用于大陆磁异常数据的化极处理。程序可计算或读入标准IGRF程序生成的主磁场参数并计算相应的化极磁异常。程序适用于网格化的总场磁异常数据的处理网格文件的格式为netCDF格式。
#### 程序用法
如下所示drtp程序可通过命令行调用参数为配置文件的名称包含路径
```cxx
./drtp <config-file>
```
配置文件为普通文本文件,注释行以`#`号开始。文件中每一行包含一条选项配置,格式为:
```shell
<key> = <value>
```
##### 选项列表
如下为程序可识别的选项键值与相应的选项格式:
```shell
# Directory to the netcdf file of the deltaT anomalies
input-grid = <file>
# Directory to the output netcdf file
output-grid = <file>
# Names of data attribute of the netcdf file. The default is x,y,z.
grid-para = <x-axis>,<y-axis>,<data>
# Directory to the executable of the geomag.exe program
geomag-exe = <exe>
# Parameters needed by the geomag.exe program
geomag-para = <para>
# Directory to the output file of the geomag.exe program
geomag-output = <file>
# Directory to the IGRF model file
IGRF = <file>
# Call the geomag.exe program to calculate the geomagnetic parameters
call-geomag = yes|no
# Use a set of mean geomagnetic parameters defined by the user. Use this option to run a non-differential RTP process.
mean-geomag = <inc>/<dec>
# Differential orders of the taylor series. Must be between 1 and 5. The default order is 2.
taylor-order = <order>
```
不同计算流程所需的选项如下:
1. 非变参数化极(普通化极)
```shell
input-grid mean-geomag output-grid(optional) grid-para(optional)
```
2. 变参数化极无IGRF参数文件
```shell
input-grid output-grid(optional) geomag-exe geomag-para geomag-output IGRF call-geomag(yes) taylor-order(optional) grid-para(optional)
```
3. 变参数化极有IGRF参数文件
```shell
input-grid output-grid(optional) geomag-output call-geomag(no) taylor-order(optional) grid-para(optional)
```

9
config.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
if [[ ${1} == "configure" && ! -d "build/" ]]; then
mkdir build && cd build && rm -rf * && cmake ..
elif [[ ${1} == "configure" ]]; then
cd build && rm -rf * && cmake ..
elif [[ ${1} == "build" ]]; then
cd build && make
fi

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

1845
geomag70_linux/IGRF13.COF Normal file

File diff suppressed because it is too large Load Diff

95
geomag70_linux/README.txt Normal file
View File

@ -0,0 +1,95 @@
This zip file contains the C source code for the NGDC software "Geomag"
version 7.0 that computes the estimated main magnetic field values for
given locations and dates (or ranges of dates). Geomag requires a
magnetic field model file for input. One model is included in this
zip: IGRF13.COF. Note that the text file formats differ
slightly in format between Unix and Windows platforms. Two different
archives are therefore provided for Unix and Windows. The zip and tar
files also include compiled versions (executables) of Geomag for
Windows and Linux. This readme file contains instructions for both
the Windows and Linux versions.
Important notice on change of file format
-----------------------------------------
The file format of IGRF11.COF and forward had to be changed from the previous
versions (IGRF10.cof and IGRF10.unx) because the previous format did not
allow for the new 0.01 nT precision of the DGRF2005 coefficients. In this
file format revision, we also swapped the previously confusing m,n ordering
to the standard n,m where n is the degree and m is the order. The format
was further adjusted to have blanks between all fields, so that values no
longer run into each other. This makes the files easier to read using
unformatted read statments.
Background
----------
IGRF13 is the thirteenth generation standard main field model adopted
by the International Association of Geomagnetism and Aeronomy (IAGA).
This is a degree and order 10 model from 1900 to 1995 and a degree and
order 13 model from 2000 to 2025, providing estimates of the main field
for dates between January 1, 1900 and January 1, 2025. For more information
on the IGRF and IAGA, visit the IAGA Working Group V-MOD Web site at:
http://www.ngdc.noaa.gov/IAGA/vmod/
The computed magnetic elements are:
-----------------------------------
D: Declination
I: Inclination
H: Horizontal field strength
X: North component
Y: East component
Z: Down component
F: Total field strength
dD,dI,dH,dX,dY,dZ,dF: Change per year of the above quantities.
To compile this code:
------------------------------------
Gnu C compiler on Unix:
gcc geomag70.c -o geomag70.exe
Intel C on Unix:
icc geomag70.c -o geomag70.exe
The Windows .exe file was generated using
Code Gear C++ 2009 Builder
Command line option:
--------------------
Note that the geomag program can receive parameters on
the command line. For example:
geomag70.exe IGRF13.COF 2010.32 D M133.4 10.5 10.5
The command line syntax is listed by providing the h option as
geomag70.exe h
Spread-sheet option:
--------------------
Revision 6.1 introduced the option to read a file of
dates and locations and create a new file with a set of extra
columns giving the magnetic components. These can then be
read as columns into a spread sheet program. The dates and
coordinates have to be given in the same format as for the
command line option. See also the sample files discussed below.
For example:
geomag70.exe IGRF13.COF f in-coords.txt output.txt
will append the magnetic components and their secular
variation to the dates and locations given in 'in-coords.txt'
and write the result to a file 'output.txt'.
This distribution contains example files which were produced
on a Linux system using the commands:
geomag70.exe IGRF13.COF f sample_coords.txt sample_out_IGRF13.txt
To run the program with command line arguments under Windows:
-------------------------------------------------------------
1) Click on <Start> <Programs> <Accessories> <Command Prompt>
2) Change directory ('cd') to the folder containg geomag70.exe
3) Run the program, e.g. 'geomag70.exe IGRF13.COF f in.txt out.txt'
Contact:
--------
For further infos, or bug reports, please contact:
geomag.models@noaa.gov

BIN
geomag70_linux/geomag70 Executable file

Binary file not shown.

2485
geomag70_linux/geomag70.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
2019.5 D K100 70.3 30.8
2018,10,7 D K100 70.3 30.8
2017.5 C K6470 70.3 30.8
2016.5 D M1042 70.3 30.8
2015.5 D F30000 70.3 30.8
2018.7 D F30000 -70.3 -30.8
2018.7 D F30000 -70,18,0 -30,48,0
2018.7 D F30000 43,22,1 -30,8,
2018,4,7 D F30000 43,22,1 -54,36,9
2018,2,2 D K1.3 48.123 16.123
2019,11,19 D K1.3 48.123 16.123
2019.8849 D K1.3 48.123 16.123
2018,4,7 D F0 43,22,1 -54,36,9
2015,1,1 D F30000 43,22,1 -54,36,9
2015,1,1 D F0 0.0 0.0
2020,1,1 D F0 0.0 0.0
2021.5 D K12 33.0 -145.0
2022.0 D K57 -43.0 50.0
2023.5 D K59 32.0 163.0
2024.5 D K26 -65.0 55.0

View File

@ -0,0 +1,21 @@
Date Coord-System Altitude Latitude Longitude D_deg D_min I_deg I_min H_nT X_nT Y_nT Z_nT F_nT dD_min dI_min dH_nT dX_nT dY_nT dZ_nT dF_nT
2019.5 D K100 70.3 30.8 15d 21m 79d 4m 9898.8 9546.0 2619.2 51280.9 52227.6 15.5 1.7 -16.4 -27.8 38.7 50.1 46.1
2018,10,7 D K100 70.3 30.8 15d 9m 79d 3m 9911.0 9566.4 2590.8 51244.2 52193.8 15.5 1.7 -16.6 -27.8 38.7 50.1 46.0
2017.5 C K6470 70.3 30.8 14d 57m 79d 11m 9737.3 9407.8 2511.7 50996.2 51917.5 15.7 1.7 -16.9 -27.9 38.5 49.6 45.5
2016.5 D M1042 70.3 30.8 15d 27m 79d 0m 10360.4 9985.8 2760.6 53306.0 54303.5 15.5 1.7 -17.1 -29.0 40.3 53.4 49.2
2015.5 D F30000 70.3 30.8 15d 7m 78d 58m 10343.2 9985.1 2698.4 53070.7 54069.2 15.4 1.7 -17.3 -28.9 40.1 53.2 48.9
2018.7 D F30000 -70.3 -30.8 0d -48m -60d 20m 18895.0 18893.1 -265.0 -33161.5 38166.8 -1.9 0.8 -26.6 -26.7 -9.9 65.2 -69.8
2018.7 D F30000 -70,18,0 -30,48,0 0d -48m -60d 20m 18895.0 18893.1 -265.0 -33161.5 38166.8 -1.9 0.8 -26.6 -26.7 -9.9 65.2 -69.8
2018.7 D F30000 43,22,1 -30,8, -10d 20m 59d 11m 23557.7 23175.4 -4226.9 39491.8 45984.4 11.1 -3.8 39.3 52.2 68.0 -34.1 -9.1
2018,4,7 D F30000 43,22,1 -54,36,9 -17d 3m 63d 46m 21707.6 20753.6 -6364.8 44063.0 49119.9 9.9 -5.8 48.5 64.6 45.6 -90.2 -59.4
2018,2,2 D K1.3 48.123 16.123 4d 16m 64d 31m 20952.1 20894.0 1559.0 43943.7 48683.0 8.8 1.2 5.7 1.6 53.7 52.5 49.9
2019,11,19 D K1.3 48.123 16.123 4d 32m 64d 33m 20962.4 20896.9 1655.4 44037.9 48772.5 8.8 1.2 5.9 1.6 53.7 52.5 50.0
2019.8849 D K1.3 48.123 16.123 4d 32m 64d 33m 20962.4 20896.9 1655.4 44037.9 48772.5 8.8 1.2 5.9 1.6 53.7 52.5 50.0
2018,4,7 D F0 43,22,1 -54,36,9 -17d 4m 63d 46m 21808.2 20847.1 -6402.9 44255.4 49337.0 9.9 -5.8 48.7 64.9 45.9 -90.6 -59.7
2015,1,1 D F30000 43,22,1 -54,36,9 -17d 36m 64d 5m 21550.8 20542.9 -6513.5 44357.4 49315.4 10.0 -5.8 47.9 64.6 45.6 -90.2 -60.2
2015,1,1 D F0 0.0 0.0 -5d 26m -29d 43m 27672.5 27548.0 -2622.4 -15793.3 31862.2 9.4 -4.6 -8.7 -1.6 76.1 -43.8 14.2
2020,1,1 D F0 0.0 0.0 -4d 39m -30d 6m 27631.1 27540.0 -2241.9 -16012.5 31935.5 10.1 -3.0 -14.4 -7.9 81.8 -23.7 -0.5
2021.5 D K12 33.0 -145.0 12d 21m 52d 29m 24891.2 24315.0 5324.8 32425.7 40877.8 -2.9 1.5 -54.4 -48.7 -32.2 -41.8 -66.3
2022.0 D K57 -43.0 50.0 -47d 24m -62d 57m 16770.7 11352.8 -12343.8 -32855.1 36887.8 -8.4 -1.3 23.0 -14.8 -44.7 -76.6 78.7
2023.5 D K59 32.0 163.0 0d 20m 43d 4m 28172.8 28172.4 163.8 26326.0 38558.7 -2.1 -1.7 27.7 27.8 -17.2 0.6 20.7
2024.5 D K26 -65.0 55.0 -62d 32m -65d 41m 18707.9 8630.1 -16598.5 -41409.3 45439.1 -10.1 -0.1 8.0 -45.0 -32.3 -21.1 22.5

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
geomag70_linux/tmp Executable file

Binary file not shown.

27
geomag70_linux/tmp.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "string"
#include "iostream"
#include "fstream"
#include "iomanip"
using namespace std;
int main(int argc, char const *argv[])
{
ifstream fin("stt1d_tri_cen.txt");
ofstream fout("stt1d_tri_cen_IGRF_in.txt");
double lon, lat;
for (size_t i = 0; i < 81920; i++)
{
fin >> lon >> lat;
if (lon < -180) lon = 180;
if (lon > 180) lon = 180;
if (lat < -90) lat = -90;
if (lat > 90) lat = 90;
fout << "2019,8,22 D K250 " << setprecision(12) << lat << " " << lon << "\n";
}
fin.close();
fout.close();
return 0;
}

33
routine.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
exe=./build/bin/drtp
if [[ ${1} == "benchmark" ]]; then
cat <<- EOF > job.log
# 输入网格文件
input-grid = data/benchmark/benchmark_DeltaT
#grid-para = x,y,z
# 地磁场平均参数
mean-geomag = 50/3
EOF
${exe} job.log && ncview data/benchmark/benchmark_DeltaT_RTP.nc
elif [[ ${1} == "emag" ]]; then
cat <<- EOF > job.log
# 输入网格文件
input-grid = data/EMAG2_V3_Cut/EMAG2_V3_Cut
#grid-para = x,y,z
# 是否调用geomag计算正常场的倾角与偏角
call-geomag = no
# geomag程序地址
geomag-exe = geomag70_linux/geomag70
# geomag参数
geomag-para = 2017,6,15 D M4000.00
# geomag输出文件
geomag-output = data/EMAG2_V3_Cut/geomag_EMAG2_V3_Cut.txt
# IGRF模型
IGRF = geomag70_linux/IGRF13.COF
# Taylor展开阶数
taylor-order = 3
EOF
${exe} job.log && ncview data/EMAG2_V3_Cut/EMAG2_V3_Cut_DRTP.nc
fi

12
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
find_package(GCTL REQUIRED)
message(STATUS "GCTL Version: " ${GCTL_VERSION})
if(${GCTL_VERSION} LESS 1.0)
message(FATAL_ERROR "GCTL's version must be v1.0 or bigger.")
endif()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -O2")
aux_source_directory(. SRC_DIR)
add_executable(drtp ${SRC_DIR})
target_link_libraries(drtp PUBLIC ${GCTL_LIBRARY})

362
src/drtp.cpp Normal file
View File

@ -0,0 +1,362 @@
#include "drtp.h"
void DRTP::ReadConfig(std::string filename)
{
gopt_.add_options({GRIDIN}, {true});
gopt_.add_options({GRIDOUT, GRIDPARA, USEMEAN, TAYLOR}, {false, false, false, false});
gopt_.add_options({CALLGEOMAG, GEOMAGEXE, GEOMAGPARA, GEOMAGOUT, IGRFMODEL}, {false, false, false, false, false});
gopt_.read_options(filename);
gopt_.show_options();
gopt_.check_mandatory();
return;
}
void DRTP::ReadGrid()
{
if (gopt_.has_value(GRIDPARA))
{
std::stringstream tmpss(gopt_.get_value(GRIDPARA));
gctl::parse_string_to_value(gopt_.get_value(GRIDPARA), ',', false, netcdf_lon_name_, netcdf_lat_name_, netcdf_data_name_);
}
ingrid_name_ = gopt_.get_value(GRIDIN);
gctl::read_netcdf_grid(ingrid_name_, in_lon_, in_lat_, grid_, netcdf_lon_name_, netcdf_lat_name_, netcdf_data_name_);
rtp_.resize(grid_.row_size(), grid_.col_size(), NAN);
rsize_ = in_lat_.size();
csize_ = in_lon_.size();
dlon_ = (in_lon_[in_lon_.size()-1] - in_lon_[0])/(in_lon_.size()-1);
dlat_ = (in_lat_[in_lat_.size()-1] - in_lat_[0])/(in_lat_.size()-1);
return;
}
void DRTP::ReadGEOMAG()
{
std::string geomag_output = gopt_.get_value(GEOMAGOUT);
std::ifstream infile;
gctl::open_infile(infile, geomag_output, "");
geomag_dec_.resize(rsize_, csize_, NAN);
geomag_inc_.resize(rsize_, csize_, NAN);
std::string err_str, tmp_str;
std::stringstream tmp_ss;
std::string date, cs_sys, alti_str, dd_str, dm_str, id_str, im_str;
double lat, lon, H, X, Y, Z, F, dD, dI, dH, dX, dY, dZ, dF;
int m, n, d_deg, d_min, i_deg, i_min;
while (getline(infile, tmp_str))
{
if (tmp_str[0] == 'D') // 如果第一行是头信息就跳过
continue;
//Date Coord-System Altitude Latitude Longitude D_deg D_min I_deg I_min H_nT X_nT Y_nT Z_nT F_nT dD_min dI_min dH_nT dX_nT dY_nT dZ_nT dF_nT
//2017,6,15 D M4000.00 30.0167 105.017 -2d 16m 46d 52m 34358.9 34332.2 -1354.1 36667.2 50249.6 -3.8 5.6 -13.2 -14.8 -37.9 105.0 67.6
tmp_ss.clear();
tmp_ss.str(tmp_str);
tmp_ss >> date >> cs_sys >> alti_str >> lat >> lon
>> dd_str >> dm_str >> id_str >> im_str
>> H >> X >> Y >> Z >> F >> dD >> dI >> dH
>> dX >> dY >> dZ >> dF;
if (1 != sscanf(dd_str.c_str(), "%dd", &d_deg) ||
1 != sscanf(dm_str.c_str(), "%dm", &d_min) ||
1 != sscanf(id_str.c_str(), "%dd", &i_deg) ||
1 != sscanf(im_str.c_str(), "%dm", &i_min))
{
throw gctl::invalid_argument("Wrong format: " + tmp_str);
}
m = round((lat - in_lat_[0])/dlat_);
n = round((lon - in_lon_[0])/dlon_);
geomag_inc_[m][n] = fabs(i_deg) + i_min/60.0;
geomag_dec_[m][n] = fabs(d_deg) + d_min/60.0;
if (i_deg < 0) geomag_inc_[m][n] *= -1;
if (d_deg < 0) geomag_dec_[m][n] *= -1;
}
infile.close();
mean_inc_ = mean_dec_ = 0.0;
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
if (std::isnan(geomag_dec_[i][j]) || std::isnan(geomag_inc_[i][j]))
{
throw gctl::runtime_error("Invalid geomagnetic declination or inclination found.");
}
mean_dec_ += geomag_dec_[i][j];
mean_inc_ += geomag_inc_[i][j];
}
}
mean_inc_ /= (geomag_dec_.row_size()*geomag_dec_.col_size());
mean_dec_ /= (geomag_inc_.row_size()*geomag_inc_.col_size());
return;
}
void DRTP::SaveGrid()
{
if (gopt_.has_value(GRIDOUT)) outgrid_name_ = gopt_.get_value(GRIDOUT);
else if (gopt_.has_value(USEMEAN)) outgrid_name_ = gopt_.get_value(GRIDIN) + "_RTP";
else outgrid_name_ = gopt_.get_value(GRIDIN) + "_DRTP";
gctl::save_netcdf_grid(outgrid_name_, rtp_, in_lon_, in_lat_, netcdf_lon_name_, netcdf_lat_name_, netcdf_data_name_);
return;
}
void DRTP::CalNormalField()
{
std::string geomag_exe = gopt_.get_value(GEOMAGEXE);
std::string geomag_para = gopt_.get_value(GEOMAGPARA);
std::string geomag_output = gopt_.get_value(GEOMAGOUT);
std::string IGRF = gopt_.get_value(IGRFMODEL);
// 生成临时文件
std::ofstream outfile;
gctl::open_outfile(outfile, "drtp_tmp", ".txt");
for (int i = 0; i < in_lat_.size(); i++)
{
for (int j = 0; j < in_lon_.size(); j++)
{
outfile << geomag_para << " " << in_lat_[i] << " " << in_lon_[j] << std::endl;
}
}
outfile.close();
std::string geomag_cmd = "./" + geomag_exe + " " + IGRF + " f drtp_tmp.txt " + geomag_output;
int ret = system(geomag_cmd.c_str());
ret = system("rm drtp_tmp.txt");
return;
}
void DRTP::RTP(double inc, double dec)
{
int ori_row = 0, ori_col = 0;
gctl::matrix<double> ingrid_ex;
gctl::cosine_extrapolate_2d(grid_, ingrid_ex, ori_row, ori_col);
gctl::save_netcdf_grid(gopt_.get_value(GRIDIN) + "_expanded", ingrid_ex, 0, 1, 0, 1);
int M = ingrid_ex.row_size();
int N = ingrid_ex.col_size();
fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*M*N);
fftw_complex *out= (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*M*N);
for (int i = 0; i < M; i++)
{
for (int j = 0; j < N; j++)
{
in[i*N+j][0] = ingrid_ex[i][j];
in[i*N+j][1] = 0.0;
}
}
fftw_plan p = fftw_plan_dft_2d(M, N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p);
int half_M = ceil(0.5*M);
int half_N = ceil(0.5*N);
double du = 2.0*GCTL_Pi/((M-1)*dlat_);
double dv = 2.0*GCTL_Pi/((N-1)*dlon_);
double cc = cosd(dec)*cosd(inc);
double sc = sind(dec)*cosd(inc);
double s = sind(inc);
int idx;
double U, V, Rpart, Ipart;
double temp, temp1, temp2, temp3, temp4, base;
for (int i = 0; i < half_M; i++)
{
for (int j = 0; j < half_N; j++)
{
U = (i+1)*du; V = (j+1)*dv;
temp = U*U+V*V;
idx = i*N+j;
temp1 = cc*U+sc*V;
temp2 = s*s*temp-temp1*temp1;
base = temp2*temp2+4.0*s*s*temp1*temp1*temp;
Rpart = temp*temp2/base;
Ipart = -2.0*s*temp1*pow(temp,1.5)/base;
temp3 = out[idx][0];
temp4 = out[idx][1];
in[idx][0] = Rpart*temp3-temp4*Ipart;
in[idx][1] = Rpart*temp4+Ipart*temp3;
idx = (M-1-i)*N+j;
temp1 = -cc*U+sc*V;
temp2 = s*s*temp-temp1*temp1;
base = temp2*temp2+4.0*s*s*temp1*temp1*temp;
Rpart = temp*temp2/base;
Ipart = -2.0*s*temp1*pow(temp,1.5)/base;
temp3 = out[idx][0];
temp4 = out[idx][1];
in[idx][0] = Rpart*temp3-temp4*Ipart;
in[idx][1] = Rpart*temp4+Ipart*temp3;
idx = i*N+N-1-j;
temp1 = cc*U-sc*V;
temp2 = s*s*temp-temp1*temp1;
base = temp2*temp2+4.0*s*s*temp1*temp1*temp;
Rpart = temp*temp2/base;
Ipart = -2.0*s*temp1*pow(temp,1.5)/base;
temp3 = out[idx][0];
temp4 = out[idx][1];
in[idx][0] = Rpart*temp3-temp4*Ipart;
in[idx][1] = Rpart*temp4+Ipart*temp3;
idx = (M-1-i)*N+N-1-j;
temp1 = -cc*U-sc*V;
temp2 = s*s*temp-temp1*temp1;
base = temp2*temp2+4.0*s*s*temp1*temp1*temp;
Rpart = temp*temp2/base;
Ipart = -2.0*s*temp1*pow(temp,1.5)/base;
temp3 = out[idx][0];
temp4 = out[idx][1];
in[idx][0] = Rpart*temp3-temp4*Ipart;
in[idx][1] = Rpart*temp4+Ipart*temp3;
}
}
p = fftw_plan_dft_2d(M, N, in, out, FFTW_BACKWARD, FFTW_ESTIMATE);
fftw_execute(p);
for (int i = 0; i < M; i++)
{
for (int j = 0; j < N; j++)
{
ingrid_ex[i][j] = out[i*N+j][0]/(M*N);
}
}
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
rtp_[i][j] = ingrid_ex[i+ori_row][j+ori_col];
}
}
fftw_destroy_plan(p);
fftw_free(in);
fftw_free(out);
return;
}
void DRTP::DiffRTP(int order)
{
// 使用微小扰动计算RTP相对与倾角与偏角的导数
double dinc = 0.01, ddec = 0.01;
// 拷贝平均化极磁异常到临时数组
gctl::matrix<double> drtp(rtp_), tmp(rtp_);
gctl::matrix<double> diffinc(rtp_.row_size(), rtp_.col_size());
gctl::matrix<double> diffdec(rtp_.row_size(), rtp_.col_size());
RTP(mean_inc_+dinc, mean_dec_);
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
diffinc[i][j] = (geomag_inc_[i][j] - mean_inc_)*(rtp_[i][j] - tmp[i][j])/dinc;
drtp[i][j] += diffinc[i][j];
}
}
RTP(mean_inc_, mean_dec_+ddec);
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
diffdec[i][j] = (geomag_dec_[i][j] - mean_dec_)*(rtp_[i][j] - tmp[i][j])/ddec;
drtp[i][j] += diffdec[i][j];
}
}
double factor;
for (int o = 2; o <= order; o++)
{
factor = 1.0;
for (int n = o; n > 1; n--)
{
factor *= n;
}
factor = 1.0/factor;
grid_ = diffinc;
RTP(mean_inc_, mean_dec_);
tmp = rtp_;
RTP(mean_inc_+dinc, mean_dec_);
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
diffinc[i][j] = factor*pow(geomag_inc_[i][j] - mean_inc_, o)*(rtp_[i][j] - tmp[i][j])/dinc;
drtp[i][j] += diffinc[i][j];
}
}
grid_ = diffdec;
RTP(mean_inc_, mean_dec_);
tmp = rtp_;
RTP(mean_inc_, mean_dec_+ddec);
for (int i = 0; i < rsize_; i++)
{
for (int j = 0; j < csize_; j++)
{
diffdec[i][j] = factor*pow(geomag_dec_[i][j] - mean_dec_, o)*(rtp_[i][j] - tmp[i][j])/ddec;
drtp[i][j] += diffdec[i][j];
}
}
}
rtp_ = drtp;
return;
}
void DRTP::Process()
{
std::string err_str;
// 读入网格文件
ReadGrid();
// 使用输入的平均参数
std::string geomag_str = gopt_.get_value(USEMEAN);
if (gopt_.has_value(USEMEAN))
{
double inc, dec;
gctl::parse_string_to_value(geomag_str, '/', false, inc, dec);
if (inc < -90 || inc > 90 || dec < -90 || dec > 90)
{
gctl::invalid_argument("Invalid geomagnetic parameters: " + geomag_str);
}
RTP(inc, dec);
}
else
{
// 计算正常场参数
if (gopt_.get_value(CALLGEOMAG) == "yes")
CalNormalField();
// 读入正常场参数
ReadGEOMAG();
// 读入差分阶数
if (gopt_.has_value(TAYLOR))
{
int order = atoi(gopt_.get_value(TAYLOR).c_str());
if (order < 1 || order > 5)
{
gctl::invalid_argument("Invalid taylor order: " + gopt_.get_value(TAYLOR));
}
taylor_order_ = order;
}
// 化极
RTP(mean_inc_, mean_dec_);
DiffRTP(taylor_order_);
}
// 输出网格文件
SaveGrid();
return;
}

66
src/drtp.h Normal file
View File

@ -0,0 +1,66 @@
#ifndef _DRTP_H
#define _DRTP_H
#include "gctl/core.h"
#include "gctl/utility.h"
#include "gctl/io.h"
#include "gctl/algorithm.h"
#include "complex"
#include "fftw3.h"
#include "stdlib.h"
#define GRIDIN "input-grid"
#define GRIDOUT "output-grid"
#define GRIDPARA "grid-para"
#define GEOMAGEXE "geomag-exe"
#define GEOMAGPARA "geomag-para"
#define GEOMAGOUT "geomag-output"
#define IGRFMODEL "IGRF"
#define CALLGEOMAG "call-geomag"
#define USEMEAN "mean-geomag"
#define TAYLOR "taylor-order"
class DRTP
{
public:
DRTP()
{
netcdf_lon_name_ = "x";
netcdf_lat_name_ = "y";
netcdf_data_name_ = "z";
taylor_order_ = 2;
}
virtual ~DRTP(){}
void ReadConfig(std::string filename); // 读入参数
void ReadGrid(); // 读入磁异常总强度异常网格文件Netcdf
void ReadGEOMAG(); // 读入geomag输出文件中的倾角与偏角
void SaveGrid(); // 保存计算结果文件
void CalNormalField(); // 计算网格节点位置的正常场的磁倾角与磁偏角
void RTP(double inc, double dec); // 普通化极 倾角与偏角的单位为度
void DiffRTP(int order); // 差分化极
void Process(); // 执行化极流程
double cosd(double deg){return cos(deg*GCTL_Pi/180.0);}
double sind(double deg){return sin(deg*GCTL_Pi/180.0);}
protected:
unsigned int taylor_order_;
int rsize_, csize_;
double mean_inc_, mean_dec_;
double dlon_, dlat_;
gctl::array<double> in_lon_, in_lat_;
gctl::matrix<double> grid_;
gctl::matrix<double> rtp_;
gctl::matrix<double> geomag_inc_;
gctl::matrix<double> geomag_dec_;
std::string ingrid_name_, outgrid_name_;
std::string netcdf_data_name_, netcdf_lon_name_, netcdf_lat_name_;
// 从文件读入参数列表
gctl::getoption gopt_;
};
#endif //_DRTP_H

42
src/main.cpp Normal file
View File

@ -0,0 +1,42 @@
#include "drtp.h"
int main(int argc, char *argv[])
{
if (argc == 1)
{
std::clog << "RTP with variable geomagnetic parameters." << std::endl;
std::clog << "Usage: ./drtp <config-file>" << std::endl << std::endl;
std::clog << "Available options:" << std::endl;
std::clog << "input-grid = <Directory to the netcdf file of the deltaT anomalies>" << std::endl;
std::clog << "output-grid = <Directory to the output netcdf file>" << std::endl;
std::clog << "grid-para = <x-axis>,<y-axis>,<data> (Names of data attribute of the netcdf file. The default is x,y,z.)" << std::endl;
std::clog << "geomag-exe = <Directory to the executable of the geomag.exe program>" << std::endl;
std::clog << "geomag-para = <Parameters needed by the geomag.exe program>" << std::endl;
std::clog << "geomag-output = <Directory to the output file of the geomag.exe program>" << std::endl;
std::clog << "IGRF = <directory to the IGRF model file>" << std::endl;
std::clog << "call-geomag = yes|no <Call the geomag.exe program to calculate the geomagnetic parameters>" << std::endl;
std::clog << "mean-geomag = <inc>/<dec> (Use a set of mean geomagnetic parameters defined by the user. \
Use this option to run a non-differential RTP process.)" << std::endl;
std::clog << "taylor-order = <order> (Differential orders of the taylor series. Must be between 1 and 5. The default order is 2.)" << std::endl;
std::clog << std::endl << "Required options:" << std::endl;
std::clog << "1. Non-differential RTP" << std::endl;
std::clog << "input-grid mean-geomag output-grid(optional) grid-para(optional)" << std::endl;
std::clog << "2. Differential RTP with no geomag.exe output" << std::endl;
std::clog << "input-grid output-grid(optional) geomag-exe geomag-para geomag-output IGRF call-geomag(yes) taylor-order(optional) grid-para(optional)" << std::endl;
std::clog << "3. Differential RTP with geomag.exe output" << std::endl;
std::clog << "input-grid output-grid(optional) geomag-output call-geomag(no) taylor-order(optional) grid-para(optional)" << std::endl;
return -1;
}
try
{
DRTP d;
d.ReadConfig(argv[1]);
d.Process();
}
catch (std::exception &e)
{
GCTL_ShowWhatError(e.what(), GCTL_ERROR_ERROR, 0, 0, 0);
}
return 0;
}