function plotAmp(ResSig,Sig,Res,OPTIONS);
%
%  ResSig = 'Res' or 'Sig' 
%  Sig,Res = signal and residual amplitude structures
%  OPTIONS plotting options required for SigResPlot
%  
%  This function calls SigResPlot and then sets up controls
%    for user interface

EH = OPTIONS.EH;
site = OPTIONS.site;
if site == 'PKD'
    if EH == 'H'
        ctitle = 'Magnetic fields at Parkfield';
        clSig = [-3,-3,-3.5;0,0,-.5];
        clRes = [-4,-4,-4.5;-1,-1,-1.5];
    else
        ctitle = 'Electric fields at Parkfield';
        clSig = [-2.5;.5]*ones(1,4);
        clRes = [-2.5;.5]*ones(1,4);
    end
else
    if EH == 'H'
        ctitle = 'Magnetic fields at Hollister';
        clSig = [-3,-3,-3.5;0,0,-.5];
        clRes = [-4,-4,-4.5;-1,-1,-1.5];
    else
        ctitle = 'Electric fields at Hollister';
        clSig = [-2;1]*ones(1,4);
        clRes = [-2;1]*ones(1,4);
    end
end
OPTIONS.title = ctitle;
OPTIONS.clSig = clSig;
OPTIONS.clRes = clRes;
if OPTIONS.resplt == 'resplt_logf'
   OPTIONS.linT = 0;
else
   OPTIONS.linT = 1;
end

if ResSig == 'Res'
   OPTIONS.plotAmp = 0;
   OPTIONS.plotRes = 1;
   OPTIONS.NormalizeRes = 1;
   OPTIONS.clResNorm = [-30,0];
   SigResPlot(Sig,Res,OPTIONS);
else
   OPTIONS.plotAmp = 1;
   OPTIONS.plotRes = 0;
   OPTIONS.NormalizeSig = 0;
   SigResPlot(Sig,Res,OPTIONS);
end

%  add gui controls to plot
hFig = gcf;
set(hFig,'UserData',OPTIONS);

uicontrol('Parent',hFig,...
    	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.125,.95,.05,.030],...
	'String','-',...
	'Tag','Back',...
	'Style','pushbutton',...
	'CallBack','plotAmpCB')
uicontrol('Parent',hFig,...
    	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.175,.95,.05,.030],...
	'String','+',...
	'Tag','Forward',...
	'Style','pushbutton',...
	'CallBack','plotAmpCB')
uicontrol('Parent',hFig,...
    	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.225,.95,.20,.030],...
	'String',OPTIONS.segments,...
	'Tag','Select Segment',...
	'Style','popupmenu',...
	'CallBack','plotAmpCB',...
	'Value',OPTIONS.kSeg);
uicontrol('Parent',hFig,...
	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.425,.95,.10,.03],...
	'String','Signal',...
	'Tag','Signal',...
	'Style','radiobutton',...
	'CallBack','plotAmpCB',...
	'Value',OPTIONS.plotAmp);
uicontrol('Parent',hFig,...
	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.525,.95,.10,.03],...
	'String','Residual',...
	'Tag','Residual',...
	'Style','radiobutton',...
	'CallBack','plotAmpCB',...
	'Value',OPTIONS.plotRes);
uicontrol('Parent',hFig,...
	'Units','normalized',...
	'FontWeight','demi',...
	'Position',[.625,.95,.10,.03],...
	'String','Print',...
	'Tag','Print',...
	'Style','pushbutton',...
	'CallBack','plotAmpCB');
