Interpolation

The Interpolation class implements the \(\eta\)-interpolation method. This interpolation technique is based on charge sharing: for detected photon hits (e.g. clusters), it refines the estimated photon hit using information from neighboring pixels.

See Interpolation for a more elaborate documentation and explanation of the method.

\(\eta\)-Functions:

Below is an example of the Eta class of type double. Supported are Etaf of type float and Etai of type int.

class aare._aare.Etad
property c

eta corner value cTopLeft, cTopRight, cBottomLeft, cBottomRight

property sum

photon energy of cluster

property x

eta x value

property y

eta y value

Note

The corner value c is only relevant when one uses calculate_eta_2 or calculate_full_eta2. Otherwise its default value is cTopLeft.

Supported are the following \(\eta\)-functions:

\(\eta\)-Function on 2x2 Clusters:

Eta2x2
\[\begin{equation*} {\color{blue}{\eta_x}} = \frac{Q_{1,1}}{Q_{1,0} + Q_{1,1}} \quad \quad {\color{green}{\eta_y}} = \frac{Q_{1,1}}{Q_{0,1} + Q_{1,1}} \end{equation*}\]

The \(\eta\) values can range between 0,1. Note they only range between 0,1 because the position of the center pixel (red) can change. If the center pixel is in the bottom left pixel \(\eta_x\) will be close to zero. If the center pixel is in the bottom right pixel \(\eta_y\) will be close to 1.

aare.calculate_eta2(*args, **kwargs)

Overloaded function.

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster3x3i) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster3x3i) -> aare::Eta2<int>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster3x3d) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster3x3d) -> aare::Eta2<double>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster3x3f) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster3x3f) -> aare::Eta2<float>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster2x2i) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster2x2i) -> aare::Eta2<int>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster2x2d) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster2x2d) -> aare::Eta2<double>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster2x2f) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster2x2f) -> aare::Eta2<float>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster5x5i) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster5x5i) -> aare::Eta2<int>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster5x5d) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster5x5d) -> aare::Eta2<double>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster5x5f) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster5x5f) -> aare::Eta2<float>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster7x7i) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster7x7i) -> aare::Eta2<int>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster7x7d) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster7x7d) -> aare::Eta2<double>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster7x7f) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster7x7f) -> aare::Eta2<float>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster9x9i) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster9x9i) -> aare::Eta2<int>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster9x9d) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster9x9d) -> aare::Eta2<double>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster9x9f) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster9x9f) -> aare::Eta2<float>

calculates eta2x2

  1. calculate_eta2(clusters: aare._aare.ClusterVector_Cluster3x3i16) -> numpy.ndarray

calculates eta2x2

  1. calculate_eta2(cluster: aare._aare.Cluster3x3i16) -> aare::Eta2<short>

calculates eta2x2

Full \(\eta\)-Function on 2x2 Clusters:

Eta2x2 Full
\[\begin{equation*} {\color{blue}{\eta_x}} = \frac{Q_{0,1} + Q_{1,1}}{\sum_{i=0}^{1}\sum_{j=0}^{1}Q_{i,j}} \quad \quad {\textcolor{green}{\eta_y}} = \frac{Q_{1,0} + Q_{1,1}}{\sum_{i=0}^{1}\sum_{j=0}^{1}Q_{i,j}} \end{equation*}\]

The \(\eta\) values can range between 0,1. Note they only range between 0,1 because the position of the center pixel (red) can change. If the center pixel is in the bottom left pixel \(\eta_x\) will be close to zero. If the center pixel is in the bottom right pixel \(\eta_y\) will be close to 1.

aare.calculate_full_eta2(*args, **kwargs)

Overloaded function.

  1. calculate_full_eta2(cluster: aare._aare.Cluster3x3i) -> aare::Eta2<int>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster3x3i) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster3x3d) -> aare::Eta2<double>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster3x3d) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster3x3f) -> aare::Eta2<float>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster3x3f) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster2x2i) -> aare::Eta2<int>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster2x2i) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster2x2d) -> aare::Eta2<double>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster2x2d) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster2x2f) -> aare::Eta2<float>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster2x2f) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster5x5i) -> aare::Eta2<int>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster5x5i) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster5x5d) -> aare::Eta2<double>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster5x5d) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster5x5f) -> aare::Eta2<float>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster5x5f) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster7x7i) -> aare::Eta2<int>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster7x7i) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster7x7d) -> aare::Eta2<double>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster7x7d) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster7x7f) -> aare::Eta2<float>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster7x7f) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster9x9i) -> aare::Eta2<int>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster9x9i) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster9x9d) -> aare::Eta2<double>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster9x9d) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster9x9f) -> aare::Eta2<float>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster9x9f) -> numpy.ndarray

calculates full eta2x2

  1. calculate_full_eta2(cluster: aare._aare.Cluster3x3i16) -> aare::Eta2<short>

calculates full eta2x2

  1. calculate_full_eta2(clusters: aare._aare.ClusterVector_Cluster3x3i16) -> numpy.ndarray

calculates full eta2x2

Full \(\eta\)-Function on 3x3 Clusters:

Eta3x3
\[\begin{equation*} {\color{blue}{\eta_x}} = \frac{\sum_{i=0}^{2} Q_{i,2} - \sum_{i=0}^{2} Q_{i,0}}{\sum_{i=0}^{2}\sum_{j}^{3} Q_{i,j}} \quad \quad {\color{green}{\eta_y}} = \frac{\sum_{j=0}^{2} Q_{2,j} - \sum_{j=0}^{2} Q_{0,j}}{\sum_{i=0}^{2}\sum_{j}^{3} Q_{i,j}} \end{equation*}\]

The \(\eta\) values can range between -0.5,0.5.

aare.calculate_eta3(*args, **kwargs)

Overloaded function.

  1. calculate_eta3(clusters: aare._aare.ClusterVector_Cluster3x3i) -> numpy.ndarray

calculates eta3x3 using entire cluster

  1. calculate_eta3(cluster: aare._aare.Cluster3x3i) -> aare::Eta2<int>

calculates eta3x3 using entire cluster

  1. calculate_eta3(clusters: aare._aare.ClusterVector_Cluster3x3d) -> numpy.ndarray

calculates eta3x3 using entire cluster

  1. calculate_eta3(cluster: aare._aare.Cluster3x3d) -> aare::Eta2<double>

calculates eta3x3 using entire cluster

  1. calculate_eta3(clusters: aare._aare.ClusterVector_Cluster3x3f) -> numpy.ndarray

calculates eta3x3 using entire cluster

  1. calculate_eta3(cluster: aare._aare.Cluster3x3f) -> aare::Eta2<float>

calculates eta3x3 using entire cluster

  1. calculate_eta3(clusters: aare._aare.ClusterVector_Cluster3x3i16) -> numpy.ndarray

calculates eta3x3 using entire cluster

  1. calculate_eta3(cluster: aare._aare.Cluster3x3i16) -> aare::Eta2<short>

calculates eta3x3 using entire cluster

Cross \(\eta\)-Function on 3x3 Clusters:

Cross Eta3x3
\[\begin{equation*} {\color{blue}{\eta_x}} = \frac{Q_{1,2} - Q_{1,0}}{Q_{1,0} + Q_{1,1} + Q_{1,2}} \quad \quad {\color{green}{\eta_y}} = \frac{Q_{0,2} - Q_{0,1}}{Q_{0,1} + Q_{1,1} + Q_{2,1}} \end{equation*}\]

The \(\eta\) values can range between -0.5,0.5.

aare.calculate_cross_eta3(*args, **kwargs)

Overloaded function.

  1. calculate_cross_eta3(clusters: aare._aare.ClusterVector_Cluster3x3i) -> numpy.ndarray

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(cluster: aare._aare.Cluster3x3i) -> aare::Eta2<int>

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(clusters: aare._aare.ClusterVector_Cluster3x3d) -> numpy.ndarray

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(cluster: aare._aare.Cluster3x3d) -> aare::Eta2<double>

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(clusters: aare._aare.ClusterVector_Cluster3x3f) -> numpy.ndarray

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(cluster: aare._aare.Cluster3x3f) -> aare::Eta2<float>

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(clusters: aare._aare.ClusterVector_Cluster3x3i16) -> numpy.ndarray

calculates eta3x3 taking into account cross pixels in cluster

  1. calculate_cross_eta3(cluster: aare._aare.Cluster3x3i16) -> aare::Eta2<short>

calculates eta3x3 taking into account cross pixels in cluster

Interpolation class for \(\eta\)-Interpolation

Warning

Make sure to use the same \(\eta\)-function during interpolation as given by the joint \(\eta\)-distribution passed to the constructor.

Warning

The interpolation might lead to erroneous photon positions for clusters at the boarders of a frame. Make sure to filter out such cases.

Note

Make sure to use resonable energy bins, when constructing the joint distribution. If data is too sparse for a given energy the interpolation will lead to erreneous results.

class aare.Interpolator
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: aare._aare.Interpolator, etacube: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], xbins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ybins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ebins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> None

    Constructor

    Args:

    etacube:

    joint distribution of eta_x, eta_y and photon energy (Note: for the joint distribution first dimension is eta_x, second: eta_y, third: energy bins.)

    xbins:

    bin edges of etax

    ybins:

    bin edges of etay

    ebins:

    bin edges of photon energy

  2. __init__(self: aare._aare.Interpolator, xbins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ybins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ebins: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> None

    Constructor

    Args:

    xbins:

    bin edges of etax

    ybins:

    bin edges of etay

    ebins:

    bin edges of photon energy

get_ietax(self: aare._aare.Interpolator) numpy.ndarray

conditional CDF of etax conditioned on etay, marginal CDF of etax (if rosenblatt transform applied)

get_ietay(self: aare._aare.Interpolator) numpy.ndarray

conditional CDF of etay conditioned on etax

interpolate(*args, **kwargs)

Overloaded function.

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

  1. interpolate(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on eta2

Returns:

interpolated photons

interpolate_cross_eta3(*args, **kwargs)

Overloaded function.

  1. interpolate_cross_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on cross eta3

Returns:

interpolated photons

  1. interpolate_cross_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on cross eta3

Returns:

interpolated photons

  1. interpolate_cross_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on cross eta3

Returns:

interpolated photons

interpolate_eta3(*args, **kwargs)

Overloaded function.

  1. interpolate_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta3

Returns:

interpolated photons

  1. interpolate_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta3

Returns:

interpolated photons

  1. interpolate_eta3(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta3

Returns:

interpolated photons

interpolate_full_eta2(*args, **kwargs)

Overloaded function.

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)3, (unsigned char)3, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<int, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<float, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

  1. interpolate_full_eta2(self: aare._aare.Interpolator, cluster_vector: aare::ClusterVector<aare::Cluster<double, (unsigned char)2, (unsigned char)2, unsigned short>, void>) -> numpy.ndarray

interpolation based on full eta2

Returns:

interpolated photons

rosenblatttransform(self: aare._aare.Interpolator, etacube: Annotated[numpy.typing.ArrayLike, numpy.float64]) None

calculated the rosenblatttransform for the given distribution

etacube:

joint distribution of eta_x, eta_y and photon energy (Note: for the joint distribution first dimension is eta_x, second: eta_y, third: energy bins.)

transform_eta_values(*args, **kwargs)

Overloaded function.

  1. transform_eta_values(self: aare._aare.Interpolator, Eta: aare::Eta2<int>) -> tuple[float, float]

eta.x eta.y transformed to uniform coordinates based on CDF ietax, ietay

  1. transform_eta_values(self: aare._aare.Interpolator, Eta: aare::Eta2<float>) -> tuple[float, float]

eta.x eta.y transformed to uniform coordinates based on CDF ietax, ietay

  1. transform_eta_values(self: aare._aare.Interpolator, Eta: aare::Eta2<double>) -> tuple[float, float]

eta.x eta.y transformed to uniform coordinates based on CDF ietax, ietay