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