section : properties of different sections of the collimator

class c3dp.instruments.collimator.section.CollimatorSection(thickness, sample_distance, aperture)[source]

Bases: object

thickness: float

Distance from upstream and downstream collimator faces, in mili-meters

sample_distance: float

Distance from the sample to the middle of the section, in mili-meters

aperture: float

Angle subtended by the section to the sample, in degrees

blade_blade_angle_distances(blade_angles)[source]

In the boundary between two collimator sections, the interior blades of each collimator section may overlap on top of each other. Here we look at the upstream face of the collimator section, that is the boundary between this section and the collimator section immediately nearer to the sample. For each interior blade of the collimator section, we calculate the angle difference to each of the blades of the neighbor collimator section, retaining only the minimum of these differences. In the end, we obtain an angle difference between each blade of the collimator section and the set of blades from the neighbor collimator section.

Parameters

blade_angles (numpy.ndarray) – Blade angle positions for the neighbor collimator section

Returns

Angle differences, in degrees

Return type

numpy.ndarray

blade_blade_distances(blade_angles)[source]

In the boundary between two collimator sections, the interior blades of each collimator section may overlap on top of each other. Here we look at the upstream face of the collimator section, that is the boundary between this section and the collimator section immediately nearer to the sample. For each interior blade of the collimator section, we calculate the distance to each of the blades of the neighbor collimator section, retaining only the minimum of these distances. In the end, we obtain a distance between each blade of the collimator section and the set of blades from the neighbor collimator section.

Parameters

blade_angles (numpy.ndarray) – Blade angle positions for the neighbor collimator section

Returns

Distances between neighboring blades, in mili-meters

Return type

numpy.ndarray

chanel_thickness(n_blades=None)[source]

Chanel thickness given a number of interior blades. Blade thickness is also taken into account.

Calculations using the upstream face of the collimator section.

Parameters

n_blades (int) – Number of interior blades. If none, the number of blade angles is used

Returns

Return type

float

minimal_blade_blade_distance(blade_angles)[source]

Minimal distance between the set of interior blades of the collimator section and the set of interior blades of the collimator section immediately nearer to the sample.

Parameters

blade_angles (numpy.ndarray) – Blade angle positions for the neighbor collimator section

Returns

Minimal distance, in mili-meters

Return type

float

property n_blades
n_blades_from_thickness(channel_thickness)[source]

Number of interior blades given a channel thickness. Blade thickness is also taken into account.

Calculations using the upstream face of the collimator section

Parameters

channel_thickness (float)

Returns

Return type

int

property sample_upstream_distance

Distance from sample to upstream collimator face

set_blade_angles(n_blades)[source]

Angle positions of the blades. Origin of angles at the top surface.

Parameters

n_blades (int) – number of interior blades

Returns

Return type

numpy.ndarray

class c3dp.instruments.collimator.section.Triad(blades, d, widths)

Bases: tuple

blades

Alias for field number 0

d

Alias for field number 1

widths

Alias for field number 2

c3dp.instruments.collimator.section.blade_configurations(upstream_distance, collimator_thickness, aperture, minimum_channel_width=3.0, blade_thickness=1.0, blade_gap=1.1)[source]

List of blade configurations. Each configuratio avoids blade overlap between adjacent collimator sections.

Parameters
  • upstream_distance (float) – Distance from sample to the upstream face of the collimator.

  • thickness (float) – Distance of each collimator section. Assumed all three same thickness.

  • aperture (float) – Collimator aperture angle, in degrees

  • minimum_channel_width (float) – Units in mili meters

  • blade_thickness (float) – Units in mili meters

  • blade_gap (float) – Minimal distance between blades from adjacent sections

Returns

List of Triad objects, that can later be filtered and sorted

Return type

list

c3dp.instruments.collimator.section.sort_filter_confs(confs, min_n_blades=None, max_channel_width=None, sort_by_total_blades=False, sort_max_section_blades=None)[source]

Sort or filter according to different criteria :Parameters: * confs (list) – List of Triad objects

  • min_n_blades (int) – Discard Triads having one collimator section with a number of blades smaller than this number.

  • max_channel_width (float) – Discard Triads having one collimator section with a channel width bigger than this value.

  • sort_by_total_blades (Bool) – Sort by decreasing total number of blades in the collimator.

  • sort_max_section_blades (str) – One of ‘first’, ‘middle’, ‘last’. Sort list of Triads according to decreasing number of blades in either the ‘first’, ‘middle’, or ‘last’ collimator section.

Returns

sorted or filtered list of Triad objects

Return type

list

c3dp.instruments.collimator.section.valid_blade_pair_configurations(upstream_section, max_upstream_blades, downstream_section, max_downstream_blades, tolerance=1.0)[source]

List of pairs, each pair containing a number of interior blades for the upstream collimator section and a number of interior blades for the downstream collimator section. For each valid pair, it is guaranteed that no blade from the upstream collimator is closer than the tolerance distance to any blade from the downstream collimator. Also for each pair, the minimal blade-to-blade distance is reported

Parameters
  • upstream_section (CollimatorSection) – Upstream collimator section

  • max_upstream_blades (int) – Maximum number of interior blades for the upstream collimator section

  • downstream_section (CollimatorSection) – Downstream collimator section

  • max_downstream_blades (int) – Maximum number of interior blades for the downstream collimator section

  • tolerance (float) – Minimal blade-to-blade distance between adjacent collimator sections.

Returns

Tuple containing a list of valid pairs and a list of minimal distances

Return type

tuple

c3dp.instruments.collimator.section.valid_blade_triad_configurations(sections, max_blades, tolerance=1.0)[source]

List of triads, each triad containing number of interior blades for each collimator sections. For each triad, it is guaranteed that no blade from a collimator section is closer than the tolerance distance to any blade from the adjacent collimator(s).

Parameters
  • sections (list) – List of collimator sections, beginning with the section closer to the sample

  • max_blades (list) – Maximum number of interior blades per collimator section.

  • tolerance (float) – Minimal blade-to-blade distance between adjacent collimator sections.

Returns

a list of Triad objects

Return type

list