source: issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m@ 23876

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

NEW: added interpolation routines'

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