EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: GUI for MCA Record
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Smith, William" <william.smith at helmholtz-berlin.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 11 Aug 2021 11:46:40 +0000

Hi Will,

 

The IDL MCA display is still actively used on a number of beamlines at the APS.  It has some documentation here, but it is old and far from complete in terms of describing the features of the program:

https://cars.uchicago.edu/software/idl/mcaDisplay.html

 

The program includes these features:

- KLM markers to display the K, L and M lines of all elements in the periodic table

- Graphically define and set the ROIs in the MCA record

- Non-linear least squares peak fitting.  This is quite sophisticated, with the ability to constrain or optimize peak energy, peak FWHM, and peak amplitude.  Peak amplitude of the K-beta peak can be constrained to be a fixed fraction of the K-alpha, for example.

- Overlay 2 spectra for comparison

- Energy calibration using the known energies of peaks in ROIs, with graphical output of the calibration fit errors.

 

This is an example of a peak fit where I was interested in the higher energy peaks above 20 keV.  Yellow is the data, green is the fit, and blue are the ROIs.

 

 

This is the GUI to define how the fit is to be done:

 

 

There are parameters to control the background fit.  Each peak is defined with a string like “ag ka” which looks up the known energy of the Ag K-alpha line in a library. 

 

In this case the peaks fit were:

-          X-ray peaks: Ag (Ka, Kb), Pb (Ka1, Ka2, Kb1)

-          Ag pileup peaks at ~44 and ~47 keV

-          Cd109 88 keV and Co57 122 keV gamma peaks

The energies of all of the peaks except the pileup peaks were fixed, only the 2 global energy calibration coefficients were optimized.  For the pile-up peaks the energies were also optimized.

The FWHM of each peak was optimized, rather than using a global FWHM fit.

The amplitude of each peak was optimized.

 

This is the output of the peak fit:

*******************************************************

    Fit of Dante:mca1

 

Real time (seconds):                 60.00

Live time (seconds):                 51.99

Initial FWHM offset, slope:       0.150000  0.000000

Optimized FWHM offset, slope:     0.150000  0.000000

Initial energy offset, slope:    -3.077860  0.032839

Optimized energy offset, slope:  -3.084599  0.032837

# Iterations, function evals:            0        94

Chi squared:                     1.036725e+009

Status code:                      2

Error message:                 

 

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

 

          ag ka    22.104     0.5341*  135519.0     4757.0     655.0      28.5

          ag kb    24.987     0.6266*   30379.3     5439.0     137.3       5.6

         ag pu1    44.226*    1.3835*     299.7     2518.0       2.0       0.1

         ag pu2    47.479*    4.0529*     402.1     6400.0       1.7       0.1

         pb ka1    74.956     0.6177*   12808.8     1613.0     106.3       7.9

         pb ka2    72.794     0.5894*    7246.5     1474.0      62.9       4.9

         pb kb1    84.922     0.9537*    4914.5     1648.0      40.4       3.0

       cd109 g1    88.040     0.7356*    5387.2     1326.0      49.3       4.1

        co57 g2   122.061     0.6411*   34850.2      871.0     393.6      40.0


This information is also written to a file that can be easily imported into Excel.

 

The IDL program can be run for free on Linux, Windows, and Mac using the IDL Virtual Machine.

 

In 2002 I ported the IDL program to Python, with all of the features described above.  It was put into production at the Swiss Light Source at PSI.

 

Unfortunately those were very early days with Python, and I bet on the wrong horses in terms of which packages to use.  I used Numeric rather than NumPy, and I used BltPlot for the graphics.  When IDL released the Virtual Machine so my users could run it at home for free I stopped developing the Python code.  It won’t run now, but it actually would not be a huge job to convert it to modern libraries.  If you are interested I would suggest contacting PSI to see if they are still using it, and have perhaps done the conversion already.

 

The Python code is on Github here:

https://github.com/CARS-UChicago/EPICS_Python_old

 

The IDL code is on Github here:

https://github.com/CARS-UChicago/IDL_EPICS_MCA

 

The IDL code in a form that can be run in the free IDL Virtual Machine is here:

https://cars.uchicago.edu/software/pub/idl_mca.tar

 

Mark

 

 

 


From: Smith, William <william.smith at helmholtz-berlin.de>
Sent: Wednesday, August 11, 2021 4:59 AM
To: tech-talk at aps.anl.gov; Mark Rivers
Subject: GUI for MCA Record

 

Hi Mark, Everyone,

 

I have used the mca record to connect to a Bruker/Rontec Silicon Drift Detector. It works nicely, as does the supplied example GUI in Phoebus.

 

I would like to allow my users to specify calibration to scale from mca waveform bin to energy, and then be able to specify regions of interest in terms of energy rather than bin start and ends.

 

I saw in the documentation that it’s mentioned an IDL app exists to do this, and that it had been ported to python. (https://cars.uchicago.edu/software/epics/mcaDoc.html) I think this is now in the “Legacy” folder of epicsapps https://github.com/pyepics/epicsapps/tree/master/Legacy/MCADisplay I could not get it to run.

I would like a phoebus based display that did what that the mcaDisplay application sounds like it does/ did.

 

What tools are other people using to interact with the mca record? Do I need to make extra records to hold the converted waveform, and ROI’s or can I deal with this just by conversion in the display tool?

 

 

Many thanks,

 

Will

 



Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Jan Lüning (Sprecher), Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland


References:
GUI for MCA Record Smith, William via Tech-talk

Navigate by Date:
Prev: GUI for MCA Record Smith, William via Tech-talk
Next: RE: ADURL with Axis PTZ network camera Heesterman, Peter J via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: GUI for MCA Record Smith, William via Tech-talk
Next: Simple binary input question about RVAL? Feister, Scott via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 11 Aug 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·