Peano
Loading...
Searching...
No Matches
inspect-statistics.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3import argparse
4import os
5
6import matplotlib.pyplot as plt
7
8
9Colours = [ "#ff0000",
10 "#00ff00",
11 "#0000ff",
12 "#ff00ff",
13 "#ffff00",
14 "#00ffff",
15 ]
16
17if __name__ == "__main__":
18 parser = argparse.ArgumentParser(description="""
19Peano 4 statistics inspection
20
21Find out which columns in a statistics file have which meaning. The resulting
22index can then be used with plot-statistics.py.
23
24""")
25 parser.add_argument("file", help="filename of examine")
26 args = parser.parse_args()
27
28 print( "Column \t| Counter" )
29 print( "--------|----------------" )
30 input_file = open( args.file, "r" )
31 for line in input_file:
32 if line.startswith( "#" ):
33 pass
34 else:
35 column_index = 0
36 for token in line.split(","):
37 if token=="t":
38 print( "{}\t| time (always used to plot)".format( column_index ) )
39 else:
40 print( "{}\t| {}".format( column_index, token ) )
41 column_index += 1
42 exit(0)
43 exit(1)