source: issm/trunk-jpl/examples/Pig/PigRegion.m@ 18202

Last change on this file since 18202 was 18202, checked in by schlegel, 11 years ago

CHG: update runmes for tutorials

  • Property svn:executable set to *
File size: 1.3 KB
RevLine 
[18198]1% {{{ Getting the velocity in PIG vicinity for the ExpDraw
2
3% Load Velocities
4% http://nsidc.org/data/nsidc-0484.html
5nsidc_vel='../Data/Antarctica_ice_velocity.nc';
6
7% Get necessary data to build up the velocity grid
8xmin = ncreadatt(nsidc_vel,'/','xmin');
9xmin = strtrim(xmin); % this is a string, and we need to recover the double value
10xmin = xmin(1:end-2); % get rid of the unit
11xmin = str2num(xmin); % convert to double
12
13ymax = ncreadatt(nsidc_vel,'/','ymax');
14ymax = strtrim(ymax);
15ymax = ymax(1:end-2);
16ymax = str2num(ymax);
17
18nx = ncreadatt(nsidc_vel,'/','nx');
19ny = ncreadatt(nsidc_vel,'/','ny');
20
21spacing = ncreadatt(nsidc_vel,'/','spacing');
22spacing = strtrim(spacing);
23spacing = spacing(1:end-2);
24spacing = str2num(spacing);
25
26
27x=xmin+(0:1:nx-1)'*spacing;
28x=double(x);
29y=(ymax)-(0:1:ny-1)'*spacing;
30y=double(y);
31
32posx=find(x<=-12.0e5);
33id1x=find(x>=-18.0e5,1);
34id2x=posx(end);
35
36posy=find(y>=-4.0e5);
37id1y=find(y<=1.0e5,1);
38id2y=posy(end);
39
40%Get velocity subset
41vx = double(ncread(nsidc_vel,'vx'));
42vx_obs = vx(id1x:id2x,id1y:id2y);
43vx_obs = flipud(vx_obs');
44
45vy = double(ncread(nsidc_vel,'vy'));
46vy_obs = vy (id1x:id2x,id1y:id2y);
47vy_obs = flipud(vy_obs');
48
49xred=x(id1x:id2x);
50yred=y(id1y:id2y);
51vel_obs=sqrt(vx_obs.^2.+vy_obs.^2.);
52imagesc(xred,yred,vel_obs)
53
[18202]54%}}}
Note: See TracBrowser for help on using the repository browser.