A clusterizer to cluster hits of a pixel detector with Python. The clustering happens in C++ on numpy arrays to increase the speed.
Project description
# Pixel Clusterizer [![Build Status](https://travis-ci.org/SiLab-Bonn/pixel_clusterizer.svg?branch=master)](https://travis-ci.org/SiLab-Bonn/pixel_clusterizer) [![Build Status](https://ci.appveyor.com/api/projects/status/github/SiLab-Bonn/pixel_clusterizer)](https://ci.appveyor.com/project/SiLab-Bonn/pixel_clusterizer)
pixel_clusterizer is an easy to use pixel hit-clusterizer for Python. It clusters hits on an event basis in space and time.
The hits have to be a numpy recarray with data types as defined in data_struct.HitInfo. The fields are: - event_number - frame - column - row - charge
Cluster information (data_struct.ClusterInfo) is created with the following fields: - event_number - ID - size - charge - seed_column - seed_row - mean_column - mean_row
Also cluster hit information (data_struct.ClusterHitInfo) is created. The cluster hit information is the hit information extended by the following fields: - cluster_ID - is_seed - cluster_size - n_cluster
# Installation
The stable code is hosted on PyPI and can be installed by typing:
pip install pixel_clusterizer
# Usage
import numpy as np
from pixel_clusterizer.clusterizer import HitClusterizer
from pixel_clusterizer import data_struct
hits = np.ones(shape=(3, ), dtype=data_struct.HitInfo) # create some data
clusterizer = HitClusterizer() # initialize clusterizer
clusterizer.add_hits(hits) # cluster hits # add hits to clusterizer
print (clusterizer.get_cluster()) # print cluster
print (clusterizer.get_hit_cluster()) # print hits + cluster info
Also take a look at the example folder!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pixel_clusterizer-1.1.1-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dfc78ff05c6f74f5fd85770362f75d88a38d2ad4e8e6d61375a0bacdad60abe |
|
MD5 | 3874b49559915c4d662d3efe77fd9adf |
|
BLAKE2b-256 | e63ce53a68892015b925ffc3a39ac5dc310fc727078955a98b27a126382cf174 |
Hashes for pixel_clusterizer-1.1.1-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4135e44b74f508bca8f6b4eeabd11c2d5a8f3e9f00e2a9cd26455bfc81f524f0 |
|
MD5 | 478c62630877be75fc2b3f35fc7566e7 |
|
BLAKE2b-256 | e862d5d36c0fd8d03e1c16648fa61166a35316f54e479d37921b728aaa2b8918 |
Hashes for pixel_clusterizer-1.1.1-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948bc259acd29c296e97313d6837193a1f832d968d9ac00de5b4c9b5df879524 |
|
MD5 | 20f0c26f3c5da19f35c13e085a6c1ab7 |
|
BLAKE2b-256 | 1a2fed5b5bcdddbce186cefc539f6326a3cca87e1d4bc8ae67d7824e6afb67b7 |
Hashes for pixel_clusterizer-1.1.1-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c5945b8cd26c8e9dc33b709333b2e21c80e21afc6ced8e25b83fa31e6287478 |
|
MD5 | 2cac8eb4bae16067b3406b2c0960cbcb |
|
BLAKE2b-256 | 503356251b5c22eeca896d7a2126886515c81565e2ebae1faf67d047998972a9 |