%
%  Matlab m-file to load and plot a topography and gravity profile.
%
%  The file oahu.dat is loaded.
%  The first column of the file is latitude in degrees.
%  The second column of the file is longitude in degrees.
%  The third column is distance along the profile.
%  The fourth column is topography meters.
%  The fifth column is gravity anomaly in milligals.
%
%  There are 512 evenly spaced points.
%
%  To copy this file to another computer:
%
%  ftp topex.ucsd.edu -   connect to topex
%  anonymous           -   user name
%  your name              -   password
%  cd pub/class/hw5
%  get oahu.dat     -   get this file
%  get hw5.m           -   get this file
%
%
   load oahu.dat
   lat=oahu(:,1);
   lon=oahu(:,2);
   dist=oahu(:,3);
   topo=oahu(:,4);
   grav=oahu(:,5);
   L=1000.*(dist(512)-dist(1));
%
%  window the topography profile and retain the mean depth
%
   ave=mean(topo);
   topo=(topo-ave).*hanning(512)+ave;
   grav=(grav-mean(grav)).*hanning(512);
   plot(lat,topo);
   xlabel('Latitude (deg)')
   ylabel('Topography (m)')
   pause
   plot(lat,grav)
   xlabel('Latitude (deg)')
   ylabel('Gravity Anomaly (mgal)')
   pause
%
%  take the Fourier transform of the topography and generate
%  the wavenumbers
%
   ctopo=fftshift(fft(topo));
   k=-256:1:255;
   k=(k./L)';
