Home > constants > calculate_calibrator_TA_and_S.m

calculate_calibrator_TA_and_S

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear all
0002 
0003 fbandpass = '/Users/oliver/C-BASS/PassbandMeasurements/20120403/20120403_v14_Passband.csv';
0004 
0005 dp = importdata(fbandpass,',',1);
0006 f = dp.data(:,1); % in GHz
0007 gI1 = -dp.data(:,2);
0008 
0009 % get the current flux density
0010 [CasSNow, TotCasErr, CygSNow, TotCygErr, TauSNow, TotTauErr] = CalibFluxDen(f, 2012.5);
0011 
0012 % Spectral shape from Baars et al 1977, no secular evolution
0013 switch source
0014     case 'CasA'
0015         % source flux density is:
0016         Ssrc = CasSNow;
0017     case 'CygA'
0018         Ssrc = CygSNow;
0019     case 'TauA'
0020         Ssrc = TauSNow;
0021 end
0022 
0023 % aperture efficiency is:
0024 nA = 0.55;
0025 kB = 1.38e-23; 
0026 D = 6.1;
0027 
0028 % antenna temperature is:
0029 Ta = Ssrc.*nA*pi*(D/2)^2/(2*kB*1e26);
0030 
0031 % % bandwidth and center frequency are:
0032 BW = (max(f)-min(f))/length(f)*(sum(gI1))^2/(sum(gI1.^2));
0033 fc = sum(f.*gI1)/(sum(gI1));
0034 
0035 % % Method 1:
0036 % % measured antenna temperature is average of the rectangular band at fc of
0037 % % width BW.
0038 % Isel = f>=(fc-BW/2) & f<=(fc+BW/2);
0039 % Tmeas = mean(Ta(Isel));
0040 
0041 % Method 2:
0042 % or do a gain-weighted average:
0043 Tmeas2 = sum(Ta.*gI1)/sum(gI1);
0044 
0045 figure
0046 plot(f,Ta,'k-',... [min(f) max(f)], [Tmeas Tmeas],'r-',...
0047     [min(f) max(f)], [Tmeas2 Tmeas2],'b-',...
0048     [fc-BW/2 fc-BW/2],[min(Ta) max(Ta)],'k--',[fc+BW/2 fc+BW/2],[min(Ta) max(Ta)],'k--')
0049 xlabel('Frequency [GHz]')
0050 ylabel('Antenna Temperature [K]')
0051 ylim([min(Ta) max(Ta)])
0052 xlim([min(f) max(f)])
0053 title([source sprintf(' antenna temp = %3.2f K',Tmeas2)])
0054 legend('Input','Gain-weighted average','Equivalent Band')

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005