[21337] | 1 | Index: ../trunk-jpl/examples/Pig/PigRegion.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/examples/Pig/PigRegion.m (revision 20796)
|
---|
| 4 | +++ ../trunk-jpl/examples/Pig/PigRegion.m (revision 20797)
|
---|
| 5 | @@ -7,12 +7,12 @@
|
---|
| 6 | % Get necessary data to build up the velocity grid
|
---|
| 7 | xmin = ncreadatt(nsidc_vel,'/','xmin');
|
---|
| 8 | ymax = ncreadatt(nsidc_vel,'/','ymax');
|
---|
| 9 | -spacing = ncreadatt(nsidc_vel,'/','spacing');ls
|
---|
| 10 | +spacing = ncreadatt(nsidc_vel,'/','spacing');
|
---|
| 11 |
|
---|
| 12 | -nx = double(ncreadatt(nsidc_vel,'/','nx'));
|
---|
| 13 | -ny = double(ncreadatt(nsidc_vel,'/','ny'));
|
---|
| 14 | -vx = double(ncread(nsidc_vel,'vx'));
|
---|
| 15 | -vy = double(ncread(nsidc_vel,'vy'));
|
---|
| 16 | +nx = double(ncreadatt(nsidc_vel,'/','nx'));
|
---|
| 17 | +ny = double(ncreadatt(nsidc_vel,'/','ny'));
|
---|
| 18 | +vx = double(ncread(nsidc_vel,'vx'));
|
---|
| 19 | +vy = double(ncread(nsidc_vel,'vy'));
|
---|
| 20 |
|
---|
| 21 | xmin = strtrim(xmin); % this is a string, and we need to recover the double value
|
---|
| 22 | xmin = str2num(xmin(1:end-2)); % get rid of the unit and convert to double
|
---|
| 23 | @@ -28,14 +28,14 @@
|
---|
| 24 | y=(ymax)-(0:1:ny)'*spacing;
|
---|
| 25 |
|
---|
| 26 | %Limit the region to Pine Island
|
---|
| 27 | -posx=find(x<=-12.0e5 & x>=-18.0e5);
|
---|
| 28 | -x_pig=x(posx);
|
---|
| 29 | -posy=find(y<=1.0e5 & y>-4.0e5);
|
---|
| 30 | -y_pig=flipud(y(posy));
|
---|
| 31 | +posx = find(x<=-12.0e5 & x>=-18.0e5);
|
---|
| 32 | +x_pig = x(posx);
|
---|
| 33 | +posy = find(y<=1.0e5 & y>-4.0e5);
|
---|
| 34 | +y_pig = flipud(y(posy));
|
---|
| 35 |
|
---|
| 36 | -vx_pig=flipud(vx(posx,posy)');
|
---|
| 37 | -vy_pig=flipud(vy(posx,posy)');
|
---|
| 38 | -vel_pig=sqrt(vx_pig.^2+vy_pig.^2);
|
---|
| 39 | +vx_pig = flipud(vx(posx,posy)');
|
---|
| 40 | +vy_pig = flipud(vy(posx,posy)');
|
---|
| 41 | +vel_pig = sqrt(vx_pig.^2+vy_pig.^2);
|
---|
| 42 |
|
---|
| 43 | -imagesc(x_pig,y_pig,log(vel_pig+1))
|
---|
| 44 | -axis xy equal
|
---|
| 45 | +imagesc(x_pig,y_pig,log(vel_pig+1));
|
---|
| 46 | +axis xy equal tight;
|
---|