function phase_cal = read_calibration_phase(filename)
% READ_CALIBRATION_PHASE  returns antenna phase calibrations from 
% calibration text file
%   filename:   name of the calibration text file
    fid = fopen(filename);
	g = textscan(fid,'%s','delimiter','\n');
    u = g{1}{1};
    format = ~(contains(u,':'));
	if format == 1
        fclose(fid);
        fid = fopen(filename);
		file = textscan(fid,'%f %f');
		phases = file{2}*pi/180;
        fclose(fid);
    else
        u = u(12:end);
		C = textscan(u,'%f');
		phases = C{1}*pi/180;
	end	
	phase_cal = exp(1i*phases);
end

