Kromek Radangel gamma spectrometer USB HID daemon and WebUI. https://git.unino.de/pvivell/radangel
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Peter Vivell 9cbbe8774c Updates 6年前
config Initial commit. 6年前
docs Initial commit. 6年前
html Initial commit. 6年前
service Initial commit. 6年前
src Initial commit. 6年前
CHANGELOG.md Updates 6年前
Makefile Makefile and drone.yml 6年前
README.md „README.md“ ändern 6年前
RELEASE.md Updates 6年前
draft.drone.yml CHANGELOG.md 6年前
drone.yml Updates 6年前

README.md

Build Status

Radangel

Device: Kromek RadAngel

The Kromek RadAngel is an affordable CZT-based gamma-ray spectrometer device connecting via USB as a HID device.

RadAngel a small and portable gamma-ray spectrometer that can be utilised for educational purposes in teaching concepts of radiation as well as for training in the use of radiation sensors.

Its compact size and quick set-up time make it ideally suited for individual or small group projects, laboratory-based teaching, classroom demonstrations and field studies.

This instrument utilizes a Cadmium Zinc Telluride (CZT) solid state detector, which enables room temperature operation with excellent energy resolution (12 bits hence 4096 channels from ~30 keV to ~3 MeV). The unit is completely self-contained, with a built-in detector, amplifiers, power supply and communications. The digitized detector signals are sent to a PC via the mini-USB which also powers the unit, so no external supply is required.

Kromek RadAngel

Daemon: radangel

The radangel binary communicates with the RadAngel HID device (04d8:0100) via USB (hidapi-libusb) and uses threads (pthreads) to read events and push them in a queue, then pop them from the queue and write them into files.

To grant permissions to the USB device, the udev system can be employed:

  • echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="0100", MODE="0666"' | sudo tee /etc/udev/rules.d/60-kromek-radangel.rules
  • udevadm control --reload-rules && udevadm trigger

Compiling the radangel binary for the linux operating system is easy: Just run make in the src directory or

gcc -std=gnu99 -Wall radangel.c -o radangel -pthread -lm -lhidapi-libusb

The output of the radangel daemon consists of two files (time series and histogram):

  • events.tsv each line corresponds to one event with timestamp and channel (gamma-ray energy).
  • stats.tsveach line corresponds to one channel and displays the number of occurance (histogram).

Running the binary with the appropriate arguments:

radangel --verbose --event events.tsv --stats stats.tsv

The daemon can be run as service with the radangel.service systemd file.

Web: service

The changes in the output files from radangel daemon can be streamed to the browser in realtime with the two systemd units datasrc.service and websockify.service:

  • datasrc.service systemd unit employs inotail to monitor the output files and streams the changes with socat into a tcp socket.
  • websockify.service launches the websockify daemon which provides the websocket endpoint behind nginx webserver (see nginx-datasrc-location.conf) and translates between websocket and the plain tcp socket.

To compile the websockify daemon just run make in the src/contrib directory.

The web interface itself uses Plotly.js to display the histogram of the channels in realtime by connecting to the websocket endpoint and provides a convenient user interface for exploring the details of the gamma-spectrum.

Background Gamma Spectrum