-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhowto_g05.m
186 lines (158 loc) · 3.8 KB
/
howto_g05.m
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
%% HOWTO g05: Plotting in GrafLab and the output variable
%
% You will learn how to plot the results of the synthesis with GrafLab and
% about the GrafLab output variable.
%
% Only synthesis at a grid can be plotted with GrafLab.
%
% All the GrafLab input parameters are explained in <../docs/graflab.md
% ../docs/graflab.md>.
clear; clc; init_checker();
%% Plotting with "Mapping Toolbox"
%
% Define the GrafLab input parameters.
GM = 3986004.415E+8;
R = 6378136.3;
nmin = 0;
nmax = 360;
ellipsoid = 1;
GGM_path = '../data/input/EGM96.mat';
crd = 0;
point_type = 0;
lat_grd_min = -90.0;
lat_grd_step = 1.0;
lat_grd_max = 90.0;
lon_grd_min = 0.0;
lon_grd_step = lat_grd_step;
lon_grd_max = 360.0;
h_grd = 0.0;
out_path = '../data/output/howto-g05-mapping-toolbox';
quantity_or_error = 0;
quantity = 5;
fnALFs = 1;
export_data_txt = 1;
export_report = 1;
export_data_mat = 1;
display_data = 1; % Use Mapping Toolbox to plot the synthesis
graphic_format = 6;
colormap = 1;
number_of_colors = 60;
dpi = 300;
status_bar = 1;
%%
%
% Do the synthesis
tic
out_mt = GrafLab('OK', ...
GM, ...
R, ...
nmin, ...
nmax, ...
ellipsoid, ...
GGM_path, ...
crd, ...
point_type, ...
lat_grd_min, ...
lat_grd_step, ...
lat_grd_max, ...
lon_grd_min, ...
lon_grd_step, ...
lon_grd_max, ...
h_grd, ...
[], ...
[], ...
[], ...
[], ...
out_path, ...
quantity_or_error, ...
quantity, ...
fnALFs, ...
[], ...
export_data_txt, ...
export_report, ...
export_data_mat, ...
display_data, ...
graphic_format, ...
colormap, ...
number_of_colors, ...
dpi, ...
status_bar);
time_mt = toc;
%%
%
% You may now open the following files to see the maps:
fprintf("""%s*.png"".\n", out_path);
%%
%
% The time needed to perform the synthesis and plot the results is:
fprintf("%0.1f sec.\n", time_mt);
%%
%
% Conclution: the plots are nice, but the plotting may be very slow for large
% grids.
%% Plotting with the "imagesc" function
%
% Update some of the GrafLab input paramaters.
display_data = 2; % Use the "imagesc" function to plot the synthesis
out_path = '../data/output/howto-g05-imagesc';
%%
%
% Do the synthesis
tic;
out_imgsc = GrafLab('OK', ...
GM, ...
R, ...
nmin, ...
nmax, ...
ellipsoid, ...
GGM_path, ...
crd, ...
point_type, ...
lat_grd_min, ...
lat_grd_step, ...
lat_grd_max, ...
lon_grd_min, ...
lon_grd_step, ...
lon_grd_max, ...
h_grd, ...
[], ...
[], ...
[], ...
[], ...
out_path, ...
quantity_or_error, ...
quantity, ...
fnALFs, ...
[], ...
export_data_txt, ...
export_report, ...
export_data_mat, ...
display_data, ...
graphic_format, ...
colormap, ...
number_of_colors, ...
dpi, ...
status_bar);
time_imagsc = toc;
%%
%
% You may now open the following files to see the maps:
fprintf("""%s*.png"".\n", out_path);
%%
%
% The time needed to perform the synthesis and plot the results is (compare
% the time with the Mapping Toolbox):
fprintf("%0.1f sec.\n", time_imagsc);
%%
%
% Conclusion: very simple plots, but also very fast plotting, even with large
% grids.
%% Output variable from GrafLab
%
% You may redirect the numerical outputs from GrafLab to a MATLAB variable.
% The output variable stores the numerical data used by GrafLab to prepare the
% "txt" and/or "mat" file(s). Note that the "out_path" must be specified, even
% if you do not export any data or plot.
%
% Now, you may want to explore the GrafLab numerical outputs stored in the
% "out_mt" and "out_imgsc" variables.