Commit d8cd5af60b627992bf201bd16854ad24397cf8e7

Authored by bmarechal
1 parent 9706dd1541
Exists in master

-

Showing 1 changed file with 11 additions and 10 deletions Side-by-side Diff

... ... @@ -24,14 +24,14 @@
24 24 dest='filename',
25 25 default=FILENAME,
26 26 help='File(s) to import (default '+FILENAME+')')
27   -
  27 +
28 28 parser.add_argument('-c',
29 29 nargs = '+',
30 30 action='store',
31 31 dest='columns',
32 32 default=COLUMNS,
33 33 help='Columns to import (default '+str(COLUMNS)+')')
34   -
  34 +
35 35 parser.add_argument('-r',
36 36 action='store',
37 37 dest='rate',
38 38  
39 39  
40 40  
41 41  
42 42  
43 43  
44 44  
... ... @@ -61,30 +61,31 @@
61 61 filename = filename.split()
62 62 for name in filename:
63 63 list_files.extend(sorted(glob.glob(name)))
64   -
  64 +
65 65 data = []
66   -
  66 +
67 67 for f in list_files:
68 68 with open(f, 'r') as dest_f:
69 69 data_iter = csv.reader(dest_f, delimiter = '\t', quotechar = '"')
70 70 temp_data = [value for value in data_iter]
71 71 data.extend(temp_data)
72   -
  72 +
73 73 data = numpy.asarray(data, dtype = float)
74   -
  74 +
75 75 del(temp_data, list_files, value, f)
76   -
77   - g = Gnuplot.Gnuplot(persist = 1)
  76 +
  77 + g = Gnuplot.Gnuplot(persist = 1)
78 78 g('set logscale x')
79 79 g('set logscale y')
80 80 g('set grid')
  81 + g('set format y "%0.1e"')
81 82 g.xlabel('Tau (s)')
82 83 g.ylabel('Adev')
83   -
  84 +
84 85 for i in columns:
85 86 (tau2, ad, ade, adn) = allantools.adev(data[:,i], rate=rate, data_type="freq", taus='decade')
86 87 g.replot(Gnuplot.Data(tau2, ad, ade, with_='yerrorbars', title='%s : %s'%(name, str(i))))
87   -
  88 +
88 89 except Exception as ex:
89 90 print 'Oups '+str(ex)
90 91 print 'Program ending\n'