<jupyter_start><jupyter_text>Data path setup<jupyter_code>data_path = '../../data/simulation/'
prop_path = 'prop/prop_out_9fs_5keV_from_CHY.h5'
os.chdir(data_path)
os.getcwd()<jupyter_output><empty_output><jupyter_text>Wave propogration<jupyter_code>prop_analysis=XFELPhotonAnalysis(input_path=prop_path)
prop_analysis.plotTotalPower(spectrum=True)
prop_analysis.plotTotalPower()
prop_analysis.plotIntensityMap()
import h5py
with h5py.File(prop_path, 'r') as f:
    grp = f['misc']
    print(grp.keys())
    print (grp['xFWHM'][...]*1e6)
    print (grp['yFWHM'][...]*1e6)<jupyter_output><KeysViewHDF5 ['electricField', 'resizing', 'spectrum0', 'spectrum1', 'xFWHM', 'yFWHM']>
0.281413778420212
0.21974034917555946<jupyter_text>Photon-matter interaction (form factor calculation) Lysozyme sample from [Sugahara Nmethods 2015](https://www.nature.com/articles/nmeth.3172), [PDB File](https://www.rcsb.org/structure/3WUL)<jupyter_code>pmi_parameters={"number_of_trajectories" : 1,
                "random_rotation" : False}
photon_matter_interactor=XMDYNDemoPhotonMatterInteractor(parameters=pmi_parameters,
                                                         input_path=prop_path,
                                                         output_path='pmi',
                                                         sample_path='3WUL.pdb')
photon_matter_interactor.backengine()
photon_matter_interactor.saveH5()<jupyter_output>Previous module:  prop
  NOT: data
  NOT: history
info
misc
params
version
['arrEhor', 'arrEver']
[('arrEhor', <HDF5 dataset "arrEhor": shape (150, 150, 651, 2), type "<f4">), ('arrEver', <HDF5 dataset "arrEver": shape (150, 150, 651, 2), type "<f4">)]<jupyter_text>Scattering  Configure Detector geometry<jupyter_code>panel = DetectorPanel(ranges={"fast_scan_min" : 0, "fast_scan_max" : 100,
                              "slow_scan_min" : 0, "slow_scan_max" : 100},
                      pixel_size=6*220.0e-6*meter,
                      energy_response=1.0/electronvolt,
                      distance_from_interaction_plane=0.13*meter,
                      corners={"x" : -49, "y": -49},
                      saturation_adu=1.e6,
                      )
detector_geometry = DetectorGeometry(panels=panel,)<jupyter_output><empty_output><jupyter_text>Configure the Diffractor Parameters<jupyter_code>diffraction_parameters = SingFELPhotonDiffractorParameters(
                                               uniform_rotation=False,
                                               slice_interval=100,
                                               number_of_slices=100,
                                               number_of_diffraction_patterns=1,
                                               detector_geometry=detector_geometry,
                                               forced_mpi_command='mpirun -np 1',
                                              )
diffractor = SingFELPhotonDiffractor(parameters=diffraction_parameters,
                                     input_path='pmi',
                                     output_path="diffr")
diffractor.backengine()
diffractor.saveH5()
spi_analysis = DiffractionAnalysis(diffractor.output_path,
                                   pattern_indices=[1],
                                   poissonize=False)
spi_analysis.plotPattern(logscale=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10535714285714286, 'fraction_numerical': 0.03482142857142857, 'mean_word_length': 2.20706106870229, 'pattern_counts': {'":': 3, '<': 24, '<?xml version=': 0, '>': 22, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '502063', 'license': 'MIT', 'n_tokens_mistral': 1085, 'n_tokens_neox': 979, 'n_words': 133, 'path': 'src/controller/singFEL/Benchmark.ipynb', 'repo_name': 'ejcjason/crystalProject', 'size': '3360'}