hdtv


Namehdtv JSON
Version 24.3 PyPI version JSON
download
home_pagehttps://github.com/janmayer/hdtv
SummaryHDTV - Nuclear Spectrum Analysis Tool
upload_time2024-03-26 13:35:47
maintainerJan Mayer
docs_urlNone
authorNone
requires_pythonNone
licenseGPL
keywords analysis data-analysis gamma-spectroscopy nuclear-physics nuclear-spectrum-analysis physics python root root-cern spectroscopy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # HDTV - Nuclear Spectrum Analysis

[![PyPI version](https://badge.fury.io/py/hdtv.svg)](https://badge.fury.io/py/hdtv)
[![codecov](https://codecov.io/gh/janmayer/hdtv/branch/master/graph/badge.svg)](https://codecov.io/gh/janmayer/hdtv)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d54b84b35f834cb9a73a89a5ea67a8bf)](https://app.codacy.com/manual/janmayer/hdtv/dashboard)

![hdtv-spectrum-load-fit](doc/assets/hdtv-spectrum-load-fit.gif)

HDTV is a nuclear spectrum and coincidence matrix analysis tool.
It can load uncompressed (text), compressed, and ROOT spectra and 2D-matrices.
It calibrates spectra, fits peaks with background with different models, and cuts matrices.
HDTV is written in a mixture of C++ and Python, glued together using PyROOT.


## Installation

HDTV requires [CERN ROOT](https://root.cern.ch/) with working Python bindings.

```sh
pip install hdtv
```

If pip raises `error: externally-managed-environment`,
you can install hdtv in a virtual environment,
for example by using `pipx`:

```sh
pipx install hdtv --system-site-packages
```

If you use hdtv with a location-independent ROOT installation
(i.e., you have to `source <...>/thisroot.sh`, e.g. in `.bashrc` or manually),
you can leave out the `--system-site-packages` option.

Please note that the python package (wheel) does currently not include the compiled libraries required to run, as these depend on the root version, the python version, the compiler, and the moon phases.
Instead, these are compiled automatically at first start, which requires certain build tools (see below).

Alternatively, the compilation can be triggered with
```sh
hdtv --rebuild-usr
```
for the current user; or with
```sh
hdtv --rebuild-sys
```
for all user (requires superuser privileges).


### Requirements
To build and run HDTV, the following dependencies are required:

* Python
    - Tested with 3.8, 3.9, 3.10, and 3.11
    - Python-dependencies are installed automatically when using pip/pipx
        - Packages: numpy scipy matplotlib prompt_toolkit>=3.0.14 uncertainties (when manually installed)
        - Packages for development & testing: docutils pytest pytest-cov
* [Cern ROOT](https://root.cern/) 6
    - Tested with version 6.26 and higher
    - Needs to be compiled against the correct python version and with support for C++14 or higher.
    - In python, **`import ROOT` must succeed**.
    - System packages may be available on some systems, e.g. `<tool> install root python3-root` ([More info](https://root.cern/install/#linux-package-managers))
* cmake, gcc, g++ (or similar, in a somewhat modern version)
* libx11-dev `<tool> install libx11-6 libx11-dev`

### Usage with docker

With docker installed, build the image with:

```sh
git clone https://github.com/janmayer/hdtv.git
cd hdtv
docker build --tag hdtv .
```

On Linux and MacOS, no further installation is required and in the directory with your project you will be able to use HDTV with:

```sh
docker run -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/work -it hdtv
```

When using SELinux, the additional argument `--security-opt label=type:container_runtime_t` is required (before `-it`).

On Windows, you will need to have an X-Server installed, for example with MobaXTerm, and be a bit more specific:

```sh
docker run -e DISPLAY=<your ip>:0.0 -v <full path to your files>:/work -it hdtv
```

e.g. `docker run -e DISPLAY=192.168.178.21:0.0 -v D:\Project\Spectra:/work -it hdtv`.

See also [https://hub.docker.com/r/rootproject/root](https://hub.docker.com/r/rootproject/root).

## Documentation
For more information, including an overview of the available key
bindings, refer to the [documentation](doc/guide/hdtv.rst).
A [tutorial](doc/guide/hdtv-tutorial.rst) giving an introduction
to HDTV and its basic features is also available.


## Further installation topics

### Run locally from source directory without installation

```
git clone https://github.com/janmayer/hdtv.git
cd hdtv
./bin/hdtv
```

Generate man pages:

```
cd doc/guide
make doc
```


### Handling different ROOT versions

HDTV uses `ROOT.gSystem.Load(libary)` to load some critical
components. These need to be compiled against the *exact* ROOT
version imported in python. HDTV will try to automatically recompile
the libraries for the current ROOT if the available ones cannot
be loaded. This can also be forced with:

`hdtv --rebuild-usr`

When installed system-wide, the libraries can be recompiled once for
all users with:

`hdtv --rebuild-sys`

This eliminates the need to reinstall HDTV after changes to the root
installation.

Multiple Versions of ROOT can be used alongside, the correct library
version will be chosen automatically.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/janmayer/hdtv",
    "name": "hdtv",
    "maintainer": "Jan Mayer",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": "jan.mayer@ikp.uni-koeln.de",
    "keywords": "analysis data-analysis gamma-spectroscopy nuclear-physics nuclear-spectrum-analysis physics python root root-cern spectroscopy",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b1/f8/8c2e78ddcdce8f42100e07314b9f05497c89693f0d3ed30b1c0f3645e02b/hdtv-24.3.tar.gz",
    "platform": null,
    "description": "# HDTV - Nuclear Spectrum Analysis\n\n[![PyPI version](https://badge.fury.io/py/hdtv.svg)](https://badge.fury.io/py/hdtv)\n[![codecov](https://codecov.io/gh/janmayer/hdtv/branch/master/graph/badge.svg)](https://codecov.io/gh/janmayer/hdtv)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d54b84b35f834cb9a73a89a5ea67a8bf)](https://app.codacy.com/manual/janmayer/hdtv/dashboard)\n\n![hdtv-spectrum-load-fit](doc/assets/hdtv-spectrum-load-fit.gif)\n\nHDTV is a nuclear spectrum and coincidence matrix analysis tool.\nIt can load uncompressed (text), compressed, and ROOT spectra and 2D-matrices.\nIt calibrates spectra, fits peaks with background with different models, and cuts matrices.\nHDTV is written in a mixture of C++ and Python, glued together using PyROOT.\n\n\n## Installation\n\nHDTV requires [CERN ROOT](https://root.cern.ch/) with working Python bindings.\n\n```sh\npip install hdtv\n```\n\nIf pip raises `error: externally-managed-environment`,\nyou can install hdtv in a virtual environment,\nfor example by using `pipx`:\n\n```sh\npipx install hdtv --system-site-packages\n```\n\nIf you use hdtv with a location-independent ROOT installation\n(i.e., you have to `source <...>/thisroot.sh`, e.g. in `.bashrc` or manually),\nyou can leave out the `--system-site-packages` option.\n\nPlease note that the python package (wheel) does currently not include the compiled libraries required to run, as these depend on the root version, the python version, the compiler, and the moon phases.\nInstead, these are compiled automatically at first start, which requires certain build tools (see below).\n\nAlternatively, the compilation can be triggered with\n```sh\nhdtv --rebuild-usr\n```\nfor the current user; or with\n```sh\nhdtv --rebuild-sys\n```\nfor all user (requires superuser privileges).\n\n\n### Requirements\nTo build and run HDTV, the following dependencies are required:\n\n* Python\n    - Tested with 3.8, 3.9, 3.10, and 3.11\n    - Python-dependencies are installed automatically when using pip/pipx\n        - Packages: numpy scipy matplotlib prompt_toolkit>=3.0.14 uncertainties (when manually installed)\n        - Packages for development & testing: docutils pytest pytest-cov\n* [Cern ROOT](https://root.cern/) 6\n    - Tested with version 6.26 and higher\n    - Needs to be compiled against the correct python version and with support for C++14 or higher.\n    - In python, **`import ROOT` must succeed**.\n    - System packages may be available on some systems, e.g. `<tool> install root python3-root` ([More info](https://root.cern/install/#linux-package-managers))\n* cmake, gcc, g++ (or similar, in a somewhat modern version)\n* libx11-dev `<tool> install libx11-6 libx11-dev`\n\n### Usage with docker\n\nWith docker installed, build the image with:\n\n```sh\ngit clone https://github.com/janmayer/hdtv.git\ncd hdtv\ndocker build --tag hdtv .\n```\n\nOn Linux and MacOS, no further installation is required and in the directory with your project you will be able to use HDTV with:\n\n```sh\ndocker run -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/work -it hdtv\n```\n\nWhen using SELinux, the additional argument `--security-opt label=type:container_runtime_t` is required (before `-it`).\n\nOn Windows, you will need to have an X-Server installed, for example with MobaXTerm, and be a bit more specific:\n\n```sh\ndocker run -e DISPLAY=<your ip>:0.0 -v <full path to your files>:/work -it hdtv\n```\n\ne.g. `docker run -e DISPLAY=192.168.178.21:0.0 -v D:\\Project\\Spectra:/work -it hdtv`.\n\nSee also [https://hub.docker.com/r/rootproject/root](https://hub.docker.com/r/rootproject/root).\n\n## Documentation\nFor more information, including an overview of the available key\nbindings, refer to the [documentation](doc/guide/hdtv.rst).\nA [tutorial](doc/guide/hdtv-tutorial.rst) giving an introduction\nto HDTV and its basic features is also available.\n\n\n## Further installation topics\n\n### Run locally from source directory without installation\n\n```\ngit clone https://github.com/janmayer/hdtv.git\ncd hdtv\n./bin/hdtv\n```\n\nGenerate man pages:\n\n```\ncd doc/guide\nmake doc\n```\n\n\n### Handling different ROOT versions\n\nHDTV uses `ROOT.gSystem.Load(libary)` to load some critical\ncomponents. These need to be compiled against the *exact* ROOT\nversion imported in python. HDTV will try to automatically recompile\nthe libraries for the current ROOT if the available ones cannot\nbe loaded. This can also be forced with:\n\n`hdtv --rebuild-usr`\n\nWhen installed system-wide, the libraries can be recompiled once for\nall users with:\n\n`hdtv --rebuild-sys`\n\nThis eliminates the need to reinstall HDTV after changes to the root\ninstallation.\n\nMultiple Versions of ROOT can be used alongside, the correct library\nversion will be chosen automatically.\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "HDTV - Nuclear Spectrum Analysis Tool",
    "version": "24.3",
    "project_urls": {
        "Homepage": "https://github.com/janmayer/hdtv"
    },
    "split_keywords": [
        "analysis",
        "data-analysis",
        "gamma-spectroscopy",
        "nuclear-physics",
        "nuclear-spectrum-analysis",
        "physics",
        "python",
        "root",
        "root-cern",
        "spectroscopy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac07524031401fcfa587ee06e439306c3206523cb3e9ee7936bcfd2dc4613f1b",
                "md5": "5624df9b6e975d796ee41f2bfd76146b",
                "sha256": "b090dc5ccf9e6bdd9eb3e9cdaf4cd3fd52ebcf341de6f7dc4f325ac067971860"
            },
            "downloads": -1,
            "filename": "hdtv-24.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5624df9b6e975d796ee41f2bfd76146b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 928179,
            "upload_time": "2024-03-26T13:35:45",
            "upload_time_iso_8601": "2024-03-26T13:35:45.477116Z",
            "url": "https://files.pythonhosted.org/packages/ac/07/524031401fcfa587ee06e439306c3206523cb3e9ee7936bcfd2dc4613f1b/hdtv-24.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1f88c2e78ddcdce8f42100e07314b9f05497c89693f0d3ed30b1c0f3645e02b",
                "md5": "1a6c34618a4daf2d47528c9d7476454a",
                "sha256": "15e728c1864a803efc2045a087541eb454f082031f3d676cfe3515258c37f748"
            },
            "downloads": -1,
            "filename": "hdtv-24.3.tar.gz",
            "has_sig": false,
            "md5_digest": "1a6c34618a4daf2d47528c9d7476454a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1095070,
            "upload_time": "2024-03-26T13:35:47",
            "upload_time_iso_8601": "2024-03-26T13:35:47.451584Z",
            "url": "https://files.pythonhosted.org/packages/b1/f8/8c2e78ddcdce8f42100e07314b9f05497c89693f0d3ed30b1c0f3645e02b/hdtv-24.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 13:35:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "janmayer",
    "github_project": "hdtv",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "hdtv"
}
        
Elapsed time: 0.37336s