1 function plot_wind_at_h(p,iheights,levels,alpha,timestep,windscale,heightscale)
5 if ~exist('timestep','var'),
8 if ~isscalar(timestep),
9 error('timestep must be scalar')
11 hgt=p.hgt(:,:,timestep); % terrain height
12 % wind at given height
14 z=p.heights(i)*ones(size(x));
15 ws=sqrt(p.uch(:,:,i,timestep).^2 + p.vch(:,:,i,timestep).^2);
16 print_layer_msg(i,z,ws)
17 surf(x,y,z+hgt,ws,'EdgeAlpha',alpha*0,'FaceAlpha',alpha)
21 z=p.altitude(:,:,i,timestep)-hgt;
22 ws=sqrt(p.uc(:,:,i,timestep).^2 + p.vc(:,:,i,timestep).^2);
23 print_layer_msg(i,z,ws)
24 surf(x,y,z+hgt,ws,'EdgeAlpha',alpha*0,'FaceAlpha',alpha)
28 title({'Horizontal wind speed',p.times{1}},'Interpreter','none')
29 xlabel('m'), ylabel('m') % for now, ideal only
33 a=[min(x(:)),max(x(:)),min(y(:)),max(y(:)),0,heightscale]; % var limits
34 axis(a); % set var limits
35 xysize=max([a(4)-a(3),a(2)-a(1)]);
37 daspect([1,1,3*zsize/xysize]);
41 function print_layer_msg(i,z,ws)
42 fprintf('level %i height %g to %g median %g horizontal wind speed %g to %g median %g\n',...
43 i,min(z(:)),max(z(:)),median(z(:)),min(ws(:)),max(ws(:)),median(ws(:)) )