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

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

CHG: fixed some minor problems

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