Skip to content

coordinate_mappers

static_interpolation.coordinate_mappers

Classes:

Name Description
CoordinateMapper

Abstract base class for mapping SamplingPoints onto pixel coordinates of the image layout.

IdentityMapper

Simplest possible mapper, it does nothing.

GeometryMapper

Mapper Base class for all Mappers that use panel coordinate definitions and/or DetectorGeometryBase instances.

ZProjectionMapper

Projetcts 2D coordinates in a plane orthogonal to the z axis onto the pixel panels.

EwaldSphereMapper

Maps polar coordinates on the Ewald's sphere onto the pixel planes.

CoordinateMapper [source]

Bases: ABC

Abstract base class for mapping SamplingPoints onto pixel coordinates of the image layout.

Methods:

Name Description
map

Maps points of a given sampling_grid onto pixel coordinates in the given image layout.

map(sampling_grid, layout) [source] abstractmethod

Maps points of a given sampling_grid onto pixel coordinates in the given image layout.

Parameters:

Name Type Description Default
sampling_grid SamplingGrid

input sampling_grid.

required
layout ImageLayout

input image layout.

required

Returns:

Name Type Description
NDArray SamplingGrid

sampling_grid.points in pixel coordinates.

IdentityMapper [source]

Bases: CoordinateMapper

Simplest possible mapper, it does nothing.

GeometryMapper [source]

Bases: CoordinateMapper

Mapper Base class for all Mappers that use panel coordinate definitions and/or DetectorGeometryBase instances.

Attributes:

Name Type Description
origins NDArray

(n_panels,3),np.float64| Starting corner positions of the pixel panels.

origins_center NDArray

(n_panels,3),np.float64| Pixel center of the pixel in the starting corner of each panel.

xdirs NDArray

(n_panels,3),np.float64| Vectors pointing along the x-direction edge of the first pixel in each panel. Their length needs to be equal to the pixel length.

ydirs NDArray

(n_panels,3),np.float64| Vectors pointing along the y-direction edge of the first pixel in each panel. Their length needs to be equal to the pixel length.

n_panels int

Number of panels.

Methods:

Name Description
validate

Validates self.n_panels against the given sampling_grid.n_panels and layout.n_panels.

parse_geometry

Translates a Detector geometry + sample detector origin into origin,xdirs,ydirs

from_geometry

Constructor based on DetectorGeometryBase instance.

origins_center property

center positions of the first pixel of each panel

validate(sampling_grid, layout) [source]

Validates self.n_panels against the given sampling_grid.n_panels and layout.n_panels. On Mismatch raises a ValueError Args: sampling_grid (SamplingGrid): Input sampling grid layout (ImageLayout): Input image layout

parse_geometry(geom, detector_origin=None) [source] staticmethod

Translates a Detector geometry + sample detector origin into origin,xdirs,ydirs Args: geom (DetectorGeometryBase): extra_geom.detectors.DetectorGeometryBase instance whose modules are interpreted as image panels. detector_origin (NDArray): x,y,z coordinates of the detector origin. Returns: tuple(NDarray,NDArray,NDArray): origins,xdirs,ydirs

from_geometry(geom, detector_origin=None) [source] classmethod

Constructor based on DetectorGeometryBase instance.

Parameters:

Name Type Description Default
geom DetectorGeometryBase

geometry instance

required
detector_origin NDArray

x,y,z coordinates of the detector origin.

None

Returns:

Name Type Description
GeometryMapper

Class instance

ZProjectionMapper [source]

Bases: GeometryMapper

Projetcts 2D coordinates in a plane orthogonal to the z axis onto the pixel panels.

Methods:

Name Description
map

Takes a SamplingGrid and an image layout and uses the classes origins,xdir and ydir to create a new SamplingGrid.

map(sample_grid, layout) [source]

Takes a SamplingGrid and an image layout and uses the classes origins,xdir and ydir to create a new SamplingGrid. The points of the new grid are created by extending a line from each old point along the z-Axis until it hits a panel plane. New points are represented in units of pixel sizes. Args: sample_grid (SamplingGrid): input SamplingGrid layout (ImageLayout): input ImageLayout

Returns:

Name Type Description
SamplingGrid SamplingGrid

Sampling grid with points in pixel units.

EwaldSphereMapper [source]

Bases: GeometryMapper

Maps polar coordinates on the Ewald's sphere onto the pixel planes.

Parameters:

Name Type Description Default
xray_energy float

X-ray energy in electron Volt [eV].

required

Methods:

Name Description
from_geometry

Overriding baseclass constructor from_geometry to take the extra xray_energy variable into account

from_geometry(geom, detector_origin, xray_energy) [source] classmethod

Overriding baseclass constructor from_geometry to take the extra xray_energy variable into account

Parameters:

Name Type Description Default
geom DetectorGeometryBase

extra_geom DetectorGeometryBase instance. Its modules define the planes.

required
detector_origin NDArray

x,y,z coordinates of detector origin in meters [m].

required
xray_energy float

X-ray energy in electron Volt [eV].

required

Returns:

Name Type Description
EwaldSphereMapper

[description]