Skip to content

Commit

Permalink
Offline processing chapter added
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgeiger authored Jun 29, 2023
1 parent 3e82b4f commit 9d6bca4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,14 @@ The webserver provides all 4096 channel counters as a JSON formatted stream. Thi
The webserver provides also a visualization of the captured data. This webpage can be displayed in any webbrowser by typing http://gamma.local/spectrum. All channel counters are normalized by the elapsed time (unit: cpm, counts per minute) and are on the y-axis, whereas the channels [0 .. 4095] are on the x-axis. This gives you a gamma spectrum. An embedded javascript helps for visualization the spectrum in a Google line chart. The javascript produces also a second smoothed curve (red) which is generated by a kind of 2-way low pass filter. Beside this some useful information is shown in the heading of the webpage, e.g. the elapsed time of the current measurement, the total number of events (peaks) in the current measurement and the average of counts (peaks) per minute. The following screenshot shows an example:

<img src="/Screenshots/screenshot02.png" alt="" width="1000" title="Spectrum">

### Offline processing

The exported JSON files can be processed offline. For that I have written a small Python tool (call: python3 [plot_gamma_spectrum.py](/Scripts/plot_gamma_spectrum.py) <json_file>) to better visualize the gamma spectrum. Difference to the webpage visualization is now that the x-axis is converted from channels into calibrated gamma energies [keV]. The calibration (mapping to the corresponding channel) is done in the script for 0 keV, the CS-137 and the K-40 isotope. An energy table for the most common radio isotopes (whhich are emitting at least gamma-rays) is included in the script to show vertical lines at those gamma energies. The maximum visible range for the x-axis can be configured to cut off all higher energies, whose corresponding peak voltages were beyond 3.3 Volt and where the ADC input was saturated. Otherwise you would see a very high irritating peak at the end of the x-axis (which is in fact the sum of all higher energies where the ADC input was saturated). The script contains the same 2-way low pass filter as implemented on the device to show also a smoothed curve. The Python script uses following libraries:
* pandas: for JSON file import
* mathplotlib: for the graphics and chart stuff
* mplcursors: for interactive data selection cursor

The following screenshot shows a spectrum of Lutetium(III) oxide (LU²O³), which has been under measurement for about 21 hours. The 2 typical gamma peaks of the contained isotope LU-176 can be seen at 202 keV and 307 keV.

<img src="/Screenshots/screenshot03.png" alt="" width="1000" title="Spectrum offline">

0 comments on commit 9d6bca4

Please sign in to comment.