Commits

Anonymous committed 5a0a7b8

separate draw and run functions

  • Participants
  • Parent commits ed351a6

Comments (0)

Files changed (1)

File scripts/vis.py

     return collect(parse_input(filename), True)
 
 def run(filename, outfile):
-    W, H, HA, HB = 1600, 256, 64, 64
-    HZ = H + 4 + HA + 4 + HB
-    im = Image.new('RGBA', (W, HZ + 20))
-    d = ImageDraw.Draw(im)
-
     hist = parse(filename)
 
     t0 = hist.timeline[0].t
     for x in hist.timeline:
         ts.append((x.s0, x.t-t0))
 
+    draw(ts, outfile)
+
+def draw(ts, outfile):
+    W, H, HA, HB = 1600, 256, 64, 64
+    HZ = H + 4 + HA + 4 + HB
+    im = Image.new('RGBA', (W, HZ + 20))
+    d = ImageDraw.Draw(im)
+
     # Filter
     if 0:
         a, b = 10*2.2e9, 12*2.2e9