Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed demo batura to use OC
Fix arrow orientation on batura example.
  • Loading branch information
Aslak Grinsted committed Sep 19, 2016
1 parent d4ca64c commit 791fabe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions demobatura.m
Expand Up @@ -17,6 +17,7 @@
[A,x,y,Ia]=geoimread(fullfile(datafolder,'batura_2001.tif'));
[B,xb,yb,Ib]=geoimread(fullfile(datafolder,'batura_2002.tif'));
deltax=x(2)-x(1);%m/pixel
deltay=y(2)-y(1);%m/pixel


%make regular grid of points to track:
Expand All @@ -33,7 +34,7 @@
mask=inpolygon(pu,pv,roi(:,1),roi(:,2));
pu(~mask)=nan; %inserting nans at some locations will tell template match to skip these locations

[du,dv,C,Cnoise,pu,pv]=templatematch(A,B,pu,pv,'showprogress',{'2001' '2002'});
[du,dv,C,Cnoise,pu,pv]=templatematch(A,B,pu,pv,'showprogress',true,'method','oc');
close all

%visualize the results
Expand All @@ -44,7 +45,7 @@
hold on
signal2noise=C./Cnoise;
keep=(signal2noise>2)&(C>.6);
V=(du+dv*1i)*deltax; %m/yr
V=(du*deltax)+(dv*1i)*deltay; %m/yr
Vn=abs(V);
alphawarp(px,py,Vn,.2+keep*.5)
quiver(px(keep),py(keep),real(V(keep))./Vn(keep),imag(V(keep))./Vn(keep),0.2,'k') %arrows show direction.
Expand Down

0 comments on commit 791fabe

Please sign in to comment.