Commits

Sam Skillman  committed 14108c8

Another go, but having issues with frames past 32

  • Participants
  • Parent commits 9f7cefe

Comments (0)

Files changed (1)

File zoom_popiii.py

 L = [ 0.38855402,  0.23911532, -0.88985934]
 
 def get_tf(offset):
-    tmi, tma = min_v - 1.0, v + 1.0
+    tmi, tma = min_v - 2.0, v + 2.0
     tf = ColorTransferFunction((tmi, tma), nbins=1024)
     alphas = 0.01
     for i,alpha in zip(range(-25, -10), na.logspace(-1.,0.5, 15)):
-        tf.sample_colormap(i - offset, 0.01, alpha, "kamae")
+        tf.sample_colormap(i - offset, 0.01, alpha, "kamae", col_bounds=(min_v,v))
+    tf.map_to_colormap(v-0.1, v+0.1, colormap="seismic", scale=3.0, scale_func = None)
     return tf
 
 tf = get_tf(0.0)
 
-v = -10.0
-tf.map_to_colormap(v - 0.1, v+0.1, colormap="seismic", scale=3.0, scale_func = None)
 tf.plot('tf.png')
 
 Npix = 512
 Nframes = 40
-cam = pf.h.camera(c, L, initial_width, (Npix,Npix), tf, no_ghost=True, use_light = False)
+cam = pf.h.camera(c, L, initial_width, (Npix,Npix), tf, no_ghost=False, use_light = False)
+
+try:
+    cam.volume.load_kd_bricks()
+except:
+    pass
+
+#cam.snapshot()
+#cam.volume.store_kd_bricks()
+#balls
 
 # This is super cheesy, but I am not sure how to wrap this all in parallel
 # objects.
 
 f = (initial_width/final_width)**(1.0/Nframes)
 for i in xrange(Nframes):
-    try:
-        # Now we apply an offset so that it looks a bit like it's moving
-        cam.zoom(f)
-        if i < (35): continue
-        if i not in mine: continue
-        cam.transfer_function = get_tf(float(i) / Nframes)
-        snapshot = cam.snapshot()
-        write_bitmap(snapshot, "frames/zoom_%04i.png" % i)
-    except:
-        pass
+    # Now we apply an offset so that it looks a bit like it's moving
+    cam.zoom(f)
+    if i < 32: continue
+    if i not in mine: continue
+    cam.transfer_function = get_tf(float(i) / Nframes)
+    snapshot = cam.snapshot()
+    write_bitmap(snapshot, "frames/zoom_%04i.png" % i)
+
+