Home > cbassSouthFunctions > ACTFunctions > determineIndicesSouth_ACT.m

determineIndicesSouth_ACT

PURPOSE ^

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

SYNOPSIS ^

function d = determineIndicesSouth(d)

DESCRIPTION ^

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

  function d = determineIndices(d)

   creates the index array with the different observation types from
   schedlib.sch, namely:
     noise
     skydip
     source
     calibrator

  this is a support function, just to make it easier to cut sources.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Edit 1: ogk
 features vector had 1 too few elements in it; was missing the f10 value
 Edit 2: ogk
 undid previous edit
 ACT 21/10/2010  --> added f1 which is used in source_scans.sch to mark
 elevation scans
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = determineIndicesSouth(d)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function d = determineIndices(d)
0006 %
0007 %   creates the index array with the different observation types from
0008 %   schedlib.sch, namely:
0009 %     noise
0010 %     skydip
0011 %     source
0012 %     calibrator
0013 %
0014 %  this is a support function, just to make it easier to cut sources.
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 % Edit 1: ogk
0018 % features vector had 1 too few elements in it; was missing the f10 value
0019 % Edit 2: ogk
0020 % undid previous edit
0021 % ACT 21/10/2010  --> added f1 which is used in source_scans.sch to mark
0022 % elevation scans
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0025 
0026 % from schedlib.
0027 % feat  f0 = analyze this data
0028 % feat  f1 = elevation scan
0029 % feat  f2 = calibration source
0030 % feat  f3 = absolute calibrator source
0031 % feat  f4 = blank sky
0032 % feat  f5 = sky dip
0033 % feat  f6 = radio pointing cross
0034 % feat  f7 = radio pointing scan  (two scans)
0035 % feat  f8 = optical pointing
0036 % feat  f9 = beam map
0037 % feat  f10 = noise injection on
0038 % feat  f11 = noise injection off
0039 % feat  f16 = ncp scans
0040 % feat  f32 = transition
0041 
0042 %%%%%%%%%%%%%%%
0043 % ogk edit 1:
0044 %   ogk: edit 2: undid previous change!
0045 %  sjcm (3/23/2011) -- backward compatability with pointing for data before
0046 %  Oct 2010
0047 
0048 % these should be hardcoded in their own file
0049 featureFields; % loads the variables features and fieldNames
0050 
0051 for m=1:length(features)
0052 
0053   if(features(m)==32)
0054     % transition feature
0055     indSlow = d.array.frame.features==0;
0056   else
0057     indSlow = bitand(d.array.frame.features, 2^features(m)) > 0;
0058   end
0059   
0060   indMed = repmat(indSlow, [1 5]);
0061   indMed = indMed';
0062   indMed = indMed(:);
0063   
0064   indFast = repmat(indSlow, [1 100]);
0065   indFast = indFast';
0066   indFast = indFast(:);
0067   
0068   eval(sprintf('d.index.%s.slow = indSlow;', fieldNames{m}));
0069   eval(sprintf('d.index.%s.medium = indMed;', fieldNames{m}));
0070   eval(sprintf('d.index.%s.fast = indFast;', fieldNames{m}));
0071 
0072 end
0073 
0074 % for the noise source events, we look for where both features 10&11 are set
0075 indSlow = bitand(d.array.frame.features, 2^10) > 0 | bitand(d.array.frame.features, 2^11) > 0;
0076 indMed = repmat(indSlow, [1 5]);
0077 indMed = indMed';
0078 indMed = indMed(:);
0079 indFast = repmat(indSlow, [1 100]);
0080 indFast = indFast';
0081 indFast = indFast(:);
0082 d.index.noise_event.slow = indSlow;
0083 d.index.noise_event.medium = indMed;
0084 d.index.noise_event.fast = indFast;
0085 
0086 
0087 % for the noise, we figure it out from the backend data.
0088 indFast = bitsearch(d.antenna0.roach1.switchstatus, 2, 'any');
0089 
0090 indSlow  = reshape(indFast, [100, length(indFast)/100]);
0091 indSlow  = mean(indSlow)>0.5;
0092 indSlow  = indSlow';
0093 
0094 indMed  = reshape(indFast, [20, length(indFast)/20]);
0095 indMed  = mean(indMed)>0.5;
0096 indMed  = indMed';
0097 
0098 %d.index.noise.slow   = indSlow;
0099 %d.index.noise.medium = indMed;
0100 %d.index.noise.fast   = indFast;
0101 
0102 
0103 %m = length(features); % MAS: This tripped me up!  In featureFields.m, we
0104 %                      % can't define any fields after the noise one!
0105 m = strcmpi(fieldNames,'noise');
0106 if sum(m) > 1
0107     [a, I] = sort(foo,'descend');
0108 
0109     eval(sprintf('d.index.%s.slow = indSlow;', fieldNames{I(1)}));
0110     eval(sprintf('d.index.%s.medium = indMed;', fieldNames{I(1)}));
0111     eval(sprintf('d.index.%s.fast = indFast;', fieldNames{I(1)}));
0112 else
0113     eval(sprintf('d.index.%s.slow = indSlow;', fieldNames{m}));
0114     eval(sprintf('d.index.%s.medium = indMed;', fieldNames{m}));
0115     eval(sprintf('d.index.%s.fast = indFast;', fieldNames{m}));
0116 end
0117 
0118 % before October 2010, the radio_point_cross in the schedules had the same
0119 % feature number as radio_point_scan.
0120 if(d.array.frame.utc(1) < date2mjd(2010, 10, 1, 0,0,0))
0121   dd = d;
0122   dd.index.radio_point_cross = d.index.radio_point_scan;
0123   dd.index.radio_point_scan  = d.index.radio_point_cross;
0124   d = dd;
0125 end
0126 
0127 return;
0128 
0129

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