diff --git a/.travis.yml b/.travis.yml index 102fc06..9cfbfbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,6 @@ deploy: secure: EOfeXP4oyoNLY8Ot2/pX3k2Acvk5Xn0VkBeqXHND/rjm4iveUGrLbMDOffDnvkFgSYQ6PO/UqZjSb8vPd5nQ1Uhw8YyEhXUTPVWOz7ebq/xOmI8DIpFQH24/u7K3D9ygm7mlN3ozz9/6Gvk2VXk8OUT8csMtIJ586FnNBFdq0XVXzneHx6Ppr4GvAvh5Li5dd0ZqL1Cd2JZZyhWbQzidJgBkU1NOD7pRmEPh7dfG23rOEuzHQPyip8PKw86ErbjRD6WevjyFsetT66je3G8+ZSvJIDNVQ95oohhBZ7bRA+VwHnt2MdWxBYSAq7ZxbNmcs5LsvuNiJRyGo9Iue97yKI/EX0GzK/mA0pO/kdu0n1BzXxVePtxBOxLgzmEKs2S0IV45zdlAIfOjs7gLM8mHjiFC6oFuDddKPp5dYRMpOERt3jfQVBbSWpGkN4tcwXZ/1xMm1IxTaU06YQMLKtRqo2N5k9aWMSsvFfagQ44WW658ra/15TdaZyniBCiYQ0a3NDYEpjZX4n4Sh0JDcGqlyOJcpcq+gl2NaIADX+X6Qoe6C7s036LowfoTDh83X72hjvm8smrdGL1op7DQo3dGxwU6FRvf78Qw528v2CkrdTHzIOr5IEuZkh+xGiGJE2UDTwHdq/nAr+O79s2yAakvf/DL/s8ZU+MvZ21dobtnLAg= on: tags: true - repo: SiLab-Bonn/pyBAR_mimosa26_interpreter + repo: SiLab-Bonn/pymosa_mimosa26_interpreter skip_existing: true distributions: sdist bdist_wheel diff --git a/README.md b/README.md index 1574350..fd15cb1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Mimosa26 Interpreter [![Build Status](https://travis-ci.org/SiLab-Bonn/pyBAR_mimosa26_interpreter.svg?branch=master)](https://travis-ci.org/SiLab-Bonn/pyBAR_mimosa26_interpreter) [![Build status](https://ci.appveyor.com/api/projects/status/6ur82s62x9hs7mj4?svg=true)](https://ci.appveyor.com/project/laborleben/pybar-mimosa26-interpreter) +# Mimosa26 Interpreter [![Build Status](https://travis-ci.org/SiLab-Bonn/pymosa_mimosa26_interpreter.svg?branch=master)](https://travis-ci.org/SiLab-Bonn/pymosa_mimosa26_interpreter) [![Build status](https://ci.appveyor.com/api/projects/status/6ur82s62x9hs7mj4?svg=true)](https://ci.appveyor.com/project/laborleben/pymosa-mimosa26-interpreter) -pyBAR_mimosa26_interpreter - A Mimosa26 raw data interpreter in Python. +pymosa_mimosa26_interpreter - A Mimosa26 raw data interpreter in Python. Interpreter for [Mimosa26](http://www.iphc.cnrs.fr/List-of-MIMOSA-chips.html) raw data recorded with [pymosa](https://github.com/SiLab-Bonn/pymosa) DAQ. @@ -26,8 +26,8 @@ pip install . ## Usage An example script which does the raw data interpretation as well as the creation of a hit table -is located in the [`examples`](https://github.com/SiLab-Bonn/pyBAR_mimosa26_interpreter/blob/master/examples/) folder. The ouput file can be used with [Beam Telescope Analysis (BTA)](https://github.com/SiLab-Bonn/beam_telescope_analysis). +is located in the [`examples`](https://github.com/SiLab-Bonn/pymosa_mimosa26_interpreter/blob/master/examples/) folder. The ouput file can be used with [Beam Telescope Analysis (BTA)](https://github.com/SiLab-Bonn/beam_telescope_analysis). ## Support -Please use GitHub's [issue tracker](https://github.com/SiLab-Bonn/pyBAR_mimosa26_interpreter/issues) for bug reports/feature requests/questions. +Please use GitHub's [issue tracker](https://github.com/SiLab-Bonn/pymosa_mimosa26_interpreter/issues) for bug reports/feature requests/questions. diff --git a/docs/m26_interpreter.rst b/docs/m26_interpreter.rst index 40a6bbf..37d7ac1 100644 --- a/docs/m26_interpreter.rst +++ b/docs/m26_interpreter.rst @@ -5,7 +5,7 @@ Installation Install the required packages: .. code-block:: bash - + conda install numba numpy tables matplotlib tqdm Then install the Mimosa26 interpreter: @@ -14,7 +14,7 @@ Then install the Mimosa26 interpreter: python setup.py develop - + .. toctree:: :numbered: @@ -27,8 +27,8 @@ Due to the fact that `pymosa `_ features c Within this package the event building is done by assigning trigger words (from TLU) to data of one Mimosa26 frame, see the event building section. Notes: - - Due to the fact that trigger words have to be assigned to Mimosa26 frame data it is mandatory to choose the combined - (15 bit trigger timestamp and 16 bit trigger number) trigger data format (trigger data format : 2). + - Due to the fact that trigger words have to be assigned to Mimosa26 frame data it is mandatory to choose the combined + (15 bit trigger timestamp and 16 bit trigger number) trigger data format (trigger data format : 2). This is default data format used in `pymosa `_. @@ -36,7 +36,7 @@ Raw data interpretation ======================== The result of the raw data analysis is stored into a hit table containing events of all Mimosa26 planes. The event building is done using the TLU words (see Event building section) -Additionally, for each plane an occupancy map is stored and an event status histogram is created. +Additionally, for each plane an occupancy map is stored and an event status histogram is created. The raw data structure of Mimosa26 data looks as follows: - Frame header HIGH and LOW (contains timestamp, generated from R/O, indicates the start of a Mimosa26 frame) @@ -46,7 +46,7 @@ The raw data structure of Mimosa26 data looks as follows: - ... - ... - Frame tailer HIGH and LOW (indicates the end of a Mimosa26 frame) - + Every Mimosa26 raw data word (32 bit) is composed as follows @@ -59,8 +59,8 @@ The trigger word (32 bit) is composed as follows +--------------------+--------------------+ | HEADER (1 bit) = 1 | DATA WORD (31 bit) | +--------------------+--------------------+ - - + + Note: - HEADER = 0x20 (from R/0) - IDENTYFIER = 1 - 6 (plane identyfier, from R/0) @@ -88,7 +88,7 @@ In analogy to this the stop timestamp of the integration time is calculated by .. math:: T_\text{stop} = T_\text{start} + f_0 + T_\text{offset}. - + Using the readout window for each row (frame) data for every readout window one (or multiple) trigger timestamp(s) can be assigned to it, if the trigger timestamp lies within this specific row window. In this way to each Mimosa26 frame data a trigger timestamp is assigned defining one event. @@ -130,8 +130,8 @@ The following table shows the possible event stati (8 bit): Methods ------- -.. autofunction:: pyBAR_mimosa26_interpreter.raw_data_interpreter._interpret_raw_data -.. autofunction:: pyBAR_mimosa26_interpreter.raw_data_interpreter._build_events +.. autofunction:: pymosa_mimosa26_interpreter.raw_data_interpreter._interpret_raw_data +.. autofunction:: pymosa_mimosa26_interpreter.raw_data_interpreter._build_events Usage ====== @@ -149,6 +149,6 @@ A full example which interpretes the raw data and converts the hit tables into a Methods ------- -.. autoclass:: pyBAR_mimosa26_interpreter.data_interpreter.DataInterpreter +.. autoclass:: pymosa_mimosa26_interpreter.data_interpreter.DataInterpreter diff --git a/examples/example.py b/examples/example.py index 3db33ca..75f90af 100644 --- a/examples/example.py +++ b/examples/example.py @@ -12,8 +12,8 @@ from contextlib2 import ExitStack -from pyBAR_mimosa26_interpreter import data_interpreter -from pyBAR_mimosa26_interpreter import raw_data_interpreter +from pymosa_mimosa26_interpreter import data_interpreter +from pymosa_mimosa26_interpreter import raw_data_interpreter from beam_telescope_analysis.hit_analysis import default_hits_dtype @@ -37,9 +37,9 @@ def process_dut(raw_data_file, output_filename=None, output_filenames=None, anal Trigger/TLU FSM data mode. analyze_m26_header_ids : list List of Mimosa26 header IDs that will be interpreted. - If None, the value defaults to the global value pyBAR_mimosa26_interpreter.raw_data_interpreter.DEFAULT_PYMOSA_M26_HEADER_IDS. + If None, the value defaults to the global value pymosa_mimosa26_interpreter.raw_data_interpreter.DEFAULT_PYMOSA_M26_HEADER_IDS. timing_offset : int - Timing offset for the pyBAR_mimosa26_interpreter. The value has impact on the start of frame to trigger word alignment. + Timing offset for the pymosa_mimosa26_interpreter. The value has impact on the start of frame to trigger word alignment. Returns ------- @@ -69,7 +69,7 @@ def format_hit_table(input_filename, output_filenames=None, analyze_m26_header_i If None, the filenames will be generated. analyze_m26_header_ids : list List of Mimosa26 header IDs that will be interpreted. - If None, the value defaults to the global value pyBAR_mimosa26_interpreter.raw_data_interpreter.DEFAULT_PYMOSA_M26_HEADER_IDS. + If None, the value defaults to the global value pymosa_mimosa26_interpreter.raw_data_interpreter.DEFAULT_PYMOSA_M26_HEADER_IDS. chunk_size : uint Chunk size of the data when reading from file. @@ -133,5 +133,5 @@ def format_hit_table(input_filename, output_filenames=None, analyze_m26_header_i if __name__ == "__main__": # Single file processing # Input raw data filename - raw_data_file = '../pyBAR_mimosa26_interpreter/testing/anemone_raw_data.h5' + raw_data_file = '../pymosa_mimosa26_interpreter/testing/anemone_raw_data.h5' process_dut(raw_data_file=raw_data_file, output_filename="./anemone_interpreted.h5", trigger_data_format=2) diff --git a/pyBAR_mimosa26_interpreter/__init__.py b/pymosa_mimosa26_interpreter/__init__.py similarity index 69% rename from pyBAR_mimosa26_interpreter/__init__.py rename to pymosa_mimosa26_interpreter/__init__.py index fb50eb0..2bb2125 100644 --- a/pyBAR_mimosa26_interpreter/__init__.py +++ b/pymosa_mimosa26_interpreter/__init__.py @@ -1,3 +1,3 @@ # http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package from pkg_resources import get_distribution -__version__ = get_distribution('pyBAR_mimosa26_interpreter').version +__version__ = get_distribution('pymosa_mimosa26_interpreter').version diff --git a/pyBAR_mimosa26_interpreter/data_interpreter.py b/pymosa_mimosa26_interpreter/data_interpreter.py similarity index 99% rename from pyBAR_mimosa26_interpreter/data_interpreter.py rename to pymosa_mimosa26_interpreter/data_interpreter.py index d815ed7..76caf19 100644 --- a/pyBAR_mimosa26_interpreter/data_interpreter.py +++ b/pymosa_mimosa26_interpreter/data_interpreter.py @@ -15,9 +15,9 @@ except ImportError: pass -from pyBAR_mimosa26_interpreter import raw_data_interpreter +from pymosa_mimosa26_interpreter import raw_data_interpreter try: - from pyBAR_mimosa26_interpreter import plotting + from pymosa_mimosa26_interpreter import plotting except ImportError: pass diff --git a/pyBAR_mimosa26_interpreter/plotting.py b/pymosa_mimosa26_interpreter/plotting.py similarity index 100% rename from pyBAR_mimosa26_interpreter/plotting.py rename to pymosa_mimosa26_interpreter/plotting.py diff --git a/pyBAR_mimosa26_interpreter/raw_data_interpreter.py b/pymosa_mimosa26_interpreter/raw_data_interpreter.py similarity index 100% rename from pyBAR_mimosa26_interpreter/raw_data_interpreter.py rename to pymosa_mimosa26_interpreter/raw_data_interpreter.py diff --git a/pyBAR_mimosa26_interpreter/testing/__init__.py b/pymosa_mimosa26_interpreter/testing/__init__.py similarity index 100% rename from pyBAR_mimosa26_interpreter/testing/__init__.py rename to pymosa_mimosa26_interpreter/testing/__init__.py diff --git a/pyBAR_mimosa26_interpreter/testing/anemone_raw_data.h5 b/pymosa_mimosa26_interpreter/testing/anemone_raw_data.h5 similarity index 100% rename from pyBAR_mimosa26_interpreter/testing/anemone_raw_data.h5 rename to pymosa_mimosa26_interpreter/testing/anemone_raw_data.h5 diff --git a/pyBAR_mimosa26_interpreter/testing/anemone_raw_data_interpreted.h5 b/pymosa_mimosa26_interpreter/testing/anemone_raw_data_interpreted.h5 similarity index 100% rename from pyBAR_mimosa26_interpreter/testing/anemone_raw_data_interpreted.h5 rename to pymosa_mimosa26_interpreter/testing/anemone_raw_data_interpreted.h5 diff --git a/pyBAR_mimosa26_interpreter/testing/test_interpreter.py b/pymosa_mimosa26_interpreter/testing/test_interpreter.py similarity index 97% rename from pyBAR_mimosa26_interpreter/testing/test_interpreter.py rename to pymosa_mimosa26_interpreter/testing/test_interpreter.py index f2ed224..5ba6e7b 100644 --- a/pyBAR_mimosa26_interpreter/testing/test_interpreter.py +++ b/pymosa_mimosa26_interpreter/testing/test_interpreter.py @@ -8,9 +8,9 @@ import tables as tb import numpy as np -from pyBAR_mimosa26_interpreter import data_interpreter -from pyBAR_mimosa26_interpreter import raw_data_interpreter -# from pyBAR_mimosa26_interpreter.testing.tools.test_tools import compare_h5_files +from pymosa_mimosa26_interpreter import data_interpreter +from pymosa_mimosa26_interpreter import raw_data_interpreter +# from pymosa_mimosa26_interpreter.testing.tools.test_tools import compare_h5_files testing_path = os.path.dirname(__file__) # Get file path tests_data_folder = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(testing_path)) + r'/testing/')) # Set test data path diff --git a/pyBAR_mimosa26_interpreter/testing/test_raw_chunk_size.py b/pymosa_mimosa26_interpreter/testing/test_raw_chunk_size.py similarity index 92% rename from pyBAR_mimosa26_interpreter/testing/test_raw_chunk_size.py rename to pymosa_mimosa26_interpreter/testing/test_raw_chunk_size.py index 9f190f1..d99439c 100644 --- a/pyBAR_mimosa26_interpreter/testing/test_raw_chunk_size.py +++ b/pymosa_mimosa26_interpreter/testing/test_raw_chunk_size.py @@ -1,8 +1,8 @@ import os import unittest -from pyBAR_mimosa26_interpreter import data_interpreter -from pyBAR_mimosa26_interpreter.testing.tools.test_tools import compare_h5_files +from pymosa_mimosa26_interpreter import data_interpreter +from pymosa_mimosa26_interpreter.testing.tools.test_tools import compare_h5_files class TestRawChunkSize(unittest.TestCase): diff --git a/pyBAR_mimosa26_interpreter/testing/tools/__init__.py b/pymosa_mimosa26_interpreter/testing/tools/__init__.py similarity index 100% rename from pyBAR_mimosa26_interpreter/testing/tools/__init__.py rename to pymosa_mimosa26_interpreter/testing/tools/__init__.py diff --git a/pyBAR_mimosa26_interpreter/testing/tools/test_tools.py b/pymosa_mimosa26_interpreter/testing/tools/test_tools.py similarity index 100% rename from pyBAR_mimosa26_interpreter/testing/tools/test_tools.py rename to pymosa_mimosa26_interpreter/testing/tools/test_tools.py diff --git a/setup.py b/setup.py index 04b45b0..4abd274 100644 --- a/setup.py +++ b/setup.py @@ -12,10 +12,10 @@ install_requires = f.read().splitlines() setup( - name='pyBAR_mimosa26_interpreter', + name='pymosa_mimosa26_interpreter', version=version, description='Interpreter for Mimosa26 raw data recorded with pymosa DAQ', - url='https://github.com/SiLab-Bonn/pyBAR_mimosa26_interpreter', + url='https://github.com/SiLab-Bonn/pymosa_mimosa26_interpreter', license='BSD 3-Clause License', long_description='', author=author,