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/DavidLP/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.0.3-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1218f3cc7ee61523e08e44fa9e0789844c5d77d790eb37f4fed0f7cd54cb76c4 |
|
MD5 | 839fcb37330404be6f45f3c698ba3f26 |
|
BLAKE2b-256 | bc48b9f6e0cc30069d998cda1f5128afc2a9cd405fb9e0d957f68ea735be362e |
Hashes for pixel_clusterizer-1.0.3-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fc04194205099013031b42bd3d4c07dbdfcf60e82cc52d48394b170db4ca891 |
|
MD5 | abd8c1b78e1a550b9f40bfce65440230 |
|
BLAKE2b-256 | ebdaed0dd06220061b36c8dbc4d01f9cc23a39ee90b51d086d2cad7b77aa5814 |
Hashes for pixel_clusterizer-1.0.3-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6a7a45f2fbc7afe353463fee05166de559eca3d4c612ed5260f27273e3f7b8 |
|
MD5 | 8dc84e23bfad40a1d3206b5b6ab7da56 |
|
BLAKE2b-256 | 30c18b5e9e70fc4af7eb9471f83c87baa5d2d85b2e39b014ff85863067660bdd |
Hashes for pixel_clusterizer-1.0.3-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82aa93d86e5b7209068aa6f9e122b2840d0bf003872f3536bd25b5a863d0ab66 |
|
MD5 | 6ee28a5086201933d0a09a14d21f2339 |
|
BLAKE2b-256 | 30a202b6af5f4962ab2d305d98cf64080076938d9e285ada936425050e680849 |