Commit e4dfaba10ffa4108247a190c6e112b3cc282e6f3
1 parent
146b73337a
Exists in
master
temp2*: clean
Showing 2 changed files with 0 additions and 8 deletions Inline Diff
temp2allan.m
#!/usr/bin/octave-cli | 1 | 1 | #!/usr/bin/octave-cli | |
2 | 2 | |||
filename = argv(){1}; | 3 | 3 | filename = argv(){1}; | |
col = eval(argv(){2}); | 4 | 4 | col = eval(argv(){2}); | |
mult = eval(argv(){3}); | 5 | 5 | mult = eval(argv(){3}); | |
6 | ||||
filename = argv(){1}; | 7 | |||
col = eval(argv(){2}); | 8 | |||
mult = eval(argv(){3}); | 9 | |||
ad_opt = eval(argv(){4}); | 10 | 6 | ad_opt = eval(argv(){4}); | |
11 | 7 | |||
if length(col) == length(mult) | 12 | 8 | if length(col) == length(mult) | |
for i = [1:length(col)] | 13 | 9 | for i = [1:length(col)] | |
data.freq = load(filename)(:,col(i)).*mult(i); | 14 | 10 | data.freq = load(filename)(:,col(i)).*mult(i); | |
if ad_opt(i) == 1 | 15 | 11 | if ad_opt(i) == 1 | |
printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | 16 | 12 | printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | |
data.freq = detrend(data.freq); | 17 | 13 | data.freq = detrend(data.freq); | |
elseif ad_opt(i) == 2 | 18 | 14 | elseif ad_opt(i) == 2 | |
printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | 19 | 15 | printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | |
data.freq = data.freq./mean(data.freq); | 20 | 16 | data.freq = data.freq./mean(data.freq); | |
elseif ad_opt(i) == 3 | 21 | 17 | elseif ad_opt(i) == 3 | |
printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | 22 | 18 | printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | |
data.freq = detrend(data.freq./mean(data.freq)); | 23 | 19 | data.freq = detrend(data.freq./mean(data.freq)); | |
end | 24 | 20 | end | |
data.rate = 1; | 25 | 21 | data.rate = 1; | |
[ad, S, err, tau] = allan(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); | 26 | 22 | [ad, S, err, tau] = allan(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); | |
ad_tosave{i} = vertcat(ad, err)'; | 27 | 23 | ad_tosave{i} = vertcat(ad, err)'; | |
end | 28 | 24 | end | |
tosave = tau'; | 29 | 25 | tosave = tau'; | |
for i = [1:length(col)] | 30 | 26 | for i = [1:length(col)] | |
tosave = horzcat(tosave, ad_tosave{i}); | 31 | 27 | tosave = horzcat(tosave, ad_tosave{i}); |
temp2oallan.m
#!/usr/bin/octave-cli | 1 | 1 | #!/usr/bin/octave-cli | |
2 | 2 | |||
filename = argv(){1}; | 3 | 3 | filename = argv(){1}; | |
col = eval(argv(){2}); | 4 | 4 | col = eval(argv(){2}); | |
mult = eval(argv(){3}); | 5 | 5 | mult = eval(argv(){3}); | |
6 | ||||
filename = argv(){1}; | 7 | |||
col = eval(argv(){2}); | 8 | |||
mult = eval(argv(){3}); | 9 | |||
ad_opt = eval(argv(){4}); | 10 | 6 | ad_opt = eval(argv(){4}); | |
11 | 7 | |||
if length(col) == length(mult) | 12 | 8 | if length(col) == length(mult) | |
for i = [1:length(col)] | 13 | 9 | for i = [1:length(col)] | |
data.freq = load(filename)(:,col(i)).*mult(i); | 14 | 10 | data.freq = load(filename)(:,col(i)).*mult(i); | |
if nargin == 4 | 15 | 11 | if nargin == 4 | |
if ad_opt(i) == 1 | 16 | 12 | if ad_opt(i) == 1 | |
printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | 17 | 13 | printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | |
data.freq = detrend(data.freq); | 18 | 14 | data.freq = detrend(data.freq); | |
elseif ad_opt(i) == 2 | 19 | 15 | elseif ad_opt(i) == 2 | |
printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | 20 | 16 | printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | |
data.freq = data.freq./mean(data.freq); | 21 | 17 | data.freq = data.freq./mean(data.freq); | |
elseif ad_opt(i) == 3 | 22 | 18 | elseif ad_opt(i) == 3 | |
printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | 23 | 19 | printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | |
data.freq = detrend(data.freq./mean(data.freq)); | 24 | 20 | data.freq = detrend(data.freq./mean(data.freq)); | |
end | 25 | 21 | end | |
endif | 26 | 22 | endif | |
data.rate = 1; | 27 | 23 | data.rate = 1; | |
[ad, S, err, tau] = allan_overlap(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); | 28 | 24 | [ad, S, err, tau] = allan_overlap(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); | |
ad_tosave{i} = vertcat(ad, err)'; | 29 | 25 | ad_tosave{i} = vertcat(ad, err)'; | |
end | 30 | 26 | end | |
tosave = tau'; | 31 | 27 | tosave = tau'; | |
for i = [1:length(col)] | 32 | 28 | for i = [1:length(col)] | |
tosave = horzcat(tosave, ad_tosave{i}); | 33 | 29 | tosave = horzcat(tosave, ad_tosave{i}); |