In [ ]:
import yt
In [ ]:
ds = yt.load('/home/ychen/d9/2018_production_runs/20180802_L438_rc10_beta07/data/Group_L438_hdf5_plt_cnt_0100')
In [ ]:
print(ds.parameters['run_comment'])
In [ ]:
ds.print_stats()
In [ ]:
ds.field_list
In [ ]:
ds.derived_field_list
In [ ]:
print(ds.domain_width)
In [ ]:
# in different units
print(ds.domain_width.in_units('Mpc'))
print(ds.domain_width.in_units('ly'))
print(ds.domain_width.in_units('cm'))
In [ ]:
print(ds.domain_center)
In [ ]:
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='density')
slc.show()
The box is probably too big. We should zoom in to the center.
In [ ]:
slc.zoom(32)
slc.show()
That's much better. We can see a bubble is being drilled by the jets.
We can also slice through a different axis.
In [ ]:
slc = yt.SlicePlot(ds, normal='z', fields='density')
slc.zoom(32)
slc.show()
We can also slice at a different location.
In [ ]:
slc = yt.SlicePlot(ds, normal='z', fields='density', center=([0,0,10], 'kpc'))
slc.zoom(32)
slc.show()
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='velocity_magnitude')
slc.zoom(32)
slc.show()
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='velocity_z')
slc.zoom(32)
slc.show()
See yt colormap or matplotlib colormap reference for all available colormpas.
In [ ]:
slc.set_cmap('velocity_z', 'seismic')
slc.show()
We see positive velocity_z (going toward right in this case) in red and negative (going toward left) in blue
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='velocity_z')
slc.zoom(32)
slc.set_cmap('velocity_z', 'seismic')
slc.annotate_velocity()
slc.show()
The velocity in the jet is too large compared to other region. Let's focus at some other region away from the center.
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='velocity_z', center=([0,0,10], 'kpc'), width=(10, 'kpc'))
slc.set_cmap('velocity_z', 'seismic')
slc.annotate_velocity()
slc.show()
We need to specify the range of the velocity so that the 0 velocity will be in the middle. (The velocity of the jet is 0.2c = 0.2*3E10 cm = 6E9 cm.)
In [ ]:
slc.set_zlim('velocity_z', -6E9, 6E9)
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='density', width=(40, 'kpc'))
slc.annotate_grids()
slc.show()
In this simulation, each box (which is called grid) represents 8x8x8 cells that are the most basic resolution elements.
We can zoom in to see the cells inside a grid.
In [ ]:
slc = yt.SlicePlot(ds, normal='y', fields='density', width=(1, 'kpc'), center=([0,0,10], 'kpc'))
slc.annotate_grids()
slc.show()
In [ ]:
normal='z') visualization of the magnetic fields and annotate the directions of the fields using arrows.
In [ ]: