0001 function d = loadWrapper(d, plotparams, parm, field)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 [d,q] = logcal(d, 'alpha');
0017 if (~q)
0018 disp('Alpha correction not yet applied. You need to do that first.');
0019 disp(' ')
0020
0021 return
0022 end
0023 [d,q] = logcal(d, 'load');
0024 if (q)
0025 disp('Load correction has been applied');
0026 disp(' ')
0027
0028 return
0029 end
0030
0031
0032
0033
0034
0035 parFlag = checkpar(parm, 'alpha');
0036 if(parFlag)
0037 alphaType = parm.alpha.type;
0038
0039
0040
0041
0042 else
0043
0044 if(plotparams.interactive==1)
0045 display('You are running in interactive mode');
0046 alphaType = 4;
0047 while(alphaType<0 || alphaType>3)
0048 alphaType = input('What type of correction do you want? [0-FILTERED, 1-CLASSIC, 2-POLONLY] ');
0049 if alphaType == 0 && size(d.antenna0.receiver.data,2) ~= 8
0050 display('Wait... your data are not filtered-mode, alpha-corrected.');
0051 alphaType = 4;
0052 elseif alphaType == 1 && size(d.antenna0.receiver.data,2) ~= 10
0053 display('Wait... your data are not classic-mode, alpha-corrected.');
0054 alphaType = 4;
0055 elseif alphaType == 2 && size(d.antenna0.receiver.data,2) ~= 8
0056 display('Wait... your data are not polonly-mode, alpha-corrected.');
0057 alphaType = 4;
0058 end
0059 end
0060 else
0061 display('No correction type specified, defaulting to classic data.');
0062 alphaType = 1;
0063 if size(d.antenna0.receiver.data,2) ~= 10
0064 display('Wait... your data are not classic-mode, alpha-corrected.');
0065 return;
0066 end
0067 end
0068 end
0069
0070
0071
0072
0073 parFlag = checkpar(parm, 'load');
0074 if(parFlag)
0075 scaleType = [parm.load.scaleType];
0076 else
0077 display('No load scaling chosen. Default to direct fit.');
0078 scaleType = 0;
0079 end
0080
0081
0082
0083 if scaleType ~= 0
0084
0085 disp('Alternative load scaling methods will probably not be implemented. Unless you (yes YOU!) can prove that they would actually work...');
0086 scaleType = 0;
0087 end
0088
0089
0090
0091 dorig = d;
0092
0093
0094 d = load_template_corr(d,alphaType,scaleType);
0095
0096
0097
0098 setPlotDisplay(plotparams.plot);
0099 display('Plotting Power Spectrum');
0100 display('No flagging will be allowed');
0101
0102 d = packd(d, [], 'none', 'load_cal', plotparams, 'Load Plots', field, dorig);
0103
0104
0105 d = logcal(d, 'load');
0106
0107
0108 return;
0109
0110
0111 function d=checkstatus(d)
0112
0113 disp('Would you like to view the plots?')
0114
0115 if (query)
0116 d = packd(d, [], 'none', 'load', 0, 'Load Plots', '');
0117 end
0118
0119 disp(' ')
0120
0121