diff options
| author | Mac Mollison <mollison@cs.unc.edu> | 2010-03-14 03:17:40 -0400 |
|---|---|---|
| committer | Mac Mollison <mollison@cs.unc.edu> | 2010-03-14 03:17:40 -0400 |
| commit | 361d978921690a7c26a63b933b502d5d2fc3e3d5 (patch) | |
| tree | 851173b45f26ee94a10065e2efeac3ca0d7bcde7 /scripts/visualize.py | |
| parent | 17977f3e1a454efe197650b34365af15a63f4afe (diff) | |
Refactor to get rid of various frontend scripts
Now, unit-trace.py can control all functionality.
Diffstat (limited to 'scripts/visualize.py')
| -rwxr-xr-x | scripts/visualize.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/scripts/visualize.py b/scripts/visualize.py deleted file mode 100755 index 2899b43..0000000 --- a/scripts/visualize.py +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | #!/usr/bin/python | ||
| 2 | |||
| 3 | ################################################################################ | ||
| 4 | # Description | ||
| 5 | ################################################################################ | ||
| 6 | # This scriipt demonstrates the visualizer submodule. | ||
| 7 | |||
| 8 | # This script should be invoked with the names of the trace files you want to | ||
| 9 | # use. For example, `gedf_test.py ../sample_traces/*.bin`. | ||
| 10 | # You probably want to redirect the (normally lengthy) output to a file! | ||
| 11 | # Otherwise, speed is greatly decreased b/c terminal printing is slow. | ||
| 12 | |||
| 13 | ################################################################################ | ||
| 14 | # Setup | ||
| 15 | ################################################################################ | ||
| 16 | |||
| 17 | # Import the modules we need. You should not need to know about | ||
| 18 | # their internals. | ||
| 19 | import unit_trace | ||
| 20 | from unit_trace import trace_reader | ||
| 21 | from unit_trace import sanitizer | ||
| 22 | from unit_trace import gedf_test | ||
| 23 | from unit_trace import stats | ||
| 24 | from unit_trace import stdout_printer | ||
| 25 | from unit_trace import visualizer | ||
| 26 | |||
| 27 | # Get trace files from command line arguments | ||
| 28 | from optparse import OptionParser | ||
| 29 | usage = "usage: %prog <one or more trace files>" | ||
| 30 | parser = OptionParser(usage=usage) | ||
| 31 | (options, traces) = parser.parse_args() | ||
| 32 | traces = list(traces) | ||
| 33 | if len(traces) < 1: | ||
| 34 | parser.print_help() | ||
| 35 | exit() | ||
| 36 | |||
| 37 | ################################################################################ | ||
| 38 | # Pipeline | ||
| 39 | ################################################################################ | ||
| 40 | |||
| 41 | # Read events from traces | ||
| 42 | stream = trace_reader.trace_reader(traces) | ||
| 43 | |||
| 44 | # Filter out garbage events | ||
| 45 | stream = sanitizer.sanitizer(stream) | ||
| 46 | |||
| 47 | # Note: You could include other submodules, to further modify | ||
| 48 | # the event stream (e.g. produce G-EDF error records that could be | ||
| 49 | # drawn by the visuazlier in future versions). | ||
| 50 | |||
| 51 | # Print the records to stdout | ||
| 52 | visualizer.visualizer(stream) | ||
