source: issm/trunk-jpl/src/m/contrib/morlighem/ronne/interpRignot2012.m@ 23873

Last change on this file since 23873 was 23873, checked in by Mathieu Morlighem, 6 years ago

NEW: added interpolation routines'

File size: 867 bytes
Line 
1function [vxout vyout]= interpRignot2012(X,Y),
2
3filename = '/home/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
4
5
6%Figure out what subset of the matrix should be read
7load(filename,'x','y');
8velfile = matfile(filename);
9
10offset=2;
11
12xmin=min(X(:)); xmax=max(X(:));
13posx=find(x<=xmax);
14id1x=max(1,find(x>=xmin,1)-offset);
15id2x=min(numel(x),posx(end)+offset);
16
17ymin=min(Y(:)); ymax=max(Y(:));
18%posy=find(y>=ymin);
19%id1y=max(1,find(y<=ymax,1)-offset);
20%id2y=min(numel(y),posy(end)+offset);
21posy=find(y<=ymax);
22id1y=max(1,find(y>=ymin,1)-offset);
23id2y=min(numel(y),posy(end)+offset);
24
25vx = velfile.vx(id1y:id2y,id1x:id2x);
26vy = velfile.vy(id1y:id2y,id1x:id2x);
27x = x(id1x:id2x);
28y = y(id1y:id2y);
29
30%load(filename);
31vxout = InterpFromGrid(x,y,double(vx),X,Y);
32vyout = InterpFromGrid(x,y,double(vy),X,Y);
33
34if nargout==1,
35 vxout = sqrt(vxout.^2+vyout.^2);
36end
Note: See TracBrowser for help on using the repository browser.