Home > loadamplitude > getLoadAmplitudePipeline.m

getLoadAmplitudePipeline

PURPOSE ^

SYNOPSIS ^

function [mjd, ch1mag, ch2mag, ch3mag, ch4mag, ch5mag, ch6mag, ch7mag, ch8mag] = getLoadAmplitudePipeline(d,load, debug, location)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [mjd, ch1mag, ch2mag, ch3mag, ch4mag, ch5mag, ch6mag, ch7mag, ch8mag] = getLoadAmplitudePipeline(d,load, debug, location)
0002 
0003 if (load==0)
0004     dataset = reduceData(d, 'loadamplitude/redScript_noload.red', 0, 'testtest')
0005 elseif (load == 1)
0006     dataset = reduceData(d, 'loadamplitude/redScript_withload.red', 0, 'testtest')
0007 else
0008     dataset = reduceData(d, 'redScript_withloadcor.red', 0, 'testtest')
0009 end
0010 
0011 % Select survey data based on the feature flag
0012 disp('Framecut')
0013 dataset = framecut(dataset, bitsearch(dataset.array.frame.features, 0, 'any'));
0014 
0015 mjd = median(dataset.antenna0.receiver.utc);
0016 data = dataset.antenna0.receiver.data;
0017 % 8 data channels
0018 ch1 = data(:,1);
0019 ch2 = data(:,2);
0020 ch3 = data(:,3);
0021 ch4 = data(:,4);
0022 ch5 = data(:,5);
0023 ch6 = data(:,6);
0024 ch7 = data(:,7);
0025 ch8 = data(:,8);
0026 
0027 % Get rid of everything that has a signal in it (over 150% of the mode)
0028 %m1 = mode(ch1);
0029 %ind = abs(ch1 - m1) > 0.2;
0030 %ch1(ind) = 0;
0031 %ch2(ind) = 0;
0032 %ch3(ind) = 0;
0033 %ch4(ind) = 0;
0034 %ch5(ind) = 0;
0035 %ch6(ind) = 0;
0036 %ch7(ind) = 0;
0037 %ch8(ind) = 0;
0038 
0039 % FFT the data
0040 disp('FFT')
0041 
0042 [f1 Y1] = psmej(ch1, 0);
0043 [f2 Y2] = psmej(ch2, 0);
0044 [f3 Y3] = psmej(ch3, 0);
0045 [f4 Y4] = psmej(ch4, 0);
0046 [f5 Y5] = psmej(ch5, 0);
0047 [f6 Y6] = psmej(ch6, 0);
0048 [f7 Y7] = psmej(ch7, 0);
0049 [f8 Y8] = psmej(ch8, 0);
0050 
0051 if (debug==1)
0052 figure(1)
0053 plot()
0054 figure(2)
0055 keyboard
0056 end
0057 
0058 % Select data at the relevant frequencies (1.2Hz and harmonics, and 1.5Hz for background)
0059 disp('Range')
0060 range1 = find(f1 > 1.198 & f1 < 1.202);
0061 range2 = find(f1 > 2.398 & f1 < 2.402);
0062 range3 = find(f1 > 3.598 & f1 < 3.602);
0063 range4 = find(f1 > 1.498 & f1 < 1.502);
0064 range5 = find(f1 > 10.0 & f1 < 30.0);
0065 %range = [range1, range2, range3, range4];
0066 
0067 ch1mag = [max(Y1(range1)),max(Y1(range2)),max(Y1(range3)),mean(Y1(range4)),mean(Y1(range5))];
0068 ch2mag = [max(Y2(range1)),max(Y2(range2)),max(Y2(range3)),mean(Y2(range4)),mean(Y2(range5))];
0069 ch3mag = [max(Y3(range1)),max(Y3(range2)),max(Y3(range3)),mean(Y3(range4)),mean(Y3(range5))];
0070 ch4mag = [max(Y4(range1)),max(Y4(range2)),max(Y4(range3)),mean(Y4(range4)),mean(Y4(range5))];
0071 ch5mag = [max(Y5(range1)),max(Y5(range2)),max(Y5(range3)),mean(Y5(range4)),mean(Y5(range5))];
0072 ch6mag = [max(Y6(range1)),max(Y6(range2)),max(Y6(range3)),mean(Y6(range4)),mean(Y6(range5))];
0073 ch7mag = [max(Y7(range1)),max(Y7(range2)),max(Y7(range3)),mean(Y7(range4)),mean(Y7(range5))];
0074 ch8mag = [max(Y8(range1)),max(Y8(range2)),max(Y8(range3)),mean(Y8(range4)),mean(Y8(range5))];
0075 
0076 h = figure; 
0077 plot(ch1)
0078 print(h, '-dps', [location, '/plots/ch1_', num2str(mjd), '_', num2str(load), '.ps'])
0079 loglog(f1,sqrt(Y1)*1e3)
0080 hold on
0081 plot(f1,sqrt(max(Y1(range1)))*1e3*ones(size(f1)))
0082 plot(f1,sqrt(max(Y1(range2)))*1e3*ones(size(f1)))
0083 plot(f1,sqrt(max(Y1(range3)))*1e3*ones(size(f1)))
0084 plot(f1,sqrt(mean(Y1(range4)))*1e3*ones(size(f1)))
0085 plot(f1,sqrt(mean(Y1(range5)))*1e3*ones(size(f1)))
0086 print(h, '-dps', [location, '/plots/ch1_', num2str(mjd), '_', num2str(load), '_fft.ps'])
0087 hold off
0088 
0089 h = figure; 
0090 plot(ch2)
0091 print(h, '-dps', [location, '/plots/ch2_', num2str(mjd), '_', num2str(load), '.ps'])
0092 loglog(f2,sqrt(Y2)*1e3)
0093 hold on
0094 plot(f2,sqrt(max(Y2(range1)))*1e3*ones(size(f2)))
0095 plot(f2,sqrt(max(Y2(range2)))*1e3*ones(size(f2)))
0096 plot(f2,sqrt(max(Y2(range3)))*1e3*ones(size(f2)))
0097 plot(f2,sqrt(mean(Y2(range4)))*1e3*ones(size(f2)))
0098 plot(f2,sqrt(mean(Y2(range5)))*1e3*ones(size(f2)))
0099 print(h, '-dps', [location, '/plots/ch2_', num2str(mjd), '_', num2str(load), '_fft.ps'])
0100 hold off
0101 
0102 h = figure; 
0103 plot(ch3)
0104 print(h, '-dps', [location, '/plots/ch3_', num2str(mjd), '_', num2str(load), '.ps'])
0105 loglog(f3,sqrt(Y3)*1e3)
0106 hold on
0107 plot(f3,sqrt(max(Y3(range1)))*1e3*ones(size(f2)))
0108 plot(f3,sqrt(max(Y3(range2)))*1e3*ones(size(f2)))
0109 plot(f3,sqrt(max(Y3(range3)))*1e3*ones(size(f2)))
0110 plot(f3,sqrt(mean(Y3(range4)))*1e3*ones(size(f2)))
0111 plot(f3,sqrt(mean(Y3(range5)))*1e3*ones(size(f2)))
0112 print(h, '-dps', [location, '/plots/ch3_', num2str(mjd), '_', num2str(load), '_fft.ps'])
0113 hold off
0114 
0115 
0116 %keyboard
0117 
0118 
0119 
0120 end

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