Blame view

temp2allan.m 1.1 KB
8367d5958   bmarechal   add great script
1
2
3
4
5
  #!/usr/bin/octave-cli
  
  filename = argv(){1};
  col = eval(argv(){2});
  mult = eval(argv(){3});
505d9a514   bmarechal   add compatibility...
6
7
8
9
  filename = argv(){1};
  col = eval(argv(){2});
  mult = eval(argv(){3});
  ad_opt = eval(argv(){4});
8367d5958   bmarechal   add great script
10

505d9a514   bmarechal   add compatibility...
11
12
13
  if length(col) == length(mult)
  	for i = [1:length(col)]
  		data.freq = load(filename)(:,col(i)).*mult(i);
88a86ac73   bmarechal   ...
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  		if ad_opt(i) == 1
  			printf(strcat(filename, ' col', num2str(col(i)), ' drift removed
  
  '))
  			data.freq = detrend(data.freq);
  		elseif ad_opt(i) == 2
  			printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '
  
  '))
  			data.freq = data.freq./mean(data.freq);
  		elseif ad_opt(i) == 3
  			printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad
  
  '))
  			data.freq = detrend(data.freq./mean(data.freq));
  		end
505d9a514   bmarechal   add compatibility...
30
31
32
33
34
35
36
37
  		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);
  		ad_tosave{i} = vertcat(ad, err)';
  	end
  tosave = tau';
  for i = [1:length(col)]
  	tosave = horzcat(tosave, ad_tosave{i});
  end
8367d5958   bmarechal   add great script
38
  save('-ascii', strcat(strsplit(filename, '.'){1}, '_ad.dat'), 'tosave');
505d9a514   bmarechal   add compatibility...
39
  end