Page History
...
This note contains description of the implemented hierarchical geometry model, coordinate transformation algorithms, tabulation of the hierarchical objects and calibration file format, description of software interface in C++ and Python, details of calibration, etc.
Coordinate
...
frames
In this section we list tentative objects and associated coordinate frames which may be involved in typical LCLS experimental setup and explain how they can be inscribed in the hierarchical model.
Experimental setup
On the very top level of hierarchical structure there should be a global coordinate frame associated with entire experimental setup. All other setup components are defined relative to the global coordinate frame. In diffraction experiments origin of the coordinate frame is usually associated with IP. Choice of axes directions depends on experimental preferences. In some of LCLS experiments Cartesian coordinate system of the setup is defined by the three mutually orthogonal right-hand-indexed axes with origin in the IP:
- X axis pointing from IP to the north,
- Y axis pointing from IP to the top, and
- Z axis pointing from IP
Axes definition
Cartesian coordinate system of setup is defined by three mutually orthogonal right-hand-indexed axes with origin in the interaction point (IP) of the photon beam with target:
- X – pointing from IP to the north,
- Y – pointing from IP to the top, and
- Z – pointing from IP along the photon beam propagation direction,
...
Detector position
Detector coordinate system may have a translation and rotation with respect to the setup, which can be defined by the 3 vectors in the setup frame:
- P – translation vector pointing from IP to the detector origin,
- ex – unit vector along the detector frame x axis,
ey – unit vector along the detector frame y axis,
as shown in the plot:
Third unit vector ez – is assumed to be right-hand triplet component,
ez=[ex × ey]
.
Components of these three unit vectors form the rotation matrix
/ ex1 ey1
ez1
\
R
= | ij
ex2 ey2
ez2
|
\ ex3 ey3
ez3
/
where indexes "i" and "j" corresponds to the vector components in the setup and detector local coordinate frames, respectively. Within this definition 3-d pixel coordinate "c" in the detector frame can be transformed to the setup coordinate "C" using equation
Ci=Rij·cj + Pi
.
Parameters for detector position and orientation
The list of parameters, which defines detector position and orientation in the setup (lab) frame consists of vector components:
P1 | P2 | P3 | ex1 | ex2 | ex3 | ey1 | ey2 | ey3 |
---|
assuming ez=[ex × ey]
, and |ex|=|ey
| =|ez|=
1.
Alternatively, directions of the three unit vectors ex, ey
,
and ez
of the detector frame can be defined in terms of three Euler angle rotations with respect to the setup (lab) frame:
P1 | P2 | P3 | alpha | beta | gamma |
---|
with classic relations between (ex,ey
,
ez
) and (alpha, beta, gamma) presentations.
Access to these parameters should should be provided at least two methods of the calibration store object:
(P1, P2, P3, ex1, ex2, ex3, ey1, ey2, ey3) = calib.get( type, detector_name )
calib.put(type, detector_name, (P1, P2, P3, ex1, ex2, ex3, ey1, ey2, ey3))
or similar methods for Euler angles.
Coordinate system of the detector
In this note we assume that:
- the detector image is produced by a set of tiles (a.k.a., segment, section, 2x1, sensor, Si-pixel matrix, etc),
- the tiles form almost flat (x-y) surface around z=0 within precision of production technology and installation,
- the tile rotation angles in (x-y) are N*90 degrees, where N=0,1,2,or 3,
- detector local coordinate system is defined in this plane, as explained below.
These assumptions are not necessary for most of algorithms. But, in many cases it may be convenient to use small angle approximation or ignore angular misalignment for image mapping between tiles and 2-d image array.
Tile ideal geometry
- Each tile has well defined by design geometry of pixels, which does not need in separate calibration.
- Pixel center (x,y) coordinates at z=0 for each tile can be defined as a look-up table in its "natural" matrix-style coordinate system.
- For example, CSPAD 2x1 tile pixel geometry is defined as
- Regular pixel size is 109.92 x 109.92 µm2,
- Pixel size in two middle columns 193 and 194 is 274.80 x 109.92 µm2.
For any type of tile there should be a method returning pixel coordinates in this ideal geometry,
xarr, yarr, zarr = get_xyz_maps_um()
For example, Python interface for CSPAD2x1
Code Block |
---|
from PyCSPadImage.PixCoords2x1 import cspad2x1_one
...
xarr, yarr, zarr = cspad2x1_one.get_xyz_maps_um() |
returns x-, y-, and z-coordinate arrays of shape [185,388].
Memory model
It is assumed that each tile is presented in DAQ or offline data by a consecutive block of memory. Uniform matrix-type geometry of pixel array is preferable, but other geometry can be handled. For example, for CSPAD 2x1 sensor pixel index in the tile memory block of size (185,388) can be evaluated as
i = column + row*388.
Detector data record consists of consecutive tile-blocks, in accordance with numeration adopted in DAQ. For effective memory management, some of the tile-blocks may be missing due to current detector configuration. Available configuration of the detector tile-blocks should be marked in a bit-mask word in position order (bit position from lower to higher is associated with the tile number in DAQ).
Optical measurements
- Optical measurements provide 3-d coordinates of 4 corners for all tiles in the detector in some arbitrary microscope plane which coincides with detector imaging array (tiles) plane within precision of installation.
- Tile corner coordinates do not necessarily coincide with corner pixel centers or edges.
- Numeration of tiles should not necessarily coincide with their numeration in DAQ, but it should be done in fixed order or with indication of tile numbers:
Optical measurements provide a list of coordinates for all sensor points:
Tile # Point # X[µm] Y[µm] Y[µm]
Quality check
FIG. 1: Tentative coordinate frame of experimental setup.
In this frame photon-hit pixel coordinates (x, y, z) can be easily transformed to the photon diffraction angle θ,
Sensor
On the very bottom level of hierarchy structure there should be self-sufficient components of the detector - sensors a.k.a. tiles, segments, pixel arrays/matrix etc. We assume that
- tiles may be of different types even in a single detector,
- all tiles of the same type have identical geometry,
- by design each tile has well defined geometry of pixels which does not need in calibration,
- pixel center (x, y, z) coordinates in each tile can be defined as a look-up table for all pixels,
- each tile is represented in data as a minimal solid block of memory,
- “natural” matrix-style pixel numeration is preferable for simplicity of the tile description but is not necessarily required.
For example, CSPAD 2x1 tile pixel geometry is schematically shown below
FIG. 2: Coordinate frame of CSPAD 2x1 sensor.
The CSPAD 2x1 tile has
- 185 rows and 388 columns of pixels,
- regular pixel size is 109.92 × 109.92 μm²,
- pixel size in two middle columns 193 and 194 is 274.80 × 109.92 μm².
The pixel index and coordinates in the tile memory block of size 185×388 can be evaluated as
y = k * row + y_offset
x = f(column)
where y coordinate is proportional to the row index, while x coordinate needs to be tabulated as a function of the column index due to the gap in the tile central columns braking matrix uniformity. Detector data record consists of consecutive tile-memory blocks, in accordance with numeration adopted in DAQ. For effective memory management, some of the tile-blocks may be missing due to current detector configuration. Available configuration of the detector tile-blocks should be marked in a configuratiomn bit-mask word in positional order (bit position from lower to higher is associated with the tile number in DAQ).
Child geometry object in the parent frame
Full description of a composite detector (beside top and bottom level hierarchical objects) needs in definition of intermediate objects with their arbitrary location and orientation. Any geometry object coordinate system may have a translation and rotation with respect to the parent object, which can be defined by the 3 vectors in the setup frame as shown in Figure
FIG. 3: Child object position in the parent coordinate frame.
where
- P is a translation vector pointing from parent to its child frame origin,
- ex is a unit vector along the child frame x axis,
- ey is a unit vector along the child frame y axis.
Third unit vector ez is assumed to be right-hand triplet component, . Components of these three unit vectors form the rotation matrix
where index “j” enumerates unit vectors in the object coordinate frame, and index “i” is an object unit vector component in the parent frame (ex.: eYz is a Y component of the vector ez). Within this definition 3-d pixel coordinate “c” in the object frame can be transformed to the parent coordinate frame “C” using equation
Ci=Rij·cj + Pi
.
For practical reason we parametrize rotation matrix Rij in terms of Cardan’s angles R(α, β, γ). We assume that the 3-d rotation matrix R(α, β, γ) is a product of three 2-d rotations
R(α, β, γ) = Rx(α) · Ry(β) · Rz(γ),
around appropriate axes, defined as
This transformation algorithm is implemented in class PSCalib.GeometryObject as discussed below.
Example of composite detector
As an example we show how composite CXI-like CSPAD detector with moving quads can be inscribed in the hierarchical geometry model and how geometry parameters can be retrieved in each level.
- CSPAD 2x1 sensor (Fig. 2) is the low-level object with completely specified geometry of pixels.
- A group of eight cspad 2x1 sensors forms a quad (Fig. 4). Sensors’ positions in the quad can be measured by optical microscope.
- Four quads form a CSPAD detector. In CXI-like CSPAD quads can be moved by the stepping motor. For technical reason this detector can not be measured with optical microscope. Dedicated runs with bright images of test wires, diffraction rings, or Bragg peaks can be used to calibrate relative quad positions. Then, quads’ position variation by the stepping motor can be accounted for once calibrated quads.
- Finally, detector position relative to IP should be accounted (Fig. 6). Detector position and orientation can be measured by the ruler in the hatch for the first approximation. The same dedicated runs with bright images can be used to evaluate precise detector coordinates. Calibration runs with a few detector positions along the beam line can be helpful for full geometry parameters reconstruction.
FIG. 4: Example: 2x1 sensors’ positions in the CSPAD quad coordinate frame.
FIG. 5: Example: quads’ positions in the CSPAD detector coordinate frame.
FIG. 6: Example: detector position in the experiment coordinate frame with origin at IP.
Optical measuremets
Precise pixel coordinates can be retrieved in a few steps using
- ideal tile design geometry (Fig. 2),
- results of measurements with optical microscope,
- correction of sub-detector elements using dedicated runs.
In this section we describe a procedure of optical measurements, its potential problem, and method to fix it.
Metrology file
Optical measurements with microscope give the most precise information about sensors’ positions in the parent structure. Estimated accuracy of measurements is σRMS ∼ 10μm in x-y plane, and about the same amount in z. Optical measurements provide 3-d coordinates of 4 corners for all tiles in the (sub-)detector in some arbitrary microscope plane which coincides with detector imaging array (tiles) plane within precision of installation.
- Tile corner coordinates do not necessarily coincide with pixel centers or corners.
- Numeration of tiles in optical measurements should not necessarily coincide with their numeration in DAQ, but it should be done in expected order with indication of tile numbers.
- Optical measurements are saved in the xlsx file as a table of x, y, z coordinates for all sensor corners with records like
Tile <#>
Point <#> <X[um]> <Y[um]> <Z[um]>
- Metrology files are produced by the detector group for new or repaired detectors.
Quality check
Measurements with microscope are not automated. Results are manually saved in the metrology file, which may have non-intentional typos. If the number of typos is small they can be tracked down in the quality check and fixed. Quality check of optical measurement may test Quality check of optical measurement may include for each tile:
- equity of opposite sides
- equity of diagonals
- equity of tilt angles for all sides
- tile flatness in 3-d
Report table about all deviations is generated by the python script processing the metrology file. Large deviations exceeding standard precision >3σ(RMS) indicate on problem with measurement. A few corrections are usually applied for each metrology file.
Position of tiles in the detector
...
- 2x1 sensors' centre coordinates in the quad coordinate system as in optical measurements,
- quad origins' coordinates with respect to the point of beam crossing with the detector plane (centre of the diffraction rings), as shown on plots:
Pixel coordinates reconstruction
...
- Euler angles, Tait–Bryan angles, nautical angles, Cardan angles etc.
- Imaging Detector Geometry Implementation Notes
- Example of the file for calibration type geometry/0-end.data
Reference to doxygen documentation of classes