function [copolr,crossr,depol,height,alt,timemx]=lidarload(filename)


time=nc_varget(filename,'Time');
time=double(time);
%timer=double(time)./(86400) + today;

copol=nc_varget(filename,'CopolPower');
copol=double(copol);
copol(1:13,:)=[]; %negative range gates
copol(copol<0)=0;
[x,y]=size(copol);
cross=nc_varget(filename,'CrossPower');
cross=double(cross);
cross(1:13,:)=[]; %negative range gates
cross(cross<0)=0;
range=nc_varget(filename,'Range');
range=double(range);
range(1:13)=[];
alt=nc_varget(filename,'Galt');
altmat=repmat(permute(alt,[2 1]),x,1);
rangemat=repmat(range,1,y);
height=rangemat+altmat;
timemx=repmat(permute(time,[2 1]),x,1);
rsqr=rangemat.^2;
base=ones(size(rangemat)).*(1000.^2);
rcr=10.*log10(rsqr./base);
copol=10.*log10(copol);
copolr=copol+rcr;
cross=10.*log10(cross);
crossr=cross+rcr;

depol=crossr./copolr;
depol(isinf(depol))=0;