Exemple #1
0
    def reference2NIP(self):
        """ Testing that diffraction intensities with 9fs 5keV pulses through SPB-SFX KB beamline are of the order of Yoon 2016. """

        source_file = "/data/netapp/grotec/datadump/5keV_9fs_2015_slice12_fromYoon2016.h5"
        #source_file = TestUtilities.generateTestFilePath("FELsource_out.h5")

        # Propagate
        propagator = XFELPhotonPropagator(parameters=None,
                                          input_path=source_file,
                                          output_path="prop_out.h5")
        propagator.backengine()
        propagator.saveH5()

        pmi = XMDYNDemoPhotonMatterInteractor(
            parameters=None,
            input_path=propagator.output_path,
            output_path="pmi",
            sample_path=TestUtilities.generateTestFilePath("sample.h5"))
        pmi.backengine()

        #  Diffraction with parameters.
        diffraction_parameters = {
            'uniform_rotation': True,
            'calculate_Compton': False,
            'slice_interval': 100,
            'number_of_slices': 100,
            'pmi_start_ID': 1,
            'pmi_stop_ID': 1,
            'number_of_diffraction_patterns': 1,
            'beam_parameter_file':
            TestUtilities.generateTestFilePath('s2e.beam'),
            'beam_geometry_file':
            TestUtilities.generateTestFilePath('s2e.geom'),
            'number_of_MPI_processes': 8,
        }

        diffractor = SingFELPhotonDiffractor(parameters=diffraction_parameters,
                                             input_path=pmi.output_path,
                                             output_path="diffr_out.h5")
        diffractor.backengine()
Exemple #2
0
import sys

# Setup propagation parameters. Here we must specify the beamline.
parameters = WavePropagatorParameters(beamline=beamline)

# Path to source files (ADJUST ME).
input_files_path = "source/3fs_5keV_nz35_0000001.h5"

# Construct the propagator
propagator = XFELPhotonPropagator(
    parameters=parameters,
    input_path=input_files_path,
    output_path='prop_out/prop_s2e_example.h5',
    use_opmd=False  # Set to True if openPMD output is required
)

# Read the data.
propagator._readH5()

# Call the backengine.
status = propagator.backengine()

if status != 0:
    print "Wave propagation failed, check output."
    sys.exit()

propagator.saveH5()

print "Wave propagation succeeded."