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

Last change on this file since 20730 was 20730, checked in by seroussi, 9 years ago

CHG: cleaned pigregion

  • Property svn:executable set to *
File size: 1.1 KB
Line 
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');
9ymax = ncreadatt(nsidc_vel,'/','ymax');
10spacing = ncreadatt(nsidc_vel,'/','spacing');
11nx = double(ncreadatt(nsidc_vel,'/','nx'));
12ny = double(ncreadatt(nsidc_vel,'/','ny'));
13vx = double(ncread(nsidc_vel,'vx'));
14vy = double(ncread(nsidc_vel,'vy'));
15
16xmin = strtrim(xmin); % this is a string, and we need to recover the double value
17xmin = str2num(xmin(1:end-2)); % get rid of the unit and convert to double
18
19ymax = strtrim(ymax);
20ymax = str2num(ymax(1:end-2));
21
22spacing = strtrim(spacing);
23spacing = str2num(spacing(1:end-2));
24
25% Build the coordinates
26x=xmin+(0:1:nx)'*spacing;
27y=(ymax)-(0:1:ny)'*spacing;
28
29%Limit the region to Pine Island
30posx=find(x<=-12.0e5 & x>=-18.0e5);
31x_pig=x(posx);
32posy=find(y<=1.0e5 & y>-4.0e5);
33y_pig=y(posy);
34
35vx_pig=flipud(vx(posx,posy)');
36vy_pig=flipud(vy(posx,posy)');
37vel_pig=sqrt(vx_pig.^2+vy_pig.^2);
38
39imagesc(x_pig,y_pig,vel_pig)
Note: See TracBrowser for help on using the repository browser.