1 | function [vxout vyout] = interpJoughinMosaic(X,Y),
|
---|
2 |
|
---|
3 | switch oshostname(),
|
---|
4 | case {'ronne'}
|
---|
5 | filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
|
---|
6 | case {'totten'}
|
---|
7 | filename = '/totten_1/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
|
---|
8 | otherwise
|
---|
9 | error('machine not supported yet');
|
---|
10 | end
|
---|
11 | verbose = 1;
|
---|
12 |
|
---|
13 | %Figure out what subset of the matrix should be read
|
---|
14 | load(filename,'x_m','y_m');
|
---|
15 | velfile = matfile(filename);
|
---|
16 |
|
---|
17 | offset=2;
|
---|
18 |
|
---|
19 | xmin=min(X(:)); xmax=max(X(:));
|
---|
20 | posx=find(x_m<=xmax);
|
---|
21 | id1x=max(1,find(x_m>=xmin,1)-offset);
|
---|
22 | id2x=min(numel(x_m),posx(end)+offset);
|
---|
23 |
|
---|
24 | ymin=min(Y(:)); ymax=max(Y(:));
|
---|
25 | posy=find(y_m>=ymin);
|
---|
26 | id1y=max(1,find(y_m<=ymax,1)-offset);
|
---|
27 | id2y=min(numel(y_m),posy(end)+offset);
|
---|
28 |
|
---|
29 | vx = velfile.vx(id1y:id2y,id1x:id2x);
|
---|
30 | vy = velfile.vy(id1y:id2y,id1x:id2x);
|
---|
31 | x_m = x_m(id1x:id2x);
|
---|
32 | y_m = y_m(id1y:id2y);
|
---|
33 |
|
---|
34 | %load(filename);
|
---|
35 | vxout = InterpFromGrid(x_m,y_m,vx,X,Y);
|
---|
36 | vyout = InterpFromGrid(x_m,y_m,vy,X,Y);
|
---|