SimEx.Parameters package


SimEx.Parameters.AbstractCalculatorParameters module

module AbstractCalculatorParameters

Hosting the abstract base class for all parameter classes.

class SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters(**kwargs)[source]

Bases: SimEx.AbstractBaseClass.AbstractBaseClass

Abstract class for all calculator parameters.



key=value pairs for calculator specific parameters.

property cpus_per_task

Query for the number of cpus per task.

property forced_mpi_command

Query for the number of cpus per task.

property gpus_per_task

Query for the number of gpus per task.

property nodes_per_task

Query for the number of nodes per task.

SimEx.Parameters.AbstractPhotonDiffractorParameters module

module AbstractPhotonDiffractorParameters

Hosts the abstract base class for all PhotonDiffractors.

class SimEx.Parameters.AbstractPhotonDiffractorParameters.AbstractPhotonDiffractorParameters(sample=None, uniform_rotation=None, number_of_diffraction_patterns=None, beam_parameters=None, detector_geometry=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class AbstractPhotonDiffractorParameters

Abstract base class for all PhotonDiffractors.

  • sample (str) – Location of file that contains the sample definition (pdb or crystfel format)

  • uniform_rotation (bool, default True) – Whether to perform uniform sampling of rotation space.

  • number_of_diffraction_patterns (int, default 1) – Number of diffraction patterns to calculate from each trajectory.

  • beam_parameters (str) – Path of the beam parameter file.

  • detector_geometry (DetectorGeometry) – The detector geometry for the simulated scattering experiment.

  • kwargs – Key-value pairs to pass to the parent class.

property beam_parameters

Query for the ‘beam_parameters’ parameter.

property detector_geometry

Query for the ‘detector_geometry’ parameter.

property number_of_diffraction_patterns

Query for the ‘number_of_diffraction_patterns_file’ parameter.

property sample

Query the ‘sample’ parameter.

property uniform_rotation

Query for the ‘uniform_rotation’ parameter.

SimEx.Parameters.CrystFELPhotonDiffractorParameters module

module CrystFELPhotonDiffractorParameters

Module that holds the CrystFELPhotonDiffractorParameters class.

class SimEx.Parameters.CrystFELPhotonDiffractorParameters.CrystFELPhotonDiffractorParameters(sample=None, uniform_rotation=None, number_of_diffraction_patterns=None, powder=None, intensities_file=None, crystal_size_min=None, crystal_size_max=None, poissonize=None, number_of_background_photons=None, suppress_fringes=None, beam_parameters=None, detector_geometry=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractPhotonDiffractorParameters.AbstractPhotonDiffractorParameters

Class CrystFELPhotonDiffractorParameters

Encapsulates parameters for the CrystFELPhotonDiffractor.

  • sample (str) – Location of file that contains the sample definition (pdb or crystfel format)

  • uniform_rotation (bool, default True) – Whether to perform uniform sampling of rotation space.

  • powder (bool) – Whether to sum all patterns to generate a simulated powder diffraction pattern.

  • intensities_file (str) – Location of file that contains intensities and phases at reciprocal lattice points. See CrystFEL documentation for more info. Default: Constant intensities and phases across entire sample.

  • crystal_size_min (PhysicalQuantity with unit of length (meter)) – Minimum crystal size.

  • crystal_size_max (PhysicalQuantity with unit of length (meter)) – Maximum crystal size.

  • poissonize (bool) – Whether to add Poisson noise to pixel values.

  • number_of_background_photons (int) – Add this number of Poisson distributed photons uniformly over the detector surface (default 0).

  • number_of_diffraction_patterns (int, default 1) – Number of diffraction patterns to calculate from each trajectory.

  • suppress_fringes (bool) – Whether to suppress subsidiary maxima beyond first minimum of the shape transform (default False).

  • beam_parameters (str) – Path of the beam parameter file.

  • detector_geometry (str) – Path of the beam geometry file.

  • kwargs – Key-value pairs to pass to the parent class.

property crystal_size_max

Query the ‘crystal_size_max’ parameter.

property crystal_size_min

Query the ‘crystal_size_min’ parameter.

property intensities_file

Query the ‘intensities_file’ parameter.

property number_of_background_photons

Query the ‘number_of_background_photons’ parameter.

property poissonize

Query the ‘poissonize’ parameter.

property powder

Query the ‘powder’ parameter.

property suppress_fringes

Query the ‘suppress_fringes’ parameter.

SimEx.Parameters.DMPhasingParameters module

module DMPhasingParameters

Module that holds the DMPhasingParameters class.

class SimEx.Parameters.DMPhasingParameters.DMPhasingParameters(number_of_trials=None, number_of_iterations=None, averaging_start=None, leash=None, number_of_shrink_cycles=None, parameters_dictionary=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class DMPhasingParameters

Encapsulates parameters for the DMPhasing analyzer.

  • number_of_trials (int>0, default 500) – How many trials to run in each iteration.

  • number_of_iterations (int>0, default 50) – Maximum number of DM iterations.

  • averaging_start – Start averaging after this many runs.

  • leash (float>0, default 0.2) – DM leash parameter.

  • number_of_shrink_cycles (int>0, default 10) – DM shrink cycles.

property averaging_start

Query for the ‘averaging_start’ parameter.

property leash

Query for the ‘leash’ parameter.

property number_of_iterations

Query for the ‘number_of_iterations’ parameter.

property number_of_shrink_cycles

Query for the ‘number_of_shrink_cycles’ parameter.

property number_of_trials

Query for the ‘number_of_trials’ parameter.

SimEx.Parameters.DetectorGeometry module

module DetectorGeometry

Module holding the DetectorGeometry class.

class SimEx.Parameters.DetectorGeometry.DetectorGeometry(panels=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class representing the detector geometry.

Constructor of the DetectorGeometry class.

  • panels (list, tuple, or instance of DetectorPanel) – Single or list of detector panels that constitute the detector.

  • kwargs (dict) – Key-value pairs to be passed to the parent class constructor.

property panels
serialize(stream=None, caller=None)[source]

Serialize the geometry.


stream (File like object.) – The stream to write the serialized geometry to (default sys.stdout).

class SimEx.Parameters.DetectorGeometry.DetectorPanel(ranges=None, pixel_size=None, energy_response=None, photon_response=None, distance_from_interaction_plane=None, distance_offset=None, fast_scan_xyz=None, slow_scan_xyz=None, corners=None, saturation_adu=None, mask=None, good_bit_mask=None, bad_bit_mask=None, saturation_map=None, badregion_flag=None, **kwargs)[source]

Bases: SimEx.AbstractBaseClass.AbstractBaseClass

Class DetectorPanel

Represents one detector panel (contiguous array of pixels, i.e. not separated by gaps).


ranges (Dictionary) – The minimum and maximum values pixel numbers on the respective transverse axis.

“:example ranges: {“fast_scan_min : 11, “fast_scan_max” : 20, “slow_scan_min” : 1, “fast_scan_max” : 20} # First axis from 11 to 20 and second axis from 1 to 20.”

  • pixel_size (PhysicalQuantity with unit meter.) – The physical size of the pixel (assuming quadratic shape) (SI units).

  • energy_response (PhysicalQuantity with unit 1/eV (adu_per_eV)) – Number of detector units (ADU) arising from one eV.

  • photon_response (float) – Number of detector units (ADU) arising from one photon.

  • distance_from_interaction_plane (PhysicalQuantity with unit meter.) – Distance in z of this panel from the plane of interaction (transverse plane that contains the sample).

  • distance_offset (PhysicalQuantity with unit meter.) – Offset from distance_from_interaction_plane.

  • fast_scan_xyz (str) – Formula that lab frame coordinates to panel axes.

  • slow_scan_xyz (str) – Formula that lab frame coordinates to panel axes.

  • corners (dict) – [x,y] coordinates of lower left pixel of this panel in the globale detector geometry.

  • saturation_adu (float.) – Saturation level for this panel.

  • mask (numpy.array of same shape as panel data.) – Mask to apply to this panel.

  • good_bit_mask – Bitmask indicating the good pixels

  • bad_bit_mask – Bitmask indicating the bad pixels.

  • saturation_map (numpy.array of same shape as panel data.) – Pixel map indicating saturated pixels.

  • badregion_flag (bool) – Flag to indicate this panel as a bad region.

Example corners

corners={“x” : -10, “y” : 10 }

property bad_bit_mask

Query the panel bad_bit_mask.

property badregion_flag

Query the panel badregion_flag.

property corners

Query the panel cornes.

property distance_from_interaction_plane

Query the panel distance_from_interaction_plane.

property distance_offset

Query the panel distance_offset.

property energy_response

Query the panel energy_response.

property fast_scan_xyz

Query the panel fast_scan_xyz.

property good_bit_mask

Query the panel good_bit_mask.

property mask

Query the panel mask.

property photon_response

Query the panel photon_response.

property pixel_size

Query the panel pixel_size.

property ranges

Query the panel ranges.

property saturation_adu

Query the panel saturation_adu.

property saturation_map

Query the panel saturation_map.

property slow_scan_xyz

Query the panel slow_scan_xyz.


SimEx.Parameters.EMCOrientationParameters module

module EMCOrientationParameters

Hosts the EMCOrientationParameters class.

class SimEx.Parameters.EMCOrientationParameters.EMCOrientationParameters(initial_number_of_quaternions=None, max_number_of_quaternions=None, max_number_of_iterations=None, min_error=None, beamstop=None, detailed_output=None, parameters_dictionary=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class EMCOrientationParameters

Class representing parameters for the EMCOrientation analyzer.

  • initial_number_of_quaternions (int (0<n<10), default 1) – Number of quaternions to start the EMC algorithm.

  • max_number_of_quaternions (int (initial_number_of_quaternions < n <= 10), default initial_number_of_quaternions + 1) – Maximum number of quaternions for the EMC algorithm.

  • min_error (float (>0), default 1.e-6) – Relative convergence criterion (Go to next quaternion is relative error gets below this value.)

  • max_number_of_iterations (int (>0), default 100) – Stop the EMC algorithm after this number of iterations.

  • beamstop (bool, default True) – Whether to apply a “center + strip” beamstop to the pixel map.

  • detailed_output (bool, default True) – Whether to write detailed info to log.

property beamstop

Query for the ‘beamstop’ parameter.

property detailed_output

Query for the ‘detailed_output’ parameter.

property initial_number_of_quaternions

Query for the ‘initial_number_of_quaternions’ parameter.

property max_number_of_iterations

Query for the ‘max_number_of_iterations’ parameter.

property max_number_of_quaternions

Query for the ‘max_number_of_quaternions’ parameter.

property min_error

Query for the ‘min_error’ parameter.

SimEx.Parameters.EstherPhotonMatterInteractorParameters module

module EstherPhotonMatterInteractorParameters

Hosting the parameter class for the EstherPhotonMatterInteractor.

class SimEx.Parameters.EstherPhotonMatterInteractorParameters.EstherPhotonMatterInteractorParameters(number_of_layers=None, ablator=None, ablator_thickness=None, sample=None, sample_thickness=None, layer1=None, layer1_thickness=None, layer2=None, layer2_thickness=None, window=None, window_thickness=None, laser_wavelength=None, laser_pulse=None, laser_pulse_duration=None, laser_intensity=None, run_time=None, delta_time=None, read_from_file=None, force_passage=None, without_therm_conduc=None, rad_transfer=None)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class EstherPhotonMatterInteractorParameters

representing parameters for the Esthe Hydrocode Calculator.

  • ablator (str) – The ablating material ( “Al” | “CH” | “Diamond” | “Kapton” | “Mylar” )

  • ablator_thickness – The ablator thickness (micrometers)

  • sample (str) – The sample material (from list of materials)

  • sample_thickness (float) – The sample thickness (micrometers)

  • layer1 (str) – The layer1 material (from list of materials)

  • layer2 (str) – The layer2 material (from list of materials)

  • window (str) – The window material (LiF | SiO2 | Diamond)

  • window_thickness (float) – The window thickness, if using window (micrometers)

  • laser_pulse (str) – Pulse type (“flat” | “ramp” | “other”)

  • laser_pulse_duration (float) – Pulse duration of the pump laser (ns)

  • laser_wavelength (float) – Laser wavelength (nm)

  • laser_intensity (float) – Laser intensity (TW/cm2)

  • run_time (float) – Simulation run time (ns)

  • delta_time (float) – Time steps resolution (ns)

  • force_passage (boolean) – Expert option to force passage of simulation through minor errors

  • without_therm_conduc (boolean) – Expert option to use without thermal conductivity options

  • rad_transfer (boolean) – Expert option to use radiative transfer

property ablator

Query for the ablator type.

property ablator_thickness

Query for the ablator thickness.

property delta_time

Query for simulation time resolution (delta t ns)

property laser_intensity

Query for laser intensity

property laser_pulse

Query for laser pulse type

property laser_pulse_duration

Query for laser pulse duration

property laser_wavelength

Query for the laser wavelength type.

property layer1

Query for the layer1 type.

property layer1_thickness

Query for the layer1 thickness type.

property layer2

Query for the layer2 type.

property layer2_thickness

Query for the layer2 thickness type.

property number_of_layers

Query for the number of layers.

property run_time

Query for simulation run time

property sample

Query for the sample type.

property sample_thickness

Query for the sample thickness type.

property window

Query for the window type.

property window_thickness

Query for the window thickness type.


Utility to check if the ablator exists in the EOS database.


ablator – The ablator material to check.


The ablator choice after being checked.


ValueError – ablator not in [“CH”, “Al”, “Diamond”, “Mylar”, “Kapton”].


Utility to check that the ablator thickness is > 5 um and < 100 um


Utility for checking the simulation delta time (resolution) is valid


Utility to check that the laser intensity is valid.


Utility to check that the laser pulse type is correct.


Utility to check that the laser pulse duration is valid.


Utility to check that the laser wavelength is correct.


Utility to check if the layer1 is in the list of known EOS materials


Utility to check that the layer1 thickness is in permitted range set by Esther.


Utility to check if the layer2 is in the list of known EOS materials


Utility to check that the layer2 thickness is in permitted range set by Esther.


Utility to check if the number of layers is reasonable.


number_of_layers – The number of layers to check


Checked number of layers


ValueError – not (1 < number_of_layers <= 4 )


Utility for checking the simulation run time is valid


Utility to check if the sample is in the list of known EOS materials


Utility to check that the sample thickness is in permitted range set by Esther.


Utility to check that the window exists in the EOS database.


Utility to check that the window thickness is > 1 um and < 500 um

SimEx.Parameters.FEFFPhotonMatterInteractorParameters module


Holds the FEFFPhotonMatterInteractorParameters class.

class SimEx.Parameters.FEFFPhotonMatterInteractorParameters.FEFFPhotonMatterInteractorParameters(atoms=None, potentials=None, edge=None, amplitude_reduction_factor=None, effective_path_distance=None)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class FEFFPhotonMatterInteractorParameters

Interface class for photon-matter interaction calculations using the FEFF code.

  • atoms (list || tuple) – The atomic structure (Atom coordinates ([x,y,z] in Angstrom), element symbol, and potential index). If no potential index is given, all atoms of the same species will be assigned the default potential. The scattering atom must have the potential index 0.

  • potentials (list) – The potentials to use.

  • edge (str) – The edge to calculate (K, L1, L2, M1, M2, M3, …). Default ‘K’.

  • amplitude_reduction_factor (float) – The amplitude reduction factor. Default 1.0

  • effective_path_distance (float) – The maximum effective (half-path) distance in Angstrom. Translates to rpath parameter in feff.inp. Default 2.2 times nearest neighbor distance.

Example atoms

([[0.0, 0.0, 0.0], ‘Cu’, 0], [[0.0, 1.0, 1.2], ‘O’, 1], …)

property amplitude_reduction_factor

Query method for amplitude_reduction_factor

property atoms

Query method for atoms

property edge

Query method for edge

property effective_path_distance

Query method for effective_path_distance


Finalize the parameters. Check if all parameters are internally consistent.

property finalized

Query the finalization status.

property potentials

Query method for potentials

SimEx.Parameters.PhotonBeamParameters module

module PhotonBeamParameters

Contains the PhotonBeamParameters class and associated functions.

class SimEx.Parameters.PhotonBeamParameters.PhotonBeamParameters(photon_energy, beam_diameter_fwhm, pulse_energy, photon_energy_relative_bandwidth=None, divergence=None, photon_energy_spectrum_type=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class PhotonBeamParameters

Encapsulates the parameters of a photon beam.

  • photon_energy (float) – The mean photon energy in units of electronvolts (eV).

  • photon_energy_relative_bandwidth (float (>0.0)) – The relative energy bandwidth

  • beam_diameter_fwhm (float) – Beam diameter in units of metre (m).

  • pulse_energy (float) – Total energy of the pulse in units of Joule (J).

  • divergence (float (0 < divergence < 2*pi)) – Beam divergence angle in units of radian (rad).

  • photon_energy_spectrum_type (float) – Type of energy spectrum (“SASE” | “tophat” | “twocolour”, default “SASE”).

  • kwargs (dict) – Key-value pairs to be passed to the parent class constructor.

property beam_diameter_fwhm

Query the ‘beam_diameter_fwhm’ parameter.

property divergence

Query the ‘divergence’ parameter.

property photon_energy

Query the ‘photon_energy’ parameter.

property photon_energy_relative_bandwidth

Query the ‘photon_energy_relative_bandwidth’ parameter.

property photon_energy_spectrum_type

Query the ‘photon_energy_spectrum_type’ parameter.

property pulse_energy

Query the ‘pulse_energy’ parameter.

serialize(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Serialize the object (write to a stream)


stream (str || file) – The stream to write to (default sys.stdout)


Utility to setup a PhotonBeamParameters instance from propagation output.

SimEx.Parameters.PhotonMatterInteractorParameters module

module PhotonMatterInteractorParameters

Module that holds the PhotonMatterInteractorParameter class.

class SimEx.Parameters.PhotonMatterInteractorParameters.PhotonMatterInteractorParameters(rotation=None, calculate_Compton=None, number_of_trajectories=None, beam_parameters=None, parameters_dictionary=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class PhotonMatterInteractorParameters

Encapsulates parameters for the PhotonMatterInteractor calculator.

  • rotation – Rotation to apply to the sample atoms’ positions (Default: no rotation).

  • calculate_Compton (bool, default False) – Whether to calculate incoherent (Compton) scattering.

  • number_of_trajectories (int, default 1) – Number of trajectories to simulate.

  • beam_parameters (PhotonBeamParameters) – Parameters of the photon beam.

  • parameters_dictionary (dict) – A legacy parameters dictionary (Default: None).

property beam_parameters

Query for the ‘beam_parameters’ parameter.

property calculate_Compton

Query for the ‘calculate_Compton’ parameter.

property number_of_trajectories

Query for the ‘number_of_trajectories_file’ parameter.

property rotation

Query for the ‘rotation’ parameter.

SimEx.Parameters.PlasmaXRTSCalculatorParameters module

module PlasmaXRTSCalculatorParameters

Module that holds the PlasmaXRTSCalculatorParameters class.

class SimEx.Parameters.PlasmaXRTSCalculatorParameters.PlasmaXRTSCalculatorParameters(elements=None, photon_energy=None, scattering_angle=None, electron_temperature=None, electron_density=None, ion_temperature=None, ion_charge=None, mass_density=None, debye_temperature=None, band_gap=None, energy_range=None, model_Sii=None, model_See=None, model_Sbf=None, model_IPL=None, model_Mix=None, lfc=None, Sbf_norm=None, source_spectrum=None, source_spectrum_fwhm=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class PlasmaXRTSCalculatorParameters

Encapsulates parameters for the plasma x-ray Thomson scattering calculator.

  • elements (list [[element symbol, stochiometric number, charge], ..], default None) – The chemical elements in the scattering target.

  • photon_energy (float) – The central energy of incoming x-ray photons.

  • scattering_angle (float) – The scattering angle.

  • electron_temperature (float) – The temperature of the electron subsystems (units of eV).

  • electron_density (float) – The electron number density (units of 1/cm^3)

  • ion_temperature (float) – The temperature of the ion subsystem (units of eV).

  • ion_charge (float) – The average ion charge (units of elementary charge e).

  • mass_density (float) – The mass density of the target (units of g/cm^3).

  • debye_temperature (float) – The Debye temperature (units of eV).

  • band_gap (float, default 0) – The band gap of the target (units of eV).

  • energy_range (dict, default 0) – The energy range over which to calculate the scattering spectrum.

  • model_Sii (str ('DH' || 'OCP' || 'SOCP' || 'SOCPN') || float, default 'DH') – The model to use for the ion-ion structure factor.

  • model_See (str ('RPA' || 'BMA' || 'BMA+sLFC'), default 'RPA') – The model of the dynamic (high frequency) part of the electron-electron structure factor.

  • model_Sbf (str ('IA' || 'FA'), default 'IA') – The model for the bound-free structure factor.

  • model_IPL (str ('SP' || 'EK') || float, default 'SP') – Model for ionization potential lowering.

  • model_Mix (str, default None) – The model to use for mixing (of species).

  • lfc (float, default 0.0) – The local field correction to use.

  • Sbf_norm (str || float, default None) – How to normalize the bound-free structure factor.

  • source_spectrum (str, default None) – Path to a file holding the x-ray probe energy spectrum.

  • source_spectrum_fwhm (float) – The x-ray probe energy spectrum fwhm.

Example elements

[[‘B’, 1, 2], [‘N’, 1, 2]] for Boron-Nitride with both B and N two fold ionized (ion average).

Example elements

[[‘C’, 1, 4], [‘H’, 1, -1]] for Plastic with both four-fold ionized C and ionization of H calculated so that the given average ion charge comes out correct.

Example energy_range

energy_range={‘min’ -100.0, ‘max’ 100, ‘step’ 0.5} to go from -100 eV to 100 eV in steps of 0.5 eV.

Example model_Sii

Sii=1.5 to use a fixed value of Sii=1.5

Example model_IPL

model_IPL=100.0 # Set the ionization potential difference (lowering) to 100 eV.

property Sbf_norm

Query for the norm of the bound-free structure factor.

property band_gap

Query for the band gap.

property debye_temperature

Query for the Debye temperature.

property electron_density

Query for the electron density.

property electron_temperature

Query for the electron temperature.

property elements

Query for the field data.

property energy_range

Query for the energy range.

property ion_charge

Query for the ion charge.

property ion_temperature

Query for the ion temperature.

property lfc

Query for the local field factor.

property mass_density

Query for the mass density.

property model_IPL

Query for the ionization potential lowering model.

property model_Mix

Query for the mixing model.

property model_Sbf

Query for the bound-free structure factor model.

property model_See

Query for the electron-electron (high-frequency) structure factor model.

property model_Sii

Query for the ion-ion structure factor model.

property photon_energy

Query for the photon energy.

property scattering_angle

Query for the scattering angle.

property source_spectrum

Query for the source spectrum identifier.

property source_spectrum_fwhm

Query for the source spectrum fwhm identifier.


Utility to check if input is a valid bandgap.

@param band_gap: The bandgap to check. <br/><b>type</b> : double <br/><b>default</b> 0.0. @return : The checked bandgap.


Utility to check if input is a valid Debye temperature.

@param debye_temperature : The Debye temperature to check. <br/><b>type</b> : double <br/><b>default</b> : 0.0 @return : The checked Debye temperature.

SimEx.Parameters.PlasmaXRTSCalculatorParameters.checkAndSetDensitiesAndCharge(electron_density, ion_charge, mass_density, elements)[source]

Utility to check input and return a set of consistent electron density, average ion charge, and mass density, if two are given as input.


Utility to check if input is a valid electron temperature.

@param electron_temperature : The electron temperature to check. <br/><b>type</b> : double @return : The checked electron temperature.


Utility to check if input is a valid list of elements.

@param elements: The elements to check. <br/><b>type</b> elements: list @return: The checked list of elements.

SimEx.Parameters.PlasmaXRTSCalculatorParameters.checkAndSetEnergyRange(energy_range, electron_density=None)[source]

Utility to check if the photon energy range is ok. @param energy_range : The range to check. <br/><b>type</b> dict @return The checked photon energy range. @raise ValueError if not of correct shape.

SimEx.Parameters.PlasmaXRTSCalculatorParameters.checkAndSetIonTemperature(ion_temperature, electron_temperature=None)[source]

Utility to check if input is a valid ion temperature.

@param ion_temperature : The ion temperature to check. <br/><b>type</b> : double <br/><b>default</b> : Electron temperature. @return : The checked ion temperature.


Utility to check if input is a valid local field correction factor.

@param lfc : The lfc to check. <br/><b>type</b> : double @return : The checked lfc.


Utility to check if the model is a valid model for ionization potential lowering.

@param model : The model to check. <br/><b>type</b> : str or float @return : The checked model @raise ValueError if not a valid IPL model.


Utility to check if input is a valid mixing model.

@param model_Mix : The mixing model to check. <br/><b>type</b> : string @return : The checked mixing model.


Utility to check if the model is a valid model for the bound-free (Compton) scattering feature.

@param model : The model to check. <br/><b>type</b> : str @return : The checked model @raise ValueError if not a string or not a valid Sbf model (‘IA’, ‘HWF’)


Utility to check if the model is a valid model for the high frequency (dynamic) feature.

@param model : The model to check. <br/><b>type</b> : str @return : The checked model @raise ValueError if not a string or not a valid See0 model (‘RPA’, ‘BMA’, ‘BMA+sLFC’, ‘BMA+dLFC’, ‘LFC’, ‘Landen’)


Utility to check if the model is a valid model for the Rayleigh (quasistatic) scattering feature.

@param model : The model to check. <br/><b>type</b> : str @return : The checked model @raise ValueError if not a string or not a valid Sii model (‘RPA’, ‘DH’,


Utility to check if the photon energy is correct. @param energy : The energy to check. @return The checked energy.


Utility to check if input is a valid norm of the bound-free structure factor.

@param Sbf_norm : The norm to check. <br/><b>type</b> : string or double. @return : The checked norm.


Utility to check if the scattering angle is in the correct range. @param angle : The angle to check. @return The checked angle. @raise ValueError if not 0 <= angle <= 180


Utility to check sanity of given input for the source spectrum identifier.

@param source_spectrum : The source spectrum identifier to check. <br/><b>type</b> : str @return : The checked identifier. @raise : TypeError or ValueError if input is not valid.


Utility to check sanity of given input for the source spectrum full width at half maximum (fwhm).

@param source_spectrum : The value to check. <br/><b>type</b> : float @return : The checked value. @raise : TypeError or ValueError if input is not valid.

SimEx.Parameters.SingFELPhotonDiffractorParameters module

module SingFELPhotonDiffractorParameters

Module that holds the SingFELPhotonDiffractorParameters class.

class SimEx.Parameters.SingFELPhotonDiffractorParameters.SingFELPhotonDiffractorParameters(sample=None, uniform_rotation=None, calculate_Compton=None, slice_interval=None, number_of_slices=None, pmi_start_ID=None, pmi_stop_ID=None, number_of_diffraction_patterns=None, beam_parameters=None, detector_geometry=None, number_of_MPI_processes=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractPhotonDiffractorParameters.AbstractPhotonDiffractorParameters

Class SingFELPhotonDiffractorParameters

Class representing parameters for the SingFELPhotonDiffractor calculator.

  • calculate_Compton (bool, default False) – Whether to calculate incoherent (Compton) scattering.

  • slice_interval (int, default 100) – Length of time slice interval to extract from each trajectory.

  • number_of_slices (int, default 1) – Number of time slices to read from each trajectory.

  • pmi_start_ID (int, default 1) – Identifier for the first pmi trajectory to read in.

  • pmi_stop_ID (int, default 1) – Identifier for the last pmi trajectory to read in.

property calculate_Compton

Query for the ‘calculate_Compton’ parameter.

property number_of_slices

Query for the ‘number_of_slices’ parameter.

property pmi_start_ID

Query for the ‘pmi_start_ID’ parameter.

property pmi_stop_ID

Query for the ‘pmi_stop_ID’ parameter.

property slice_interval

Query for the ‘slice_interval’ parameter.

SimEx.Parameters.WavePropagatorParameters module

module WavePropagatorParameters

Module that holds the WavePropagatorParameters class.

class SimEx.Parameters.WavePropagatorParameters.WavePropagatorParameters(use_opmd=None, beamline=None, **kwargs)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class WavePropagatorParameters

Class representing parameters for the WavePropagator.

  • use_opmd (bool, default False) – Whether to use the openPMD output format.

  • beamline (class or module that defines a function) – The WPG beamline to use in the propagation.

get_beamline, which in turn returns a WPG.Beamline instance.

property beamline

Query for the ‘beamline’ parameter.

property use_opmd

Query for the ‘use_opmd’ parameter.

SimEx.Parameters.XCSITPhotonDetectorParameters module

module XCSITPhotonDetectorParameters

Hosts the XCSITPhotonDetectorParameters class.

class SimEx.Parameters.XCSITPhotonDetectorParameters.XCSITPhotonDetectorParameters(detector_type=None, plasma_search_flag=None, plasma_simulation_flag=None, point_simulation_method=None, patterns=None)[source]

Bases: SimEx.Parameters.AbstractCalculatorParameters.AbstractCalculatorParameters

Class XCSITPhotonDetectorParameters

Encapsulates all parameters for the XCSITPhotonDetector class.

  • detector_type (str) – The detector type to simulate (“pnCCD” | “LPD” | “AGIPD | “AGIPDSPB”).

  • plasma_search_flag (str) – Flag for the plasma search method (“BLANK”).

  • plasma_simulation_flag (str) – Flag for the plasma simulation method (“BLANKPLASMA”).

  • point_simulation_method (str) – Method for the charge point simulation (“FULL” | “FANO” | “LUT” | “BINNING”).

  • patterns ((str || int) or iterable over these types.) – Which patterns to feed into the detector simulation. Default: Use all patterns.

Example patterns

patterns=0 # use the first pattern.

Example patterns

patterns=range(10) # use the first 10 patterns

Example patterns

patterns=[‘0000001’,‘0001001’] # user patterns with Ids ‘0000001’ and ‘0001001’.

property detector_type

:return string containing the detector name

property patterns

The patterns to use in the detector simulation.

property plasma_search_flag

:return string, the plasma search method

property plasma_simulation_flag

:return string, the plasma simulation method

property point_simulation_method

:return string, the charge simulation method