Needing more than a spark test?

Getting back on topic, I have been taking a first look through the source code PyMca5 software for X-Ray fluorscence that was on the repository for my PC. Written in Python, there is a LOT. It appears to be all the software component programs as developed and used at CERN accelerator. I have only had a brief look through, but there appears to be a GUI package set, and all sorts of component programs for capture and analysis of scintillation data.
There is the "PyMca X-Ray Fluorescence Toolkit"
Just getting to know how to drive it is going to take quite a lot of study.

The commands do run on the example test data provided as a check the installation has gone OK. This stuff is clearly science rigorous in very serious mode with extra stamps and thumps! I suppose that given it was and is so widely used for PhD careers at the LHC, that is to be expected, but I don't think that makes it unsuitable. There may be powerul stuff in it one may never use in a modest, somewhat approximate application like ours, but it already runs on the Pi-4.

I have received my GPIO interface kit from eBay. Still no sign of the PMT tube, and I still have to get the act together on scintillator and Si(PM) diodes. I have set the Pi-4 up with a heatsink that has a 40mm, apparently silent, little fan, and set it to clock at 2GHz.

PyMca can be downloaded from sourceforge.net --> HERE
 
Yikes! Now we have @pontiac428 keeping an eye on us! :faint:
Meantime..

The Radioactives Have Arrived !

Radioactives1.jpg

They are ionization chambers, and the Am241 in there is pointing "upwards" I guess. I will post pictures of the teardown later. These are less specific about the amount of Americium in there. The description on the container says..

" Contains Radioactive Material
<29.6KBq ( <0.8uCi ) 241 Am"

I guess the amount is as small as they could make it. I am looking at all the "less than" signs.
BUT - supposing the amounts are 0.8uCi. I have to look back in the thread. I know we calculated the amount of Am241 somewhere earlier, and I used Avagadro's number to get at the number of atoms. Then there was the half-life assumption of when the waste was made.

OK - it does not really matter. We just "try it". I was just after a rough calculation of the flux, with a view to discovering how few we could get away with. For instance, could we make it work with just one smoke detector?
Maybe we only need the numbers in the description, to determine the flux.

The gamma rays will not be range limited. They will slam the test sample every time. The question is, how often?
A whole lot of them will be going off in other directions. Only some go where we want. The same is true of the X-Rays. We only get some of the some. Of the X-Rays, only about 1/8 head towards the scintillator, and of those, perhaps 1/6 are at an angle narrow enough to find the crystal

The mass of the source is 0.2332ug or 0.2334ug depending whether we start with uCi or KBq.
I have a calculation which I will not amuse you with yet.
 
That is great!
I am amazed that software is available like that. Could it work for your purpose without adaptation? Sure looks about right on those graphs.
Robert

In reading the tutorial is seems this software does not handle the raw data but rather handles the "back end" of identifying elements from the data you record. Still very valuable and a big chunk of the work is done! You would still need software to record counts per "bucket" or channel corresponding to the KeV ranges. Am I interpreting that correctly?
Robert
 
Last edited:
That is great!
I am amazed that software is available like that. Could it work for your purpose without adaptation? Sure looks about right on those graphs.
Robert
Yes and no. We still have to make a main calling program.
We pick through those software modules, and discover what they do.
Our program is essentially calling these modules to do their part.
It is essentially complete. My first guess is we only need to use some parts of it.

There will still have to be careful programming to invoke these modules, and to do that right might get beyond my skills. That's OK. because have perhaps thousands of HM members who can make a few suggestions in that area.

The rest of PyMca is probably beyond what we should attempt in advanced data analysis.
These programs are run on CERN's network
- - - - - - - - - - -
We also have Gnuplot which can do anything imaginable for plotting.
Then there is Octave, which can do anything MatLAB, and much more, also used at CERN.
We may not need the much of stuff I am looking at. I was just having fun checking out what it does.
I used command "apt-get install octave". It happens in a seconds or a couple of minutes. No "registrations". No forced "updates". Download only.

It found all the (many) libraries and dependencies, resolved version conflicts, and simply downloaded and installed it from the repository. This is secure also. Digital signature exchange, and you know you get it from a place where the most elaborate mechanisms exist to ensure no entity meddled with it. You can compile the source code yourself, and the fact you can read and modify the source means you know it only does what it is supposed to do. No "extra" functions hidden in there.

Check out Octave. I ran out of screen height to list it all. There was still more to go after octave-symbolic.
I loved having it do calculus on expressions - amazing"!

Octave-Choice1.png

Octave-Choice2.png

I think we can expect to simply take advantage of the free software. It can clearly do the job - and much more.
Moreover, we can see the source. Other free software may be free, but the source is often not. I prefer not being restricted to the API (interfaces) decided by the provider, and sometimes to their hardware.

All of this runs natively on the ARM platform in the little Pi-4B computer.

Pi-4B-USA.png

I happen to be using the 4GB SDRAM version, which is about $50

You have to beware. When you fire up one of these, and discover it is entirely capable of being a general purpose desktop PC, with Chromium browser and more software than you have enough life left to try, twin 4K video, Wifi, Bluetooth, USB3, Gigabit/sec network, it's easy to get distracted.

I left mine playing this -->
(except I skipped the first track)
 
  • Like
Reactions: rwm
I played around with Octave as well when I was exploring the idea of making an FTIR spectrometer (some of the IR optics and a decent MWIR detector were the sticking points, given the limitations of a hobbyist budget). The Matlab examples of things like modeling double-slit interference patterns didn't need any modifications to run under Octave -- and it's free!

Octave's FFT, curve fitting and deconvolution routines could be helpful w/regard to extracting elemental info from the MCA data. It is very cool that it runs on an RPi. I have one of Hardkernel's XU4 boards that is similar and, as you say, it's easy to get distracted by playing around with it. The monitor dwarfs the board -- when I tell visitors that tiny board is the computer they're blown away.
 
For @RJSakowski :
Sheet lead is available as building material as per the chart image.

Lead_Thickness_Codes.png

In post #206, you mentioned that 3mm thick lead would attenuate to 10E-18 remaining.
(Did I mean 10^-18 or 1E-19)? No matter, 3mm is much more than we need.
The most readily available from eBay seems to be code #3 and code#4.

There are two shielding schemes, one for the PMT, and a different one for the Si(PM). The thing they have in common is a conical shield from the Am241 sources to the test surface, to exclude stuff from X-Rays going out in less useful directions. Unfortunately, the X-Rays have wavelength too small to get up to useful stuff like reflection.

The next shield would be the one around the PMT. It may have to have a mu-metal magnetic shield tube as well. Since photons cannot go around corners, the shield extends a little past the scintillator to exclude them. In the case of the Si(PM), it extends past the light pipe. We can expect the light pipe to scintillate a bit by itself.

Your chart would come in useful right now.I am thinking 1.32mm thick lead may be all we need. £28-50 gets 3m, so I guess 500mm or so x 4" widemight be around $5.00. (Mixing units and currencies really well there).
 
For @RJSakowski :
Sheet lead is available as building material as per the chart image.

View attachment 323412

In post #206, you mentioned that 3mm thick lead would attenuate to 10E-18 remaining.
(Did I mean 10^-18 or 1E-19)? No matter, 3mm is much more than we need.
The most readily available from eBay seems to be code #3 and code#4.

There are two shielding schemes, one for the PMT, and a different one for the Si(PM). The thing they have in common is a conical shield from the Am241 sources to the test surface, to exclude stuff from X-Rays going out in less useful directions. Unfortunately, the X-Rays have wavelength too small to get up to useful stuff like reflection.

The next shield would be the one around the PMT. It may have to have a mu-metal magnetic shield tube as well. Since photons cannot go around corners, the shield extends a little past the scintillator to exclude them. In the case of the Si(PM), it extends past the light pipe. We can expect the light pipe to scintillate a bit by itself.

Your chart would come in useful right now.I am thinking 1.32mm thick lead may be all we need. £28-50 gets 3m, so I guess 500mm or so x 4" widemight be around $5.00. (Mixing units and currencies really well there).

Sorry about the mixup in terminology. Yes, I meant 10^-18.
Here is the site that I got the chart from. It is a .png file about the third post down. https://www.researchgate.net/post/H...required_to_stop_a_particular_X-Ray_frequency
My reasoning.
From the chart, you will see that .28mm of lead will reduce 125Kv x-ray flux by 50% It will take 11 thicknesses of lead to build a 3mm thickness so a 1125Kv beam would be attenuated to 2^-11 or4.9E-4 of its original flux. Similarly, for 40Kv photons, .05mm to halve and 60 sheets for 3mm thickness yields 2^-60 or 8.7E-19.
A graph of the energy vs. thickness, it appears that assuming a linear relationship between 40Kv and 125Kv is conservative so for an 80Kv x-ray, it will take .1mm of lead and 30 thicknesses to make 3mm and the beam will be attenuated to 2^-30 or 9.3E-10 of its original flux. You caqn easily make the calculation for other energies and thicknesses.
 
@RJSakowski
Thanks for the link to the chart. I was working it from the other direction, starting with the cheapest thickness of building supplier's lead, 1.32mm

13 layers of 0.1mm should attenuate 2^-13 = 1.22E-4. So 1.22 ten thousanths using the code #3 builder's lead.

The code #4 thickness, 1.8mm attenuates s 2^-18 = 3.81E-6 So 3.8 millionths

Since 1.8mm is easy enough to work with, is easily available, and looks to be a total radiation stopper, I will fix my choice on that - unless of course I unearth the chunk that may be lurking in the garage somewhere, in which case, I just use it.

[Edit - Now I have to firm up on A/D converter, high voltage gadget, Si(PM) avalanche photodiode, and scintillators]
 
Just to be a contrarian...

Going back to the NIST X-Ray mass attenuation data, lead's absorptivity at 60KV is 5.02, if thickness is in cm. The intensity of an exit beam passing through a sheet of lead can be calculated using: exit-intensity = incident-intensity * e^(-5.02*t). If you want to attentuate the beam by 99% -- i.e., exit-intensity = .01*incident-intensity this equation predicts you'd need .92cm to do it: ln(.01) = -4.6, so t = 4.6/5.02 (there are negative signs for both the numerator and denominator so they cancel).

In contrast, lead's mass attenuation for 6KV x-rays, which is close to the XRF spectra of interest, is 467 so you'd only need about 99 microns to drop the intensity by 99%. So an order of magnitude energy change results in about two orders of magnitude in the attenuation factor.
 
Are there any issues about plastics?

I think some types of plastic may not like being irradiated without an ion chamber enclosing the bad stuff.
I know plastics, being such insulators, can be pietzo-microphonic. You only have to wiggle a PTFE coax to get a big noise row off it. Used for movement detectors in fences. It may not be an issue if we confine the gamma racket to stay between a little lead.

Radiation particles going through soft polymer plastics can leave a track of carbon through. Even sunlight is damaging to many plastics. The question arises in choosing tube covers and front assemblies housing the sources. Maybe we can use any old PVC tubes we please, so long as there is lead shielding where we are going to make a noise with gamma.

Should we stop the helium nuclei with some card covering the sources? Do these alpha particles contribute to noise clutter in this process?
 
Back
Top