%------------------ % Purpose: %------------------ % plot global M field % plot topography % plot ssh with following preprocessing: % a) remove the running 15 week average % b) optionally: spatial filter in space % make a movie of propagating ssh signals! %------------------ % History: % built from get_m_flex_filter, Nov. 16th/2007 %------------------ % flag_overlay = 1 overlay ssh with mdt % flag_overlay = 2 overlay ssh with bottom topography flag_overlay = 2; zlevels = [1:0.05:2.0]; y0 =25; dy = 20; y1 = y0+dy; x0 = 315; dx = 20/cosd((y0+y1)/2); x1 = x0+dx; load M_19940105_19991229_upd_highpass1_15weekanom ireg = find(NbLongitudes>x0 & NbLongitudesy0 & NbLatitudesx0 & lon_mdty0 & lat_mdt1e19) = NaN; % convert to SI, orient so first index corresponds to latitude: ssh_ts(:,:,n+1) = ssh'/100; end disp('reading week 8 of 2000') pause(5) % loop over remaining files (Feb 23, 2000, is first) pp = 0; for n = 8:nfiles-7 pp = pp+1; % prepare the next set of 15 weeks ssh_ts(:,:,1:14) = ssh_ts(:,:,2:15); infile = char(files(n+7)) outfile = strcat(infile(1:filenamelen),'.mat'); if exist(strcat(dir,'/',outfile),'file') load(strcat(dir,'/',outfile)) else Grid_0001=getnc(strcat(dir,'/',infile),'Grid_0001'); end % missing value replacement ssh = Grid_0001; ssh(Grid_0001>1e19) = NaN; % convert to SI, orient so first index corresponds to latitude: ssh_ts(:,:,15) = ssh'/100 ; % clear ssh Grid_0001 % extract the center week % remove mean over surrounding 15 weeks if flag_time_filter == 1 ssh = squeeze(ssh_ts(:,:,7)) - mean(ssh_ts,3); else ssh = squeeze(ssh_ts(:,:,7)); end % high-pass filter in space if flag_space_filter == 1 ssh_sm = gaussian_smooth(ssh,19,6); ssh = ssh - ssh_sm; end fig = figure(1); clf contourf(NbLongitudes(ireg), NbLatitudes(jreg), ssh(jreg,ireg), zlevels) %,'-k') % % contourf(NbLongitudes(ireg), NbLatitudes(jreg), ssh(jreg,ireg), [-0.5:0.02:0.5]) %,'-k') % hp = pcolor(NbLongitudes(ireg), NbLatitudes(jreg),M(jreg,ireg)); % hp = pcolor(NbLongitudes(ireg), NbLatitudes(jreg),ssh(jreg,ireg)); % hp = pcolor(lon_mdt(imdt),lat_mdt(jmdt),mdt(jmdt,imdt)); % set(hp,'EdgeColor','none') % caxis([-0.25 0.25]) % caxis([0 2.5]) colorbar hold on switch flag_overlay case 1 contour(lon_mdt(imdt),lat_mdt(jmdt),mdt(jmdt,imdt),[-2:0.05:2],'-k'); case 2 contour(NbLongitudes(ireg), NbLatitudes(jreg), ... TopoInterp(jreg,ireg),[-8000:250:0],'-w','LineWidth',2) end caxis([min(zlevels) max(zlevels)]) axis('square') hold on basemap(y0,dy,x0,dx,0,'k') hold on my_movie(pp) = getframe(gcf); end movie2avi(my_movie,'ssh_over_topog_v1.avi','fps',5) save(outfile_fin,'my_movie','NbLongitudes','NbLatitudes', 'x0','x1','y0','y1',... 'dx','dy','ireg','jreg','TopoInterp','mdt','lon_mdt','lat_mdt', ... 'flag_date','flag_time_filter','flag_space_filter', ... 'flag_source','flag_overlay', 'flag_source')