-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexample.m
More file actions
59 lines (49 loc) · 1.56 KB
/
example.m
File metadata and controls
59 lines (49 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% This is an simple example for ocean bathy retrieving using GGM. The test
% area was selected over the Mariana Trench where has the deepest point of
% the ocean.
% Test enviroment: GMT 6.1.1, Matlab R2018b, Windows10
% Author: Wang Yongkang
% Editor: Lei Yang
%% Set GMT path.
oldpath = path;
path(oldpath,'C:\programs\gmt6exe\bin'); % should change it to your path.
clc
clear
%% Set loading files
free=load('free.txt'); % Gravity Anamony data.
control=load('control.txt'); % Input ocean depth data
check=load('check.txt'); % checking data of depth
range='142.6/147.3/23/27'; % ocean area
d=-8000;
%% Call the GGM function
% 这里有两个GGM程序,GGM()使用单波束数据作为控制和检核,GGM_multbeam()使用单波束作为控制,多波束作为检核。
result=GGM(free,control,check,d,range);
% result=GGM_multbeam(free,control,check,d,range);
% Show the information of result
X = [' The mean difference between GGM and the truth is: ',num2str(mean(result.detaD)),' meter'];
disp(X)
X = [' The STD difference between GGM and the truth is: ',num2str(std(result.detaD)),' meter'];
disp(X)
X = [' The best rou is: ',num2str(result.rou)];
disp(X)
% Remove outliers by 3 sigma
u=mean(result.detaD);
s=std(result.detaD);
big=u+3*s;
small=u-3*s;
d_d=result.detaD;
[n]=find(d_d>big);
d_d(n)=NaN;
[n]=find(d_d<small);
d_d(n)=NaN;
d_d(any(isnan(d_d),2),:)=[];
figure ('name','d')
plot(d_d)
figure ('name','his')
nbins = 100; h = histogram(d_d,nbins);%与hist相同
X = [' The STD difference between GGM and the truth is: ',num2str(std(d_d)),' meter'];
disp(X)
delete free.grd
delete long.grd
delete short.grd
delete ggm.grd