Click on following links to download files:
Information from Github page https://github.com/UKradioastro/UKRAA_PicoMuon 30/3/2026:
| Name | ||
|---|---|---|
| N15TelescopeRemove reference to update code from READMEd6fa0ff · last month | ||
| WWW | moved id= tags | 9 months ago |
| docs | Change RPi installer instruction to Trixie | last month |
| images | More changes to images 🙁 | 8 months ago |
| install | Removed mysql_secure_installation from install script | last month |
| scripts | Remove unused files | 8 months ago |
| LICENSE | Initial commit | 2 years ago |
| README.md | Remove reference to update code from README | last month |
Repository files navigation
Python code for the UKRAA PicoMuon
Set of Python code to run on a RPi4/5 to get, process and present data from the UKRAA PicoMuon detector
This software was written to suit a specific set-up, feel free to use as you see fit.
Instructions for setting up a Raspberry Pi4/5 are included in the docs folder
Contents
- Where is my detector
- Using the code
- Getting the software onto your RPi
- Installing the software onto your RPi
- What does the code do
- Check GetDataRawACM0 service is running
- License
- Contact us
Where is my detector
Plug your detector into any of the RPi USB ports – I normally use the blue ports (USB3).
- Open a terminal window and type the following command and press enter
ls /dev/tty*
- You are looking for /dev/ttyACM0 – this is on the right hand side of the screen shot above.
- This is the USB address for your attached detector – if you have more than one detector attached you may see /dev/ttyACM1 etc.
- If you do not see /dev/ttyACM0, then unplug and plug the detector back in and try again.
- As long as you see /dev/ttyACM0 then you do not have to make any changes to the python scripts, because they are looking for ACM0.
Using the code
The code assumes that your UKRAA PicoMuon detector is connected to the RPi4/5 via supplied USB cable and that it is /dev/ttyACM0 – you can check this by using ls /dev/tty* in a terminal window on the RPi4/5 and reviewing the response.
The code assumes username is pi. If pi is not the username, then you will need to change all occurances of ‘/home/pi’ to ‘/home/username‘ in the python and gnuplot scripts, where username is the username you have selected for your RPi4/5.
The code assumes one detector connected to the RPi4/5 USB and that it will be connected via /dev/ttyACM0, if there are other devices connected to the RPi and your detector is not /dev/ttyACM0, then you will need to change /dev/ttyACM0 to /dev/ttyACMx in the GetDataRawACM0.py python script, where ttyACMx is the tty address of you connected detector.
GetDataRawACM0.py is run as a service.
Other scripts (Python, gnuplot and shell) are run from cron
Getting the software onto your RPi
- Log into your Raspberry Pi4/5 using VNC.
- Open a terminal window, type the following command and press enter
git clone https://github.com/UKradioastro/UKRAA_PicoMuon
This will download all of the code to the directory UKRAA_PicoMuon inside /home/pi
Installing the software onto your RPi
- Open a terminal window and type the following command and press enter
cd ~/UKRAA_PicoMuon/install
This will take you to the install directory inside /home/pi/UKRAA_PicoMuon
- Type the following command and press enter
chmod +x *.sh
This will make the install.sh script executable.
- Type the following command and press enter
sudo bash install.sh
This will run the install script.
There may be occasions during the running of the install script that require you to make a keyboard entry.
When asked Do you want to continue? [Y/n] – type Y or y and press enter
That’s it!
The code is now set up to run automatically; it will get the data from the detector, process yesterdays data, plot yesterdays data and post yesterdays plots to your intranet web page once per day, at 9.30am in the morning.
What does the code do
The code receives the event data from the UKRAA PicoMuon detector via serial over the supplied USB cable and stores the event data to the raw data folder:
The raw data will be processed overnight, via CRON, to get counts per minute, the frequency of the counts per minute and the frequency of the adc values for your previous day’s data.
A number of plots will be created:
- counts per minute
- frequency of counts per minute
- frequency of ADC values recorded
The raw data will also be processed overnight, via CRON, to produce % deviation of muon counts, this data is supplemented by a request to NMDB via NEST to get the previous days recorded neutron count, which will be overlaid onto the day / week / month / etc % deviation counts graphs.
These will appear as the required amount of data is recorded by the detector
A simple web server and web page is set up on your RPi so that you can view your detector’s results on your desktop PC and/or smart phone when connected to your home network.
To access the webpage on your desktop PC or your smart phone…
- Open your preferred web application (Safari, Chrome, Firefox, etc.).
- In the search bar type the following and press enter
http://rpi4-UKRAA.local
This will take you to the web page for your detector, displaying yesterday’s events graphs.
NOTE: if you have a different hostname for your RPi, change the search bar entry to…
http://hostname.local
Where hostname is the hostname for your RPi setup.
Check GetDataRawACM0 service is running
- To check the status of your service, type the following command and press enter.
sudo systemctl status PicoMuonACM0.service
- To start your service, type the following command and press enter.
sudo systemctl start PicoMuonACM0.service
- To stop your service, type the following command and press enter.
sudo systemctl stop PicoMuonACM0.service
- To enable your service, type the following command and press enter.
sudo systemctl enable PicoMuonACM0.service
- To disable your service, type the following command and press enter.
sudo systemctl disable PicoMuonACM0.service
License
MIT License
Copyright (c) 2024 UKRAA
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contact us
Please send an e-mail to picomuon@ukraa.com