forked from cultpenguin/mGstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
visim_set_variogram.m
59 lines (50 loc) · 1.37 KB
/
visim_set_variogram.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
% visim_set_variogram : Set variogram model (gslib style) for VISIM
%
% Call :
% V=visim_set_variogram(V,Va)
%
% Example :
% V=visim_init;
% V=visim_set_variogram(V,'1 Sph(30)');
%
%
function [V,Va]=visim_set_variogram(V,Va);
if ischar(Va);
Va=deformat_variogram(Va);
end
V.Va.nst=length(Va);
iv=0;
for i=1:length(Va);
if Va(i).itype==0
% nugget
V.Va.nugget=Va(i).par1;
V.Va.nst=V.Va.nst-1;
else
iv=iv+1;
V.Va.cc(iv)=Va(i).par1;
V.Va.it(iv)=Va(i).itype;
if length(Va(i).par2)==1;
V.Va.a_hmax(iv)=Va(i).par2;
V.Va.a_hmin(iv)=Va(i).par2;
V.Va.a_vert(iv)=Va(i).par2;
V.Va.ang1=0;
V.Va.ang2=0;
V.Va.ang3=0;
elseif length(Va(i).par2)==3;
V.Va.a_hmax(iv)=Va(i).par2(1);
V.Va.a_hmin(iv)=Va(i).par2(1)*Va(i).par2(3);
V.Va.a_vert(iv)=0;
V.Va.ang1=Va(i).par2(2);
V.Va.ang2=0;
V.Va.ang3=0;
elseif length(Va(i).par2)==6;
V.Va.a_hmax(iv)=Va(i).par2(1);
V.Va.a_hmin(iv)=Va(i).par2(1)*Va(i).par2(5);
V.Va.a_vert(iv)=Va(i).par2(1)*Va(i).par2(6);
V.Va.ang1=Va(i).par2(2);
V.Va.ang2=Va(i).par2(3);
V.Va.ang3=Va(i).par2(4);
end
end
V.gvar=sum([Va.par1]);
end