Home > reduc > rfi > readRFIParameters.m

readRFIParameters

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function rfiParameters = readRFIParameters(dataMJD, alphatype, aggressiveLevel)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 function [] = readRFIParameters()


   I/O:

   MAS -- 10-Sep-2012

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function rfiParameters = readRFIParameters(dataMJD, alphatype, aggressiveLevel)
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % function [] = readRFIParameters()
0005 %
0006 %
0007 %   I/O:
0008 %
0009 %   MAS -- 10-Sep-2012
0010 %
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 
0013 fprintf('\nReading in the RFI parameter database...\n');
0014 
0015 [home,installeddir] = where_am_i();
0016 
0017 parameterDatabase = [home '/' installeddir '/constants/rfiParameterDatabase.txt'];
0018 
0019 
0020 % This has to be {1, 2, 3, 4, 5}
0021 aggressiveLevel = max(1,min(5,round(aggressiveLevel)));
0022 
0023 
0024 % Read it in.
0025 c = importdata(parameterDatabase,' ');
0026 
0027 
0028 % First isolate those rows with the correct MJD:
0029 mjdDist = min(abs(c(:,1) - dataMJD));
0030 mjdMatch = abs(c(:,1) - dataMJD) == mjdDist;
0031 
0032 % Then those with the correct alpha type:
0033 if alphatype == 0
0034     alphaMatch = c(:,2) == 0;
0035 else
0036     alphaMatch = c(:,2) > 0;
0037 end
0038 
0039 % Then those with the correct aggressive level:
0040 aggressiveMatch = c(:,3) == aggressiveLevel;
0041 
0042 
0043 disp(['readRFIParameters:: Suitable parameter set found ' num2str(mjdDist) ' days away.']);
0044 
0045 rfiParameters = c(mjdMatch & alphaMatch & aggressiveMatch,4:end);
0046 
0047 end

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