Changeset 374 for mystic/scripts
- Timestamp:
- 08/04/10 17:47:48 (6 years ago)
- Location:
- mystic/scripts
- Files:
-
- 2 added
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
mystic/scripts/mystic_log_reader.py
r372 r374 1 #!/usr/bin/env python 2 __doc__ = """ 3 plot parameter convergence from file written with 'LoggingSow' 4 5 Usage: python log_reader.py [filename] [maxiter] 6 [filename] - name of the convergence logfile (e.g log.txt) 7 [maxiter] - the largest iteration to plot (from 1 to maxiter) [optional] 8 """ 1 9 import sys 10 if '--help' in sys.argv: 11 print __doc__ 12 sys.exit(0) 13 2 14 if '--dots' in sys.argv: 3 15 mark = 'o' … … 6 18 mark = '' 7 19 8 try: 20 try: # get logfile name 9 21 filename = sys.argv[1] 10 22 except: 11 23 filename = 'log.txt' 24 25 try: # select which iteration to stop plotting at 26 stop = int(sys.argv[2]) 27 except: 28 stop = None 12 29 13 30 f = open(filename,"r") … … 44 61 cost.append(eval(values[1])) 45 62 param.append(eval(values[2])) 63 64 # ignore everything after 'stop' 65 step = step[:stop] 66 cost = cost[:stop] 67 param = param[:stop] 46 68 47 69 # split (i,id) into iteration and id
Note: See TracChangeset
for help on using the changeset viewer.