%matplotlib inline
from py4xs.hdf import h5xs,h5exp,lsh5
import pylab as plt
import warnings

warnings.filterwarnings('ignore')


First the detector configuration needs to be associated with the scattering patterns. This information is typically saved in the exp.h5 file in the data directory

dexp = h5exp("data/exp.h5") 
dh5 = h5xs("data/AgBH-2020Aug16.h5", [dexp.detectors, dexp.qgrid])


Display the SAXS data, overlayed with rings that mark the expected position of diffraction peak from silver behenate.

plt.figure(figsize=(6,6))
ax = plt.gca()
dh5.show_data(ax=ax, det_ext="_SAXS")

Display the WAXS data, overlayed with rings that mark the expected position of diffraction peak from silver behenate.

plt.figure(figsize=(6,6))
ax = plt.gca()
dh5.show_data(ax=ax, det_ext="_WAXS2", clim=[30,500])


Display the data from all detectors, after converting them into reciprocal space, using \((q_x, q_y)\) coordinates (in the plane perpendicular to the beam direction).

plt.figure(figsize=(6,6))
ax = plt.gca()
dh5.show_data_qxy(ax=ax, clim=(0.04, 400), dq=0.004, showMask=False)


Display the data from all detectors, after converting them into reciprocal space, using \((q, \phi)\) coordinates.

plt.figure(figsize=(6,6))
ax = plt.gca()
dh5.show_data_qphi(ax=ax, clim=(0.04, 400), Nphi=180, Nq=300, 
                   showMask=True, apply_symmetry=True, fill_gap=False)