Reading and plotting oriented observables output by dipelm

In [1]:
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt

Read molecular frame photoelectron angular distributions (MFPAD)

In [2]:
# Read from binary stream filed produced by dipelm
with open('test/co2/photo_MFPAD_ion_state_1_neutral_state_1', 'rb') as f:
    
    state_indices   = np.fromfile(f, dtype=np.int64, count=2)
    
    no_energies     = np.fromfile(f, dtype=np.int64, count=1)
    photon_energies = np.fromfile(f, dtype=np.float64, count=no_energies[0])
    
    no_theta        = np.fromfile(f, dtype=np.int64, count=1)
    theta_grid      = np.fromfile(f, dtype=np.float64, count=no_theta[0])
    
    no_phi          = np.fromfile(f, dtype=np.int64, count=1)
    phi_grid        = np.fromfile(f, dtype=np.float64, count=no_phi[0])
    
    mfpad_dims      = np.fromfile(f, dtype=np.int64, count=3)
    no_angles       = mfpad_dims[0]
    no_components   = mfpad_dims[1]
    no_energies     = mfpad_dims[2]
    mfpad_1D        = np.fromfile(f, dtype=np.float64, count=no_angles*no_components*no_energies)   
In [3]:
# Reshape fortran style multi-D array.
mfpad = mfpad_1D.reshape(no_angles,no_components,no_energies, order='F');

Plot x-z half plane

In [4]:
D = mfpad[0:no_theta[0],1,:]
E, theta = np.meshgrid(photon_energies*27.211,theta_grid);

plt.contourf(E, theta, D, levels=np.linspace(0,0.3,50))
plt.xlim(20,50)
plt.show
Out[4]:
<function matplotlib.pyplot.show(*args, **kw)>

Read lab frame photoelectron angular distributions (LFPAD)

In [5]:
# Read from binary stream file produced by dipelm
with open('test/co2/photo_LFPAD_ion_state_1_neutral_state_1', 'rb') as f:
    
    state_indices   = np.fromfile(f, dtype=np.int64, count=2)
    
    no_energies     = np.fromfile(f, dtype=np.int64, count=1)
    photon_energies = np.fromfile(f, dtype=np.float64, count=no_energies[0])
    
    no_alpha        = np.fromfile(f, dtype=np.int64, count=1)
    alpha_grid      = np.fromfile(f, dtype=np.float64, count=no_alpha[0])
    
    no_beta         = np.fromfile(f, dtype=np.int64, count=1)
    beta_grid       = np.fromfile(f, dtype=np.float64, count=no_beta[0])
    
    no_gamma        = np.fromfile(f, dtype=np.int64, count=1)
    gamma_grid      = np.fromfile(f, dtype=np.float64, count=no_gamma[0])
    
    no_theta        = np.fromfile(f, dtype=np.int64, count=1)
    theta_grid      = np.fromfile(f, dtype=np.float64, count=no_theta[0])

    no_phi          = np.fromfile(f, dtype=np.int64, count=1)
    phi_grid        = np.fromfile(f, dtype=np.float64, count=no_phi[0])
    
    lfpad_dims      = np.fromfile(f, dtype=np.int64, count=4)
    no_euler        = lfpad_dims[0]
    no_theta_phi    = lfpad_dims[1]
    no_components   = lfpad_dims[2]
    no_energies     = lfpad_dims[3]
    lfpad_1D        = np.fromfile(f, dtype=np.float64, count=no_euler*no_theta_phi*no_components*no_energies)   
In [6]:
# Reshape fortran style multi-D array.
lfpad = lfpad_1D.reshape(no_euler,no_theta_phi, no_components,no_energies, order='F');

Plot x-z half plane ( note: we chose α=0, β=0, γ=0, so it is identical to the MFPAD)

In [7]:
D = lfpad[0, 0:no_theta[0],1,:]
E, theta = np.meshgrid(photon_energies*27.211,theta_grid);

plt.contourf(E, theta, D, levels=np.linspace(0,0.3,50))
plt.xlim(20,50)
plt.show
Out[7]:
<function matplotlib.pyplot.show(*args, **kw)>
In [ ]: