
% atsee.m
% ... a routine to display data at sea:


opsys=computer;

% assumes ones starting from scratch hence clears figure
  clf;
  axis('off');

%%%%%%%%%%%%%%%%%%%  Plot Standard GLOBEC Map       %%%%%%%%%%%%%%%%%%%%

% make sure in all cases the aspect ratio (lat/lon) is set
h=axes;

set(h,'aspectratio',[1 .78]);

% plot coast & bathy
  georbat(1,0,0,0);

% set axis & fix axis labels
  axis([-71 -65 40 43]);
  lllabel;
  h=axis;

%%%%%%%%%%%%%%%%% post temporary note to user for one second %%%%%%%

  texth=text(h(1),39.75,'Welcome to ATSEE 2.2!!','fontsize',16);
  texth2=text(h(1),39.33,'Select features from menu above',...
  'fontsize',16);
  disp('')
  pause(1)
  set(texth,'Visible','off');
  set(texth2,'Visible','off');



%%%%%%%%%%%%%%%%%%     Ship Pos'n & Sensor Data option         %%%%%%%%%%%%%%%%%%
  ext1=uimenu('label','Ship');
    set(ext1,'Backgroundcolor','g')
    uimenu(ext1,'label','Load Oceanus Data ','callback','oceanus');
    uimenu(ext1,'label','Plot shiptrack ','callback','pltship');
    uimenu(ext1,'label','Plot sst and salt ','callback',...
       'figure(2);plttsts;figure(1)');


%%%%%%%%%%%%%%%%%%     overlay standard sites & station data    %%%%%%%%%%%%%%%%%%
  ext=uimenu('label','Overlay');
    set(ext,'Backgroundcolor','y')
    uimenu(ext,'label','1995 process  moorings ','callback',...
      'plot([-67.6264 -67.5588],[40.956 40.864],''g*'')');
    uimenu(ext,'label','Schlitz  moorings ','callback',...
       'pltrons(0)');
%      'm=menu(''How?'',''include tripod sites labels'',...
%              ''surface only'',...
%              ''just surface no labels'');plotrons(m);');
    uimenu(ext,'label','longterm moorings ','callback',...
      'plot([-67.317 -67.542],[40.968 41.407],''r*'')');
    uimenu(ext,'label','broad scale  sites','callback','pltbs;');
    uimenu(ext,'label','NOAA buoys  sites ','callback',...
       'plot([-66.7 -69.4 -68.9],[41.5 40.5 42.9],''c*'');');

    uimenu(ext,'label','observed drifter tracks','callback','sumplt(1);');
    uimenu(ext,'label','user defined sites','callback','y=buildmat;');
      

%%%%%%%%%%%%%%%%%%     bathy options                   %%%%%%%%%%%%%%%%%%
  bty=uimenu('label','Bathy');
    set(bty,'Backgroundcolor','c')
    uimenu(bty,'label','Standard isobaths (60,100,200)','callback','georbat(1,0,0,0);');
    uimenu(bty,'label','Limeburner Shades','callback',' gbmap;lllabel;');

    uimenu(bty,'label','Signell GEBCO details','callback','pltmb;');

    uimenu(bty,'label','include 80m bathymetry contour','callback','plt80m;');
    uimenu(bty,'label','particular bathymetry contour','callback','bathgrid;');


%%%%%%%%%%%%%%%%%%     Make grid or section of proposed stations %%%%%%%%%%%%%%%%%%
  grd=uimenu('label','MakeGrid');
    set(grd,'Backgroundcolor','y')
    uimenu(grd,'label','Generate a grid of stations','callback','makgrd');
    uimenu(grd,'label','Plot this grid of stations','callback',...
    'load formgrid.out;f=formgrid;clear formgrid;plot(f(:,7),f(:,6),''m.'',''markersize'',20);if length(f(:,1))<10;for j=1:length(f(:,1));text(f(j,7),f(j,6),[''  '',num2str(f(j,1))]);end;end;');
    
%%%%%%%%%%%%%%%%%%     Zoom                   %%%%%%%%%%%%%%%%%%
% Add a zoom option
  ext2=uimenu('label','ZOOM');
    set(ext2,'Backgroundcolor','c')
    uimenu(ext2,'label','zoom in ','callback','zoomer;lllabel');
    uimenu(ext2,'label','zoom out ','callback','axis([-71 -65 40 44]);');
    uimenu(ext2,'label','South Flank ','callback','h=axis([-69 -66.5 40 41.5]);lllabel;');
    uimenu(ext2,'label','Schlitz 99 Moorings ','callback','h=axis([-67.5 -67.0 41. 41.25]);lllabel;');
    uimenu(ext2,'label','Great South Channel ','callback',...
     'h=axis([-69.5 -67.9 40.2 41]);lllabel(30,30,40,41,-69.5,-68);');
    
%%%%%%%%%%%%%%%%%%   Help (Documentation)      %%%%%%%%%%%%%%%%%%
% Add a help option with pull down topics
% The utility to view help depends on the operating system
  if opsys(1:3)=='PCW';
    ued='!notepad.exe';
  else;
    ued='!vi';
  end;
  ext3=uimenu('label','Help');
    set(ext3,'Backgroundcolor','y')
    uimenu(ext3,'label','Caution ','callback','eval([ued,'' caution.doc'']);return;');
    uimenu(ext3,'label','Release Notes','callback','eval([ued,'' release.doc'']);');
    uimenu(ext3,'label','Purpose of ATSEE','callback','eval([ued,'' purpose.doc'']);');
    uimenu(ext3,'label','How currents estimated ','callback','eval([ued,'' currents.doc'']);');
    uimenu(ext3,'label','Yet to be developed ','callback','eval([ued,'' yet_todo.doc'']);');
    uimenu(ext3,'label','How events are plotted ','callback','eval([ued,'' eventplt.doc'']);');

%%%%%%%%%%%%%%%%%%     Contour                   %%%%%%%%%%%%%%%%%%
% Add a grid & contour option
  cont=uimenu('label','Contour');
    set(cont,'Backgroundcolor','c')
    uimenu(cont,'label','Vertical Sections','callback','versec');
    uimenu(cont,'label','Horizontal Sections','callback','hsec');

%%%%%%%%%%%%%%%%%%     Model                   %%%%%%%%%%%%%%%%%%
% Add Dartmouth Model
  model=uimenu('label','Model');
    set(model,'Backgroundcolor','m')
%    uimenu(model,'label','start Q4','callback','quoddy');
    uimenu(model,'label','start Q4','callback','disp(''Sorry: Needs quoddy model.'')');
    uimenu(model,'label','display Q4 time series','callback',...

       'if exist(''d'')==0;disp(''Loading model output...'');load c:\model\q42\vectors.dat;d=vectors;end;pltq4ts');

    uimenu(model,'label','display Q4 vectors','callback',...

       'if exist(''d'')==0;disp(''Loading model output...'');load c:\model\q42\vectors.dat;d=vectors;end;pltq4vec');
    uimenu(model,'label','display Q4 trajectories','callback',...

       'plottraj');

%%%%%%%%%%%%%%%%%%     Print                   %%%%%%%%%%%%%%%%%%
% Add a print option
  prt=uimenu('label','Print');
    set(prt,'Backgroundcolor','g')
    uimenu(prt,'label','annotate figure','callback','smatdraw;');
    uimenu(prt,'label','send B&W to default','callback','print -dps this;!lpr -h this.ps;');
    uimenu(prt,'label','generate color postscript','callback','print -dpsc');

%%%%%%%%%%%%%%%%%%     Quit                   %%%%%%%%%%%%%%%%%%
% Add a quit option
  qt=uimenu('label','Quit');
    set(qt,'Backgroundcolor','y')
    uimenu(qt,'label','Restart ATSEE','callback','clf; atsee');
    uimenu(qt,'label','Return to MATLAB','callback','return');
    uimenu(qt,'label','Quit Matlab ','callback','quit');



