''' Example how to interpret raw data and how to histogram the hits.
'''

import tables as tb
import sys

from pyBAR_mimosa26_interpreter import data_interpreter

# Example 1: How to use the build_hits function directly
#with tb.open_file('example_data_2.h5', 'r') as in_file_h5:
#    raw_data = in_file_h5.root.raw_data.read(8234, 8234 + 636 + 1000)
#    hits = data_interpreter.build_hits(raw_data)
fname=sys.argv[1]
print fname
# Example 2: How to use the interpretation class to convert a raw data tabe
with data_interpreter.DataInterpreter(raw_data_file=fname) as raw_data_analysis:
    raw_data_analysis.interpret_word_table()


@@ -70,41 +70,8 @@
 '''%0A
-%0Aimport tables as tb%0Aimport sys%0A%0A
 from
@@ -127,275 +127,29 @@
 er%0A%0A
-# Example 1: How to use the build_hits function directly%0A#with tb.open_file('example_data_2.h5', 'r') as in_file_h5:%0A#    raw_data = in_file_h5.root.raw_data.read(8234, 8234 + 636 + 1000)%0A#    hits = data_interpreter.build_hits(raw_data)%0Afname=sys.argv%5B1%5D%0Aprint fname
+%0Araw_data_file = r''%0A
 %0A# E
@@ -158,10 +158,8 @@
 mple
- 2
 : Ho
@@ -274,14 +274,8 @@
 file
-=fname
 ) as
@@ -294,16 +294,62 @@
 alysis:%0A
+    raw_data_analysis.create_hit_table = True%0A
     raw_
@@ -385,9 +385,8 @@
 table()%0A
-%0A

delete not working example