Load Dataset
[1]:
import opal
ds = opal.load_dataset('amr/plt0000000380/', ftype=opal.filetype.AMR)
2024-09-26 23:08:46,159 - opal - ERROR - No module named 'yt'
[2]:
print ( ds )
None
Projection Plot
[3]:
ds.projection_plot(axis='z', field='rho', unit='C/m**3', zoom=1.0, color='gray', overlay_particles=True)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 ds.projection_plot(axis='z', field='rho', unit='C/m**3', zoom=1.0, color='gray', overlay_particles=True)
AttributeError: 'NoneType' object has no attribute 'projection_plot'
[4]:
ds.slice_plot(normal='z', field='rho', unit='C/m**3', zoom=1.0, color='gray')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 ds.slice_plot(normal='z', field='rho', unit='C/m**3', zoom=1.0, color='gray')
AttributeError: 'NoneType' object has no attribute 'slice_plot'
Slice Plot
[5]:
ds.slice_plot(normal='z', field='Ex', unit='V/m', zoom=1.0, color='gray')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 ds.slice_plot(normal='z', field='Ex', unit='V/m', zoom=1.0, color='gray')
AttributeError: 'NoneType' object has no attribute 'slice_plot'
[6]:
ds.slice_plot(normal='z', field='electric_field_y', unit='V/m', zoom=1.0, color='gray')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 ds.slice_plot(normal='z', field='electric_field_y', unit='V/m', zoom=1.0, color='gray')
AttributeError: 'NoneType' object has no attribute 'slice_plot'
Line Plot
[7]:
import matplotlib.pyplot as plt
plt.figure(figsize=(15, 10))
ds.line_plot(axis='y', field='electrostatic_potential', unit='V')
plt.show()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 4
1 import matplotlib.pyplot as plt
3 plt.figure(figsize=(15, 10))
----> 4 ds.line_plot(axis='y', field='electrostatic_potential', unit='V')
6 plt.show()
AttributeError: 'NoneType' object has no attribute 'line_plot'
<Figure size 1440x960 with 0 Axes>
Particle Plot
[8]:
ds.particle_plot('particle_position_x', 'particle_magnetic_field_z', x_unit='cm')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 1
----> 1 ds.particle_plot('particle_position_x', 'particle_magnetic_field_z', x_unit='cm')
AttributeError: 'NoneType' object has no attribute 'particle_plot'
[9]:
ds.particle_plot('particle_position_x', 'particle_momentum_x',
'particle_electric_field_x', x_unit='cm',
z_unit='V/m')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[9], line 1
----> 1 ds.particle_plot('particle_position_x', 'particle_momentum_x',
2 'particle_electric_field_x', x_unit='cm',
3 z_unit='V/m')
AttributeError: 'NoneType' object has no attribute 'particle_plot'
[10]:
ds.particle_plot('particle_position_x', 'particle_electric_field_x', x_unit='cm', y_unit='V/m')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[10], line 1
----> 1 ds.particle_plot('particle_position_x', 'particle_electric_field_x', x_unit='cm', y_unit='V/m')
AttributeError: 'NoneType' object has no attribute 'particle_plot'
Overlay Particles onto Fields
[11]:
ds.projection_plot(axis='z', field='electrostatic_potential', unit='V*m',
zoom=1.0, color='gray', overlay_particles=True, method='integrate')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[11], line 1
----> 1 ds.projection_plot(axis='z', field='electrostatic_potential', unit='V*m',
2 zoom=1.0, color='gray', overlay_particles=True, method='integrate')
AttributeError: 'NoneType' object has no attribute 'projection_plot'
[12]:
ds.slice_plot(normal='y', field='electrostatic_potential', unit='V',
zoom=1.0, color='gray', overlay_particles=True)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 ds.slice_plot(normal='y', field='electrostatic_potential', unit='V',
2 zoom=1.0, color='gray', overlay_particles=True)
AttributeError: 'NoneType' object has no attribute 'slice_plot'
[13]:
ds.slice_plot(normal='y', field='Ez', unit='V/m',
zoom=1.0, color='black', overlay_particles=True)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[13], line 1
----> 1 ds.slice_plot(normal='y', field='Ez', unit='V/m',
2 zoom=1.0, color='black', overlay_particles=True)
AttributeError: 'NoneType' object has no attribute 'slice_plot'