% Written Feb 2007, eleanor@ocean.washington.edu % % Creates a structure bathy with fiels lon, lat and depth (in meters) from % an ascii .xyz file, downloaded from ETOPO2. %================================================= % INITIALIZE/TAILOR % WHERE IS THE .xyz file located? input_dir = '/home/eleanor/data/etopo2/'; filename = 'faroeice_4727.xyz'; % SET LIMITS ON BATHYMETRY TO INPUT lat_lim = [58 65]; lon_lim = [-20 0]; % OUTPUT FILE outfile = 'faroesbathy.mat' % Probably don't need to edit below this line. %================================================= if abs(lon_lim(1)-lon_lim(2))>20 x=input('Are you sure?'); % Just in case you enter something huge end [lat,lon,depth] = read_xyz(input_dir,filename,lat_lim,lon_lim); bathy.lat =lat; bathy.lon = lon; bathy.depth = depth; %================================================= % Save to mat-file eval(['save ',outfile,' bathy']) %================================================= % PLOT, uses package m_map from % http://www.eos.ubc.ca/~rich/map.html PLOTflag = 0; if PLOTflag figure(123) [LAT LON]=meshgrid(lat,lon); m_proj('UTM','long',[-18 -6],'lat',[60 66]); m_elev('contourf',[500:500:6000]); m_grid('box','fancy','tickdir','in'); m_pcolor(LON,LAT,depth); shading flat end