shadow4.beamline.optical_elements.compound package

Submodules

shadow4.beamline.optical_elements.compound.s4_compound module

The s4 compound optical element (combination of multiple beamline elements).

class shadow4.beamline.optical_elements.compound.s4_compound.S4Compound(name='Undefined', oe_list=None, footprint_index=None)[source]

Bases: OpticalElement, S4OpticalElementDecorator

Shadow4 Compound Element Class This is a base class for compound elements, that is a list of elements.

It is intended to group some elements into a single one, with the idea of doing the inter-element ray tracing without changing reference system.

An examples may be the channel-cut monochromator.

Note that not all S4 optical elements can be used.

Constructor.

Parameters:
  • name (str, optional) – The name of the mirror.

  • oe_list (list, optional) – A list of S4OpticalElement instances.

  • footprint_index (None or int) – The footprint index to be returned by S4CompoundElement.trace_beam(). None means that all footprints will be returned in a list.

Return type:

instance of S4Mirror.

get_info()[source]

Returns the specific information of the S4 mirror optical element.

Return type:

str

to_python_code(**kwargs)[source]

Creates the python code for defining the element.

Parameters:

**kwargs

Returns:

Python code.

Return type:

str

class shadow4.beamline.optical_elements.compound.s4_compound.S4CompoundElement(optical_element: S4Compound = None, coordinates: ElementCoordinates = None, movements: S4BeamlineElementMovements = None, input_beam: S4Beam = None)[source]

Bases: S4BeamlineElement

The base class for Shadow4 compound element. It is made of a S4Compound and an ElementCoordinates instance. It also includes the input beam.

Use derived classes for plane or other curved crystal surfaces.

Constructor.

Parameters:
  • optical_element (instance of OpticalElement, optional) – The syned optical element.

  • coordinates (instance of ElementCoordinates, optional) – The syned element coordinates.

  • movements (instance of S4BeamlineElementMovements, optional) – The S4 element movements.

  • input_beam (instance of S4Beam, optional) – The S4 incident beam.

Return type:

instance of S4MirrorElement.

to_python_code(**kwargs)[source]

Creates the python code for defining the element.

Parameters:

**kwargs

Returns:

Python code.

Return type:

str

trace_beam(**params)[source]

Runs (ray tracing) the input beam through the compound element.

Parameters:

**params

Returns:

(output_beam, footprint) instances of S4Beam.

Return type:

tuple

Module contents