1 function plot_ros(long,lat,ros)
2 % plot_ros(long,lat,ros)
4 % long east-west coordinates (m), size (m,n)
5 % lat south-north coordinates (m) size (m,n)
6 % ros rate of spread in 8 directions,from read_ros_from_wrfout
12 long_r=long(1:step:end,1:step:end);
13 lat_r=lat(1:step:end,1:step:end);
14 ros_r=ros(1:step:end,1:step:end,:,:);
26 u=a-2;v=b-2;s=norm([u,v]);
30 d(k,:)=[ros_r(i,j,a,b)*u,ros_r(i,j,a,b)*v];
34 % now d has the ends of ros vectors as rows
38 % components of the vector of max spread
39 [lambda1,i1]=max(diag(D)); % max eigenvalue
40 s1=sqrt(lambda1); % singular value
41 ax=V(:,i1); % the eigenvector
42 vertex=(center+s1*ax'*sign(center*ax)); % vertex of the ellipse away from the center
49 dx=long_r(2:end,:)-long_r(1:end-1,:);dx=mean(dx(:));
50 dy=lat_r (:,2:end)-lat_r (:,1:end-1);dy=mean(dy(:));
51 maxros=max(sqrt((u_r(:).^2+v_r(:).^2)));
52 scaleros=min(dx,dy)/6;
56 quiver(long_r,lat_r,scaleros*u_r,scaleros*v_r,'k')
58 %pcolor(long,lat,mr); shading flat