mcstasscript.tools.cryostat_builder.Layer

mcstasscript.tools.cryostat_builder.Layer

class mcstasscript.tools.cryostat_builder.Layer(name, cryostat, origin_to_bottom, bottom_thickness, origin_to_top, top_thickness=0.01, inner_radius=None, outer_radius=None, thickness=None, material='Al', p_interact=0)
__init__(name, cryostat, origin_to_bottom, bottom_thickness, origin_to_top, top_thickness=0.01, inner_radius=None, outer_radius=None, thickness=None, material='Al', p_interact=0)

Layer of cryostat with a shell made of given material and hollowed by vacuum

Describes a layer of a cryostat with given geometry and materials. The geometry is specified with distance from origin to top and bottom, along with a thickness of these. In addition an outer and inner radius is needed, here the user can specify two of inner_radius, outer_radius and thickness. The Layer is given the cryostat object of which is it a part to access methods and attributes in a simple way. The layer is built from Union components, and so are not allowed to perfectly intersect the planes from other layers. These are registered and check with the cryostat class. If a custom material is given instead of Al, that material has to exist as a Union_make_material component.

It is possible to add windows to a layer, these are added with the add_window method, windows can be a reduction of radius from the inside, outside or both.

Parameters
  • origin_to_bottom (float) – Distance from origin to bottom of layer [m] (bottom thickness added)

  • bottom_thickness (float) – Thickness of layer bottom [m]

  • origin_to_top (float) – Distance from origin to top of layer [m] (top thickness added)

  • top_thickness (float) – Thickness of layer top [m]

  • inner_radius (float) – Inner radius of the cryostat layer [m]

  • outer_radius (float) – Outer radius of the cryostat layer [m]

  • thickness (float) – Thickness of the shell, can be provided instead of either inner or outer radius [m]

  • material (string) – Material of which the cryostat layer should be made

  • p_interact (float) – p_interact set for all Union geometry components

Methods

__init__(name, cryostat, origin_to_bottom, ...)

Layer of cryostat with a shell made of given material and hollowed by vacuum

add_window([inner_radius, outer_radius, ...])

Adds 360 deg window in given height interval

check_radius_input(inner_radius, ...)

Returns inner and outer radius from user input that may include thickness

count_inputs(*args)

Counts how many of given inputs are not None

add_window(inner_radius=None, outer_radius=None, thickness=None, height=None, origin_to_top=None, origin_to_bottom=None)

Adds 360 deg window in given height interval

Adds window as a reduction in thickness of the layer in a certain height interval. The reduction can be both from the outside, inside or both. If only outer_radius is given, a reduction of the outside is assumed. If only inner_radius is given, the window will be on the inside. If two of the three parameters inner_radius, outer_radius and thickness is given, material will be removed from both the outside and inside, only use this if necessary, never specify inner / outer radius identical to the main layer. Any two of height, origin_to_top and origin_to_bottom can be given, or if the window is symmetrical in height around the origin position, the height alone is sufficient. It is possible to add multiple multiple windows by calling this method multiple times, add the tallest first.

Keyword Arguments
  • inner_radius (float) – inner radius of window (should be larger than main inner_radius)

  • outer_radius (float) – outer radius of window (should be less than main outer_radius)

  • thickness (float) – thickness of the window

  • height (float) – height of window

  • origin_to_top (float) – distance from origin to top of window

  • origin_to_bototm (float) – distance from origin to bottom of window

check_radius_input(inner_radius, outer_radius, thickness)

Returns inner and outer radius from user input that may include thickness

The inner_radius, outer_radius and thickness can have one not specified, and this method will calculate the inner and out radius from the two given. A input not given is specified as None.

count_inputs(*args)

Counts how many of given inputs are not None