%*** run_choice.m calls appropriate subroutines for given model parameters

%%%%% Geodetic Properties

%azim           Direction to satellite, clockwise from north, radians
%l_a            look angle, radians
%lambda         wavelength, m

azim    = get(azimbut, 'string');
azim    = str2num(azim)*pi/180;	
l_a     = get(lookbut, 'string');
l_a     = str2num(l_a)*pi/180;
lambda  = get(lambdabut, 'string');
lambda  = str2num(lambda);

Var    = get(noisebut, 'string');
Var    = str2num(Var);	
lambda = lambda*100;
delete(geodesy_plate);

medium_type    = get(mediumbut, 'value');  %1=elastic half-space	       
source_num    = get(sourcebut, 'string');	       
source_num    = str2num(source_num);
% 
if medium_type == 1
medium1
else
'no medium other than 1 (elastic half-space) is available yet'
pause;
end

%pause;

%%%%% call routines

for idum=1:source_num
getsrctype
pause;
%if idum ~= 1
 uxtot=uxtot+ux;
 uytot=uytot+uy;
 uztot=uztot+uz;
%end
end

x=x0;
y=y0;

%%%%% Include noise in displacements
%%%%% Var is the variance in the measured data, if Var=O noise=0
%%%%% Var is in mm, while uz is in m

if Var == 0 
  noise = zeros(size(x));
else
  noise = 1e-3*Var*randn(size(x));
end
uxtot = uxtot + noise;
uytot = uytot + noise;
uztot = uztot + noise;

%%%%% Graphics
plt_pic;
%plt_sim3;
%plt_dif2;
%save dump.mat uxtot uytot uztot
delete(choice1);
%'hit space to continue'
new
