Home > constants > calcFlux.m

calcFlux

PURPOSE ^

SYNOPSIS ^

function [Flux, FluxErr] = calcFlux(source, year)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Flux, FluxErr] = calcFlux(source, year)
0002 
0003 fbandpass = '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, year);
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         Err = TotCasErr;
0018     case 'CygA'
0019         Ssrc = CygSNow;
0020         Err = TotCygErr;
0021     case 'TauA'
0022         Ssrc = TauSNow;
0023         Err = TotTauErr;
0024 end
0025 
0026 % Method 2:
0027 % or do a gain-weighted average:
0028 Flux = sum(Ssrc.*gI1)/sum(gI1);
0029 FluxErr = sum(Err.*gI1)/sum(gI1);
0030 
0031 
0032 end

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