Author Topic: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics  (Read 39091 times)

Nabil

  • Graduate
  • **
  • Posts: 5
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #30 on: July 29, 2018, 08:25:58 AM »
But after adding the 4th material, how can you read this .in input file?
And as far as efficiency is concerned, I'm talking about the efficiency of non-geometric detection, ie the photon detection capability.
With all my respectful greetings.

Probeman

  • Emeritus
  • *****
  • Posts: 2830
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #31 on: July 29, 2018, 09:45:15 AM »
But after adding the 4th material, how can you read this .in input file?

Using Penepma from the Standard GUI or from the command prompt, e.g., Penepma.exe < inputfile.in

I think you should sit down with the Penepma documentation and read through it carefully.  See the file penepma.pdf and work through the section titled "An example".

And as far as efficiency is concerned, I'm talking about the efficiency of non-geometric detection, ie the photon detection capability.
With all my respectful greetings.

As Xavier and I already said, 100% of the photons that intersect the Penepma detector geometry are counted and normalized to area.
john
« Last Edit: July 29, 2018, 09:54:17 AM by Probeman »
The only stupid question is the one not asked!

Nabil

  • Graduate
  • **
  • Posts: 5
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #32 on: July 29, 2018, 10:31:38 AM »
Thank you very much my brother Probeman.

Probeman

  • Emeritus
  • *****
  • Posts: 2830
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #33 on: July 29, 2018, 02:29:26 PM »
Thank you very much my brother Probeman.

You are most welcome.
john
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2830
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #34 on: July 29, 2018, 02:40:32 PM »
Thanks. I did a search and replace and changed the limits in penepma16 to permit 4096 channel spectra. It compiled as expected and I just started a run. I took a peek at the first pe-spect-01.dat file and I am indeed getting 4096 channels. Woo. Hoo!  It is late here in Rochester, so I will let this run tonight and see what I get in the morning.

The advantage of the penepma2012 code is that all the users of CalcZaf can use it. Maybe I should standardize on that and consider building the 2012 code on the mac. If you zip and send the unmodified source I will make the changes for 4096 channels and build it on the mac. I would offer to send the binaries back to you, but given Xavier's wishes, I understand why I should not send them back...

Hi John,
I have to admit that I haven't had a chance to play with the Penepma 2016 code yet, but I would be very interested to learn if the input/output file formats have changed enough to break our Penepma 2012 GUI code in our Standard app.  That would be the .in input file and the Penepma output files here:

PENEPMA_DAT_File$ = PENEPMA_Path$ & "\PENEPMA.DAT"
PENEPMA_SPEC_File$ = PENEPMA_Path$ & "\PE-SPECT-01.DAT"
PENEPMA_CHAR_File$ = PENEPMA_Path$ & "\PE-CHARACT-01.DAT"

If you get a chance and compile the Penepma 2016 FORTRAN for a PC, please feel free to drop a copy of the Penepma.exe into the C:\UserData\Penepma12\Penepma folder and see if our Standard GUI still works.  I suspect it won't but it's worth a try.
john
« Last Edit: July 29, 2018, 06:54:21 PM by Probeman »
The only stupid question is the one not asked!

jrminter

  • Professor
  • ****
  • Posts: 72
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #35 on: July 30, 2018, 12:01:14 PM »
This was actually fun and was yet another learning opportunity. The only modification I made to Prof. Llovet's 2016 code was to increase the limit on the number of channels from 1024 to 4096. The orthoclase.in example from the 2012 version ran (using material files I created from the 2016 version of material.exe), but stopped after the first dump of the simulation. This may be a "feature" but was unexpected based on the information in the input file. I am attaching a modified input file that works as expected and is chugging along at the moment.

There are some incompatibilities between the two versions, so I would not mix the two versions in the same folder in C:\UserData\Penepma\Penepma. Note that in the standard installation, the material.exe file for the 2012 version is in the Pendbase folder. I did not want to disturb this standard set-up so I created a pair of folders in my user space.

C:\Users\username\Documents\work\penepma12

and

C:\Users\username\Documents\work\penepma16

Each of these folder has a pendbase folder that contains the appropriate material.exe and pdfiles folder for that version of the software. This keeps material files separate. The user needs to create the materials file for the 2016 version from the command line.

For a given simulation I create a subfolder with a meaningful name in the folder for the version to be used. This is where we store the .in file for the simulation, the material files to support the simulation, and the appropriate geometry file. I also include a batch file that looks like this:


cd "C:\Users\username\Documents\work\penepma16"
REM Start clean...
del /f *.dat
del /f *.rep
penepma16 < "orthoclase.in"

pause


I then have penepma executables named penepma12.exe and penepma16.exe that I put in a folder in system path. The batch file calls the appropriate exe for the simulation...

I'd be willing to zip up the files you need and get them to you. Hope this helps...

Update 6:52 pm EST: The simulation finished. I am attaching a png of the spectrum on a log scale and the pe-spect-01.dat and pe-intens-01.dat files from a 5 hr simulation.

Best regards,
John
« Last Edit: July 30, 2018, 03:58:40 PM by jrminter »

jon_wade

  • Professor
  • ****
  • Posts: 82
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #36 on: August 07, 2018, 03:59:57 PM »
Purely from recollection, for an epma with a take off angle of 40degrees, the .in takeoff angle may need to be amended (measured from the vertical)
And, personally speaking, I think, rather than running for a set time, its better to use the REFLIN option to specify an error on a line if interest.

Other things of note  - c1 and c2 should be checked to see if they influence the results.  Experience says maybe not, but depending on what your trying to achieve, they should be checked with short runs.  Efficiency is definitely optimised by choosing the input parameters - especially the cutoffs -  in this line carefully.

Actually, is anyone interested in an 'end users' guide to penepma?  Once I fully understand some of the more esoteric details of the new version, I don't mind putting something together detailing this, .geo and a basic guide to Penelope for xrf and the like (this will mean I have to bribe Xavier with a beer for three!).  But only if there's interest.....

The PENELOPE family, together with the Salvat database on cross sections are excellent resources for  things as diverse as BSE and X-ray yield across a range of analytical techniques.  The authors really cannot be given enough credit for a serious contribution and  should be both applauded and supported.


« Last Edit: August 07, 2018, 04:17:57 PM by jon_wade »

Probeman

  • Emeritus
  • *****
  • Posts: 2830
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #37 on: August 07, 2018, 04:25:45 PM »
Actually, is anyone interested in an 'end users' guide to penepma?  Once I fully understand some of the more esoteric details of the new version, I don't mind putting something together detailing this, .geo and a basic guide to Penelope for xrf and the like (this will mean I have to bribe Xavier with a beer for three!).  But only if there's interest.....

The PENELOPE family, together with the Salvat database on cross sections are excellent resources for  things as diverse as BSE and X-ray yield across a range of analytical techniques.  The authors really cannot be given enough credit for a serious contribution and  should be both applauded and supported.

Hi Jon,
I could not agree more with you. What Cesc and Xavier have done is very impressive.  They deserve enormous credit for what they have accomplished.

On the basic guide thing, one user here did start a short tutorial here (see attached pdf):

http://probesoftware.com/smf/index.php?topic=322.msg1641#msg1641

But there would be value in different approaches as you suggest and I would strongly encourage you to proceed.  I think the learning curve for Penepma is pretty steep (which is why I created a basic GUI for it in CalcZAF/Standard), so any sort of instructional manual would be very helpful. 

Maybe some "case studies"?
john
« Last Edit: August 07, 2018, 04:35:04 PM by Probeman »
The only stupid question is the one not asked!

jrminter

  • Professor
  • ****
  • Posts: 72
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #38 on: August 07, 2018, 04:56:25 PM »
I am very interested in your "end user guide."  I have currently been exploring the effects of changing the MSIMPA parameters for trilayer simulations where I have something like a thin C coating on ZnO on silica. I'm also interested in a case where one might replace the ZnO with a more dense material like Ag where one has something light like silica underneath.

I am aware of Sherri Singerling's document. I have been working on a R package to process the output. My goal is to run the analysis in code chunks in a Rmarkdown document for a reproducible report that could be shared with others and easily modified to extend the analysis.

jrminter

  • Professor
  • ****
  • Posts: 72
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #39 on: August 07, 2018, 07:12:42 PM »
Jon Wade,

I am trying to figure out the code for the REFLIN syntax and make sure
I understand the rationale for the choices. A while ago you sent me this
example for a simulation with Ir:

REFLIN 77081500 2 1.E-2          [IZ*1e6+S1*1e4+S2*1e2,detector,tol.]

The handy code suggests it will compute IZ*1e6+S1*1e4+S2*1e2,detector,tol..

I needed the code for the shells and found table 7.2 in the
Penelope-2014 NEA document by Salvat (attached for those who are interested.)

So S1 would be 08  (M4) and S2 would be 15 (N6).

I checked the transitions with DTSA-II listTransitions('Ir') function, I get
the table below that I cropped to the transitions with a large weight.

IUPAC     Weight  Energy  Wavelength
                  (keV)     (Å)
Ir M5-N6  1.0000  1.977   6.27133
Ir M5-N7  1.0000  1.9799  6.26214
Ir M4-N6  0.5944  2.0527  6.04005
Ir L3-M5  1.0000  9.1748  1.35136
Ir L2-M4  0.4168  10.708  1.15787


I am assuming you choose the lower weighted M4-N6 because if
those statistics were good, the higher weighted L3-M5 would be better.

Did I miss anything? Do you have any other helpful hints for how to
optimize a simulation using REFLIN?

Thanks for all your help. This is a great community.

Best Regards,
John Minter

jon_wade

  • Professor
  • ****
  • Posts: 82
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #40 on: August 24, 2018, 04:25:47 AM »
Hi John

Can't remember why I picked M4-N6 - its possible I  didn't really care too much about which line I chose (typically, I'm not interested in Ir - we use its Fe content as a redox sensor - hence I'm usually more interested in the Fe it contains).

The REFLIN function is really nice to use if you want the same precision across a number of runs, or if you batch-up runs and want to run the next as soon as you hit a reasonable precision on an element of interest.

When the kids go back to school I'll start on an end-users guide.  I'm not sure about the change in 'channels' when binning  - the newer version merely reports intensity on lines, with the background subtracted (Pe-intens_xx.dat), and a list from the detector in pe-spect-xx.dat. I am unsure if the number of channels significantly effects the former.  I'll buy Xavier a beer and find out......

 

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3267
  • Other duties as assigned...
    • Probe Software
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #41 on: August 24, 2018, 05:17:16 PM »
We fixed a small bug in the Penepma GUI that was not setting the WCC and WCR parameters to the same minimum energy values as the electron and photon limits.  Thank-you to Philippe Pinard who pointed this out.

We also are now setting the *position* minimum energy parameter to the same value as the electron and photon minimum energy parameters, just for those of you working with anti-matter samples!   :D
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

jrminter

  • Professor
  • ****
  • Posts: 72
Generating a convolved spectrum file with penepma
« Reply #42 on: August 24, 2018, 05:51:26 PM »
The 2008 paper by Llovet and Salvat show an example in Figure 5 on p. 24 of  a "Measured spectrum from detector number 1 (see the penepma input file epma2.in) calculated by convolving the simulated spectrum with the energy resolution function of a Si(Li) detector."

I have been unable to figure out how they actually created that spectrum. I checked the CalcZAF code on github and noticed that there are references in penepma8a.bas to "PENEPMA_CONVOLG_File" but I can't see how to create this in the input file or that it is actually used. Many of you have wrestled with this code more than I have. Any chance you can explain what I am missing?

Llovett and Salvat have done great work putting this program together. It would be much easier for people to use it if the .in files for key examples were in a github repository someplace - arranged by release because the best practices have changed over time. I am assembling some examples of my own. I'd be willing to help maintain such a github repository. I have both time and interest. I suspect Jon Wade could and would contribute as well.  Do you think Llovet and Salvat would be interested is supplying some of their examples?

Best Regards,
John Minter

jrminter

  • Professor
  • ****
  • Posts: 72
Convolution solved...
« Reply #43 on: August 24, 2018, 08:08:02 PM »
Guess I should start with a Homer Simpson Doh! I just needed to look in the right place. I noticed that CalcZAF has the programs convolg.exe, convolg_LDE.exe convolg_LIF.exe convolg_PET.exe and convolg_TAP.exe alongside penepma.exe. The first lets you input a spectrum name and an eV for convolution.  Assuming that the others are for the typical crystals. Guessing I could wrap these in batch files. For the moment I put convolg.exe in my path... Update: found the Fortran code and built these on the Mac as well...

« Last Edit: August 24, 2018, 08:38:37 PM by jrminter »

Probeman

  • Emeritus
  • *****
  • Posts: 2830
  • Never sleeps...
    • John Donovan
Re: Convolution solved...
« Reply #44 on: August 24, 2018, 09:31:09 PM »
Guess I should start with a Homer Simpson Doh! I just needed to look in the right place. I noticed that CalcZAF has the programs convolg.exe, convolg_LDE.exe convolg_LIF.exe convolg_PET.exe and convolg_TAP.exe alongside penepma.exe. The first lets you input a spectrum name and an eV for convolution.  Assuming that the others are for the typical crystals. Guessing I could wrap these in batch files. For the moment I put convolg.exe in my path... Update: found the Fortran code and built these on the Mac as well...

Hi John,
This post has the convolution equation codes for the various WDS crystals that I modified the convolg FORTRAN with for the WDS convolg exes that you listed above:

https://probesoftware.com/smf/index.php?topic=837.msg6187#msg6187

I use the default convolg program for simulating EDS spectra and the modified codes for simulating WDS spectra, in Probe for EPMA for demonstration and teaching.  It is quite realistic.  That is correct: you don't need an actual microprobe to perform micro-analysis in PFE!    :)
john
« Last Edit: August 25, 2018, 10:39:46 AM by Probeman »
The only stupid question is the one not asked!