0001 function d = webpipeline_1(d, root_name)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 diary([root_name,'.log'])
0018
0019 disp('Starting the data reduction')
0020
0021
0022
0023 disp('Removing 40Hz mains harmonic')
0024 d = mainsWrapper(d,0,0);
0025
0026
0027 disp('Doing a 5-sigma cut on mean of smoothed raw data channels')
0028 sigma = 5;
0029 d = first_cut(d,sigma);
0030
0031
0032
0033
0034
0035 disp('Applying the alpha and r-factor corrections')
0036
0037 try
0038 [t,A,G,T,horiz,equa, offStartPos, onEndPos, offEndPos, onStartPos] = calculateAlpha(d);
0039 catch
0040 disp('(Failed to calculate Alphas')
0041 end
0042
0043
0044 try
0045 d = applyAlpha2(d,t,A,G);
0046 catch
0047 disp('Failed to apply the alpha corrections')
0048 end
0049
0050
0051 try
0052 thisAlpha = [t A G T horiz equa];
0053 d.correction.alpha.indices = [offStartPos' onEndPos' offEndPos' onStartPos'];
0054 d.correction.alpha.values = thisAlpha;
0055 catch
0056 disp('Failed to pre-process data ready for r-factors')
0057 end
0058
0059
0060 try
0061 r = calculateRfactor(d);
0062 meanr = mean(r)
0063 catch
0064 disp('Failted to calculate r-factors')
0065 end
0066
0067
0068
0069 try
0070 smoothLength = 1
0071 rval = [1.9,1.8,1.8,1.7];
0072 d = calculateStokes2_samer(d,r,smoothLength,rval);
0073 catch
0074 disp('Failed to apply r-factors')
0075 end
0076
0077
0078 stare_stats_filename=strcat(root,'_stare_stats.dat');
0079 scan_stats_filename=strcat(root,'_scan_stats.dat');
0080 makeWebpageSpectra(d,stare_stats_filename,scan_stats_filename,root_name);
0081
0082
0083
0084 disp('Making spectrograms of data');
0085 makeWebpageSpectrogram(d,0,root_name)
0086
0087
0088
0089 disp('Plotting source data to file');
0090 d = applyFlags(d)
0091 [sources] = plot_sourcesAll(d,1,root_name);
0092
0093
0094 diary('off')
0095
0096 return