function TLm=TLm_plot_old(tlm_root,Tlims,ii_img,psize,NBAin,iirng);
%
% Call TLm=TLm_plot(tlm_root,Tlims,psize,NBAin,iirng);
%
% tlm_root	= root of _TLm.mat file containing measured TL, 
%			  or TLm structure itself
% psize		= size of plot in [width,height];
%
if nargin<1, tlm_root=[]; end
if nargin<2, Tlims=[]; end
if ii_img<3 | isempty(ii_img), ii_img=1; end
if nargin<4 | isempty(psize), psize=[6,2.5]; end
if nargin<5, NBAin=[]; end
if nargin<6, iirng=0; end
%
if ischar(tlm_root) | isempty(tlm_root),
	[tlm_file,tlm_root,iif,path_back]=adi_check_file(tlm_root,'_TLm.mat','TLm');
	if ~iif, return; end
	str=['load ',tlm_root,'_TLm']; eval(str);
	if ~isempty(path_back); eval(['cd ''',path_back,'''']); end
	if exist('NBA')==1 & isempty(NBAin), NBAin=NBA; end
elseif isstruct(tlm_root),
	TLm=tlm_root;
else
	disp('USER ERROR: tlm_root must be character string, empty, or TLm structure');
	return
end
%
if TLm.nrec==1, ii_img=0; end
%
figure;
if isempty(Tlims),
	iit=1:length(TLm.t_hour);
else
	iit=find(TLm.t_hour>=Tlims(1) & TLm.t_hour<=Tlims(2));
end
if ii_img==0,
	for jrec=1:TLm.nrec,
		plot_cfill(TLm.t_hour(iit),TLm.TL(:,iit),'none','b',4,'-',2);
	end
	xlabel(TLm.tlab); ylabel('TL - dB');
else
	imagesc(TLm.t_hour,TLm.jrec,TLm.TL);
	xlabel(TLm.tlab); ylabel('Receiver Number');
end
%
%
if ~isempty(NBAin),
	if isempty(Tlims),
		iit2=1:length(NBAin.time_favg);
	else
		iit2=find(NBAin.time_favg>=Tlims(1) & NBAin.time_favg<=Tlims(2));
	end
	TLm.range=interp1(NBA.time_favg,NBA.range,TLm.t_hour);
	hold on; plot(NBAin.time_favg(iit2),NBAin.TL_favg(iit2),'r');
	plot(NBAin.time_favg(iit2),NBAin.TLi(iit2,:),'r--');
	NBA=NBAin;
	str=['save ',TLm.out_root,'_TLm TLm NBA'], eval(str)
end
%
plot_set3(gca,2,'Arial',14,1);
plot_size(gca,'in',psize(1),psize(2));
%
grid on;
%
if iirng,
	figure
	plot(NBAin.time_favg(iit2),NBAin.range(iit2),'b');
	xlabel(TLm.tlab); ylabel('S-R Range - km');
	plot_set3(gca,2,'Arial',14,1);
	plot_size(gca,'in',psize(1),.5*psize(2));
	grid on;
%
	figure
	plot_cfill(TLm.range(iit),TLm.TL(iit),'none','b',4,'-',2); hold on;
	plot(NBAin.range(iit2),NBAin.TL_favg(iit2),'r');
	plot(NBAin.range(iit2),NBAin.TLi(iit2,:),'r--');
	xlabel('S-R Range - km'); ylabel('TL - dB');
	plot_set3(gca,2,'Arial',14,1);
	plot_size(gca,'in',psize(1),psize(2));
	grid on;
end
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
