*Info:* OPAL compiled with -DDBG_SCALARFIELD=ON writes the charge density, electrostatic potential and electric field to files.

[1]:
from opal import load_dataset, filetype
from opal.visualization.styles import load_style

load_style('jupyter')

ds = load_dataset('FieldDataset', fname='test-phi_scalar-000000.dat')
/home/opalci/pyOPALTools/opal/visualization/styles/default.py:186: MatplotlibDeprecationWarning:
The mathtext.fallback_to_cm rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
  mpl.rcParams['mathtext.fallback_to_cm'] = True
/home/opalci/pyOPALTools/opal/visualization/styles/default.py:186: MatplotlibDeprecationWarning: Support for setting the 'mathtext.fallback_to_cm' rcParam is deprecated since 3.3 and will be removed two minor releases later; use 'mathtext.fallback : 'cm' instead.
  mpl.rcParams['mathtext.fallback_to_cm'] = True
/home/opalci/pyOPALTools/opal/visualization/styles/default.py:186: MatplotlibDeprecationWarning:
The validate_bool_maybe_none function was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
  mpl.rcParams['mathtext.fallback_to_cm'] = True
/home/opalci/pyOPALTools/opal/visualization/styles/default.py:419: MatplotlibDeprecationWarning:
The savefig.jpeg_quality rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
  mpl.rcParams['savefig.jpeg_quality']    = 95        # when a jpeg is saved, the default quality parameter.
Found 2 scalar field files.
Found 1 vector field files.
[2]:
print (ds)

        Field dataset.

        Dimension:  64 x 64 x 64

        Available fields (11) :

        i
        j
        k
        x
        y
        z
        ex
        ey
        ez
        phi
        rho

[3]:
plt = ds.plot_projection(field='phi', normal='z', method='max')
plt.tight_layout()
plt.show()
plt.close()
/home/opalci/pyOPALTools/opal/visualization/FieldPlotter.py:178: MatplotlibDeprecationWarning:

shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3.  Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading'].  This will become an error two minor releases later.

_images/FieldDataset_3_1.svg
[4]:
plt = ds.plot_slice(field='phi', normal='z')
plt.tight_layout()
plt.show()
plt.close()
/home/opalci/pyOPALTools/opal/visualization/FieldPlotter.py:99: MatplotlibDeprecationWarning:

shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3.  Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading'].  This will become an error two minor releases later.

_images/FieldDataset_4_1.svg
[5]:
plt = ds.plot_line(field='phi', normal='z')
plt.tight_layout()
plt.show()
plt.close()
_images/FieldDataset_5_0.svg
[6]:
plt = ds.plot_line(field='phi', normal='y')
plt.tight_layout()
plt.show()
plt.close()
_images/FieldDataset_6_0.svg