!pip install skopi
import skopi
import matplotlib.pyplot as plt
# Load SPI dataset with single/double/triple/quadruple hits (PDB:3iyf)
# x_train: (30000, 1, 128, 128) -> (number of images, panels, number of rows, number of cols)
# y_train: (30000, ) -> (1: single, 2: double, 3: triple, 4: quadruple)
# x_test and y_test contain 10000 images
(x_train,y_train), (x_test,y_test) = skopi.datasets.spidata.load_data()
# Display x_train images with y_train labels
plt.figure(figsize=(9,9))
for i in range(9):
plt.subplot(3,3,i+1)
plt.imshow(x_train[i,0], vmax=3); plt.title(y_train[i]);
plt.show()
Start by downloading a copy of skopi package and LCLS calibration
git clone https://github.com/chuckie82/skopi.git
cd skopi/examples/input && source download.sh
tar -xvf lcls.tar.gz
Simulate a chaperone on an LCLS pnCCD detector
cd skopi/examples/scripts
python ExampleSPI.py