function [trans,jd]=get_trans(cdf,start,stop);
%GET_TRANS gets TRANSMISSION time series from cdf file(s)
%  USAGE 
%     [trans,jd]=get_trans(cdf,start,stop);
%     or
%     [trans,jd]=get_trans(cdf);
% 
%  where: cdf = string containing the name of the cdf file, or a 
%               string array containing the names of multiple cdf files, i.e.
%               cdf=['cdf_file1.cdf'
%                    'cdf_file2.cdf'
%                    'junk.cdf     '];
%         start = [yyyy mm dd hh mi sc];
%         stop  = [yyyy mm dd hh mi sc];
%
%    if start and stop are missing, then the series overlapping in time are 
%     returned.  U and V must be var1 and var2 in cdf file.
%
%         jd = julian day 
%
var1='attenuation';   % the u component of velocity
%
[m,n]=size(cdf);
if nargin==1,
  if m==1,
    [start,stop]=mcgtim(cdf);    %get whole file if only 1 cdf file
  else
    [start,stop]=overlap(cdf);   %for multiple files, get overlapping data
  end
end
jd0=julian(start); 
jd1=julian(stop);
[icyc,ncyc,jd]=mctime(cdf(1,:),start,stop);
delt=jd(2)-jd(1);
nt=round((jd1-jd0)/delt)+1     % how long is the output series?
jda=[jd0:delt:jd1];
trans=ones(nt,m)*NaN;
for i=1:m
  cdfi=cdf(i,:);
  [icyc,ncyc,jd]=mctime(cdfi,start,stop);
  transmission=mcvgt(cdfi,var1,icyc,ncyc);
  if(nargin==3),
    ind=round((jd-jd0)/delt)+1;
    trans(ind,i)=transmission;
    jd=jda;
  else
    trans(:,i)=transmission;
  end
end
