Detector Geometry¶
1M Detector Geometry¶
-
template<typename G>
class foam::Detector1MGeometryBase¶ Base class for geometry of 1M detectors like AGIPD-1M, LPD-1M and DSSC-1M.
These kind of detectors consist of four quadrants, with each quadrant consisting of four modules. Each module is further combined by multiple tiles. However, the number of tiles and number of tiles depends on the detector type.
Subclassed by foam::AGIPD_1MGeometry
Public Functions
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageArray> = false, EnableIf<E, IsImage> = false>
void positionAllModules(M &&src, E &dst, bool ignore_tile_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – data in modules. shape=(modules, y, x)
dst – assembled image. shape=(y, x)
ignore_tile_edge – true for ignoring the pixels at the edges of tiles. If dst is pre-filled with nan, it it equivalent to masking the tile edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsModulesArray> = false, EnableIf<E, IsImageArray> = false>
void positionAllModules(M &&src, E &dst, bool ignore_tile_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – multi-pulse, multiple-module data. shape=(memory cells, modules, y, x)
dst – assembled data. shape=(memory cells, y, x)
ignore_tile_edge – true for ignoring the pixels at the edges of tiles. If dst is pre-filled with nan, it it equivalent to masking the tile edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsModulesVector> = false, EnableIf<E, IsImageArray> = false>
void positionAllModules(M &&src, E &dst, bool ignore_tile_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – a vector of module data, which has a shape of (modules, y, x)
dst – assembled data. shape=(memory cells, y, x)
ignore_tile_edge – true for ignoring the pixels at the edges of tiles. If dst is pre-filled with nan, it it equivalent to masking the tile edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImage> = false, EnableIf<E, IsImageArray> = false>
void dismantleAllModules(M &&src, E &dst) const¶ Dismantle an assembled image into modules.
- Parameters
src – assembled data (y, x)
dst – data in modules. shape=(modules, y, x)
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageArray> = false, EnableIf<E, IsModulesArray> = false>
void dismantleAllModules(M &&src, E &dst) const¶ Dismantle all assembled images into modules.
- Parameters
src – assembled data (memory cells, y, x)
dst – data in modules. shape=(memory cells, modules, y, x)
-
const ShapeType &assembledShape() const¶
Return the shape (y, x) of the assembled image.
-
const CenterType &assembledCenter() const¶
Return the center (x, y) of the assembled image.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageArray> = false, EnableIf<E, IsImage> = false>
-
class AGIPD_1MGeometry : public foam::Detector1MGeometryBase<AGIPD_1MGeometry>¶
AGIPD-1M geometry.
Layout of AGIPD-1M: Tile layout for each module: (looking along the beam)
Q3M1 | Q2M1 Q3M2 | Q2M2 Q3M3 | Q2M3 Q3M4 | Q2M4Q4M1 | Q1M1 Q1 and Q2: T8 T7 T6 T5 T4 T3 T2 T1 Q4M2 | Q1M2 Q3 and q4: T1 T2 T3 T4 T5 T6 T7 T8 Q4M3 | Q1M3 Q4M4 | Q1M4
The quadrant positions refer to the first pixel (top-right corners for Q1, Q2 and bottom-left corners for Q3, Q4) of the first module in each quadrant.
For details, please see https://extra-geom.readthedocs.io/en/latest/geometry.html#agipd-1m
-
class LPD_1MGeometry : public foam::Detector1MGeometryBase<LPD_1MGeometry>¶
LPD-1M geometry.
Layout of LPD-1M: Tile layout for each module: (looking along the beam)
Q4M4 Q4M1 | Q1M4 Q1M1 T16 T01 | T15 T02 | T14 T03 Q4M3 Q4M2 | Q1M3 Q1M2 T13 T05 ——————– T12 T05 Q3M4 Q3M1 | Q2M4 Q2M1 T11 T06 | T10 T07 | T09 T08 Q3M3 Q3M2 | Q2M3 Q2M2
The quadrant positions refer to the corner of each quadrant where module 4, tile 16 is positioned. This is the corner of the last pixel as the data is stored. In the initial detector layout, the corner positions are for the top left corner of the quadrant, looking along the beam.
For details, please see https://extra-geom.readthedocs.io/en/latest/geometry.html#lpd-1m
-
class DSSC_1MGeometry : public foam::Detector1MGeometryBase<DSSC_1MGeometry>¶
DSSC-1M geometry.
Layout of DSSC-1M: (looking along the beam)
Q3M1 | Q2M4 Q3M2 | Q2M3 Q3M3 | Q2M2 Q3M4 | Q2M1Q4M1 | Q1M4 Q4M2 | Q1M3 Q4M3 | Q1M2 Q4M4 | Q1M1
The quadrant positions refer to the bottom-right corner of each quadrant, looking along the beam.
Generalized Geometry¶
-
template<typename Detector>
class foam::DetectorGeometry¶ Base class for generalized detector geometry.
For detectors like JungFrau, it is possible to use a single module or the combination of multiple modules during experiments. Unlike the 1M detectors, the number of modules is variable and the way of stacking them is still unclear. On the other hand, each module is consisting of multiple ASICs and there is no tile.
When more than one modules are combined, the layout of modules is defined by the enum class GeometryLayout:
TopRightCW: the first module starts at top-right, the modules are arranged in clockwise order. For example:
M3 | M2
BottomRightCCW: the first module starts at bottom-right, the modules are arranged in counter clockwise order. For example:
M4 | M1
BottomLeftCW: the first module starts at bottom-left, the modules are arranged in clockwise order. For example:
M1 | M4
TopLeftCCW: the first module starts at top-left, the modules are arranged in counter clockwise order. For example:
M2 | M3
Since module data is passed by an array, there is no information about the real index of the module. Therefore, the modules are arranged by their indices. One can achieve the following layout simply by passing an array-like data as [M1, M2, M3, M6, M7, M8].
M6 | M1 ------- M5 | M2 ------- M4 | M3
Public Functions
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageArray> = false, EnableIf<E, IsImage> = false>
void positionAllModules(M &&src, E &dst, bool ignore_asic_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – data in modules. shape=(modules, y, x)
dst – assembled image. shape=(y, x)
ignore_asic_edge – true for ignoring the pixels at the edges of asics. If dst is pre-filled with nan, it it equivalent to masking the asic edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageVector> = false, EnableIf<E, IsImage> = false>
void positionAllModules(M &&src, E &dst, bool ignore_asic_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – a vector of modules data, which has a shape of (y, x)
dst – assembled image. shape=(y, x)
ignore_asic_edge – true for ignoring the pixels at the edges of asics. If dst is pre-filled with nan, it it equivalent to masking the asic edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsModulesArray> = false, EnableIf<E, IsImageArray> = false>
void positionAllModules(M &&src, E &dst, bool ignore_asic_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – multi-pulse, multiple-module data. shape=(memory cells, modules, y, x)
dst – assembled data. shape=(memory cells, y, x)
ignore_asic_edge – true for ignoring the pixels at the edges of asics. If dst is pre-filled with nan, it it equivalent to masking the asic edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsModulesVector> = false, EnableIf<E, IsImageArray> = false>
void positionAllModules(M &&src, E &dst, bool ignore_asic_edge = false) const¶ Position all the modules at the correct area of the given assembled image.
- Parameters
src – a vector of module data, which has a shape of (modules, y, x)
dst – assembled data. shape=(memory cells, y, x)
ignore_asic_edge – true for ignoring the pixels at the edges of asics. If dst is pre-filled with nan, it it equivalent to masking the asic edges.
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImage> = false, EnableIf<E, IsImageArray> = false>
void dismantleAllModules(M &&src, E &dst) const¶ Dismantle an assembled image into modules.
- Parameters
src – assembled data (y, x)
dst – data in modules. shape=(modules, y, x)
-
template<typename M, typename E, EnableIf<std::decay_t<M>, IsImageArray> = false, EnableIf<E, IsModulesArray> = false>
void dismantleAllModules(M &&src, E &dst) const¶ Dismantle all assembled images into modules.
- Parameters
src – assembled data (memory cells, y, x)
dst – data in modules. shape=(memory cells, modules, y, x)
-
const ShapeType &assembledShape() const¶
Return the shape (y, x) of the assembled image.
-
const CenterType &assembledCenter() const¶
Return the center (x, y) of the assembled image.
-
size_t nModules() const¶
Return the number of modules.
-
const ShapeType &moduleShape() const¶
Return the shape (y, x) of a module.
-
const ShapeType &asicShape() const¶
Return the shape (y, x) of a ASIC.