[19043] | 1 | %Getting the velocity in PIG vicinity for the ExpDraw
|
---|
[18198] | 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
|
---|
[20730] | 8 | xmin = ncreadatt(nsidc_vel,'/','xmin');
|
---|
| 9 | ymax = ncreadatt(nsidc_vel,'/','ymax');
|
---|
| 10 | spacing = ncreadatt(nsidc_vel,'/','spacing');
|
---|
| 11 | nx = double(ncreadatt(nsidc_vel,'/','nx'));
|
---|
| 12 | ny = double(ncreadatt(nsidc_vel,'/','ny'));
|
---|
| 13 | vx = double(ncread(nsidc_vel,'vx'));
|
---|
| 14 | vy = double(ncread(nsidc_vel,'vy'));
|
---|
| 15 |
|
---|
[18198] | 16 | xmin = strtrim(xmin); % this is a string, and we need to recover the double value
|
---|
[20730] | 17 | xmin = str2num(xmin(1:end-2)); % get rid of the unit and convert to double
|
---|
[18198] | 18 |
|
---|
| 19 | ymax = strtrim(ymax);
|
---|
[20730] | 20 | ymax = str2num(ymax(1:end-2));
|
---|
[18198] | 21 |
|
---|
| 22 | spacing = strtrim(spacing);
|
---|
[20730] | 23 | spacing = str2num(spacing(1:end-2));
|
---|
[18198] | 24 |
|
---|
[20730] | 25 | % Build the coordinates
|
---|
| 26 | x=xmin+(0:1:nx)'*spacing;
|
---|
| 27 | y=(ymax)-(0:1:ny)'*spacing;
|
---|
[18198] | 28 |
|
---|
[20730] | 29 | %Limit the region to Pine Island
|
---|
| 30 | posx=find(x<=-12.0e5 & x>=-18.0e5);
|
---|
| 31 | x_pig=x(posx);
|
---|
| 32 | posy=find(y<=1.0e5 & y>-4.0e5);
|
---|
| 33 | y_pig=y(posy);
|
---|
[18198] | 34 |
|
---|
[20730] | 35 | vx_pig=flipud(vx(posx,posy)');
|
---|
| 36 | vy_pig=flipud(vy(posx,posy)');
|
---|
| 37 | vel_pig=sqrt(vx_pig.^2+vy_pig.^2);
|
---|
[18198] | 38 |
|
---|
[20730] | 39 | imagesc(x_pig,y_pig,vel_pig)
|
---|