Pastebin

Paste #4618: camera traceback

< previous paste - next paste>

Pasted by yurlungur

Download View as text

# Choose a field
field = 'ADMBASE::alp'
# Do you want the log of the field?
use_log = False
dd = ds.all_data()
mi, ma = dd.quantities.extrema(field)
if use_log:
    mi,ma = np.log10(mi), np.log10(ma)
# Instantiate the ColorTransferfunction.
tf = yt.ColorTransferFunction((mi, ma))

# Set up the camera parameters: center, looking direction, width, resolution
c = (ds.domain_right_edge + ds.domain_left_edge)/2.0
L = np.array([1.0, 1.0, 1.0])
W = ds.quan(240, 'code_length')
N = 256
print mi,ma

cam = ds.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])
im = cam.snapshot()
cam.draw_grids(im)
cam.show()

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-38-28a54acbf382> in <module>()
      4 #tf.add_layers(10, 0.01, colormap = 'RdBu_r')
      5 
----> 6 cam = ds.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])
      7 im = cam.snapshot()
      8 cam.draw_grids(im)

AttributeError: 'SimulationIODataset' object has no attribute 'camera'

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.