Page 1 of 5

Impulse by Gammaspectacular

Posted: 25 Jan 2023, 21:36
by Sesselmann
Boys and Girls,

impulse
With all the speak about software I want to share my latest project with you, about 10 days ago I thought it might be cool to have a gamma spectrometry program running in a browser, well in my place actions follow ideas swiftly. I only had a little bit of Python knowledge from a project I did a few years ago, but Google and chatGPT are my friends.

To cut a long story short,( ....let's not mention those frustrating late nights when nothing worked) I now have a working beta program and I am looking for volunteers with enough Python knowledge to test the program.

Functionality
The program is called impulse and it is obviously free. Compared to other programs like PRA and Becqmoni, the code is incredibly small and it should run in a regular browser (Mac, Windows or Linux).

The current beta version V0.8 has the following functionality.

Settings Tab
  • Brings up a table of audio devices and lets you select a sound card
  • Lets you select sample rate and number of samples (dots) in your pulse window
  • Lets you choose how many samples to average for the shape collection
  • Collects n pulse samples, then averages, normalises and saves the shape to a file
  • Visually displays the pulse on a line graph
Settings Tab
Settings Tab
Histogram tab
  • Filename, this is a spectrum file in JSON format compatible with Matthias schema.
  • Number of Bins and Bin size, this determines how and what you see in your spectrum
  • Maximum counts, tells the computer when to stop.
  • Lower Limit Discriminator LLD, this cut's off the noise on the left.
  • Shape tolerance, this works the same as PRA, it filters out and removes pulse pile up.
  • Visual only settings, Energy Per Bin (Sum Qty) and Log scale switches
  • Second order Polynomial calibration fitting, just enter three known peaks and switch it on (super simple).
As someone who uses spectrometry software daily, I wish I would have done this sooner, no more diving into hidden settings and tons of windows to find the settings, it's all right in front of you.

Spectrum Tab
Spectrum Tab
Now if anyone reading this feels they have enough Python knowledge to run this program from the command line of their computer, and want to give it a try, then please send me a PM.

Once the software has been tested and updated with a few more features I will release compiled versions for ease of use.

Looking forward to see if there is any interest

Steven 😉

Re: Impulse by Gammaspectacular

Posted: 28 Jan 2023, 10:51
by Sesselmann
Hi guys,

In a 3 hour session this morning I have made epic progress on impulse, the background spectrum and subtraction is now working.

In a nutshell you now have the option to overlay or subtract any previously recorded spectrum, it's super simple, no complicated setup, it just works intuitively, as easy as eating a banana 🍌, studying science is hard enough, so the last thing we want to do is study software manuals.
  • The primary gamma spectrum displays as a line plot with dots and fill
  • The comparison spectrum displays as a red line plot on top of the blue
  • The difference spectrum shows up in green
So now there is no confusion...

The background spectrum is just a regular spectrum file, exactly like all the others, which means you can choose to overlay any spectrum on top of another and/or subtract it.

I need more people with sound card spectrometers to run tests on this before we release the first stable version.

Downloading and running the Python code from your terminal is not super difficult, but may not be something you have done before.

Eventually we will compile an executable program impulse.exe but as long as I am making frequent changes it's not worth doing.

And for those of you who don't like the colours, I'm thinking of adding an option to switch between fun/boring.... how about light gray?

Steven
background_sub.jpg

Re: Impulse by Gammaspectacular

Posted: 30 Jan 2023, 22:22
by Sesselmann
Hi Guys,

I am looking for more active contributors and beta testers with some Python experience to help me improve this software.

Since it is now relatively stable and runs fine from the console I would like to package it into an .exe file so more people can try it, but I haven't figured out how to do it yet, it opens up in the browser, but won't run, suspect an issue with the path to my data folder.

There are more things I want to add, such as peak resolution and some other essential things, but don't know how to do that yet.

Downloading and running the program from the console is not super difficult, but there are a few simple steps you might have to take if you don't have python installed on your pc or mac.

The code is open source and published on Github and anyone can download and or contribute to my project there.

https://github.com/ssesselmann/impulse

Steven

Re: Impulse by Gammaspectacular

Posted: 31 Jan 2023, 07:06
by Svilen
Under Linux (Mint, Ubuntu) pip install -r requirements.txt somehow didn't manage to install the modules as needed, I was lazy to investigate the reason but just managed to satisfy the dependencies doing:

Code: Select all

sudo apt install python3 python3-pip python3-pyaudio python3-numpy python3-pandas python3-plotly 

Code: Select all

pip install dash dash-daq

Code: Select all

export PATH=~/.local/bin:$PATH
You may also change "~ % Python3 run.py" in the GitHub install explanation with "~ % python3 run.py" since it is case sensitive.

No developer or beta tester will strugle with these issues, but I wrote it to save you the time :)

Re: Impulse by Gammaspectacular

Posted: 31 Jan 2023, 12:33
by Sesselmann
Svilen wrote:
31 Jan 2023, 07:06

No developer or beta tester will strugle with these issues, but I wrote it to save you the time :)
Svilen,

In the end did you get it to run on your machine?

Steven

Re: Impulse by Gammaspectacular

Posted: 01 Feb 2023, 00:05
by Svilen
Yes, that made it run on my machine, just I didn't write you more about it because I am still not able to get no pulse on my screen, but it should be something with the sound device setup. I have to play a bit more with it to be able to say more. Your program seems well done and running, I guess the problem is in my PC, but let's see.

Re: Impulse by Gammaspectacular

Posted: 01 Feb 2023, 06:51
by Sesselmann
Svilen,

Not sure which version you have, as I haven't been rigidly changing version numbers, but I recently added a function in launcher.py which creates the ../data folder and places a dummy shape.csv file in the data folder if it doesn't exist as this would prevent it from running the first time.

Are you getting a list of devices up ?

Steven

Re: Impulse by Gammaspectacular

Posted: 01 Feb 2023, 08:09
by Svilen
Hi Steven,
I do have the data directory with background.json, shape.csv, Thorium_232.json, Thorium_test7.json inside.
I'm also getting the devices listed (#13 should b the GS):
Impulse1.png
At a moment I got this from #14 (systemdefault), I don't know where did it come from, but doesn't look like the detector:
impulse2.png
The pulses resulted in this histogram:
impulse3.png
impulse3.png (62.08 KiB) Viewed 29238 times
The settings boxes overlap in my case and it should be optimized for different browsers and resolutions, but this is another story, first have to get a stable signal from USB AUDIO CODEC: Audio (hw:2,0), I don't know if my PC or the prog is failing for now...
impulse4.png
Should we discuss it further in PM, not to fill the forum, or here is OK?

Re: Impulse by Gammaspectacular

Posted: 01 Feb 2023, 09:23
by Sesselmann
Svilen,

Wow you have a long list of USB devices 😱

Sure we can continue this in PM's and come back here when problem is solved ...

Just want to mention one thing here in case we have others trying this, I have not added functionality for negative pulses yet. My intention is to write a function which automatically looks at the audio signal and determines if the pulses are positive or negative and in the case of negative pulses it will multiply every sample by -1, if I can make this work it will remove a major source of confusion.

Anyone with a GS-USB-PRO or GS-PRO-V5 need not worry about this as the pulses are always positive from the AUDIO CODEC

Steven

Re: Impulse by Gammaspectacular

Posted: 01 Feb 2023, 14:20
by Sesselmann
Thanks for feedback,

I have fixed the css layout so the program should now display reasonably well on smaller screens without overlapping.

Keep the feedback coming... 😉

Steven