Author Topic: EMSA File Format  (Read 16311 times)

jrminter

  • Professor
  • ****
  • Posts: 72
Re: EMSA File Format
« Reply #15 on: March 11, 2021, 10:52:24 AM »
If you want to open that spectrum with DTSA2, you will need to manually change the eV/channel to 10.0 ...

JonF

  • Professor
  • ****
  • Posts: 149
Re: EMSA File Format
« Reply #16 on: March 12, 2021, 01:47:31 AM »
If you want to open that spectrum with DTSA2, you will need to manually change the eV/channel to 10.0 ...

Fortunately something that is easy to automate with scripts!

I Frankensteined the following together from snippets on technet, stackoverflow etc to run from the windows powershell.

Code: [Select]
function Select-Folder($message='Select a folder', $path = 0) {
$object = New-Object -comObject Shell.Application
$folder = $object.BrowseForFolder(0, $message, 0, $path) 
if ($folder -ne $null) {   
$folder.self.Path
}
}

$folderPath = Select-Folder 'Select the folder with the EMSA files to be corrected'

Write-host "The selected folder path is $folderPath"

$files = Get-ChildItem -Path $folderPath -Recurse -Include *.EMSA

foreach ($f in $files){
    $outfile = $f.FullName + "_out.EMSA"
    (Get-Content $f.FullName) -replace '#XPERCHAN    : 0.01', '#XPERCHAN    : 10' | Set-Content $outfile
}

If ($folderPath) { Write-Host 'Processing files' }
Else { Write-Host 'No folder selected' }

I paste that in to the powershell prompt and it'll ask where the files are to process and then cycle through the .EMSA files changing the "#XPERCHAN    : 0.01" to "#XPERCHAN    : 10"

Quick and dirty, but it does the job for now!

Probeman

  • Emeritus
  • *****
  • Posts: 2829
  • Never sleeps...
    • John Donovan
Re: EMSA File Format
« Reply #17 on: March 12, 2021, 07:09:33 AM »
Ok, emailed one across.

Oddly, the JEOL PC-SEM version that I have gives the #XPERCHAN as keV/channel rather than eV/channel, so is a 1000x off when importing in to DTSA-II. The #XUNITS value is listed as "Energy (keV)".
No idea whether this is something I've done wrong, whether its something I need to alter in my JEOL configuration somewhere, my DTSA-II installation, or whether the .EMSA format wasn't correctly implemented in my version of PC-SEM.

Have you notified JEOL about this possible issue?
The only stupid question is the one not asked!

JonF

  • Professor
  • ****
  • Posts: 149
Re: EMSA File Format
« Reply #18 on: March 12, 2021, 09:59:59 AM »
Have you notified JEOL about this possible issue?

I haven't, but reading the EMSA format document, I don't think they've implemented it wrong:

Quote
#XUNITS      = Units for x-axis data, for example: eV.
#XPERCHAN        = The number of x-axis units  per channel.

I think DTSA-II is just assuming that the #XPERCHAN is in eV (on the basis that I've not messed up a configuration file somewhere, which is probably more likely!).

Nicholas Ritchie

  • Professor
  • ****
  • Posts: 141
    • NIST DTSA-II
Re: EMSA File Format
« Reply #19 on: March 12, 2021, 01:24:59 PM »
Can you send me an example of a failing file and I'll try to address the problem?  I already handle Oxford spectra which provide the offset and channel width in keV.  Shouldn't be a big problem.  DTSA-II should be able to read every well formed EMSA file.

"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

JonF

  • Professor
  • ****
  • Posts: 149
Re: EMSA File Format
« Reply #20 on: March 15, 2021, 02:44:10 AM »
Can you send me an example of a failing file and I'll try to address the problem?  I already handle Oxford spectra which provide the offset and channel width in keV.  Shouldn't be a big problem.  DTSA-II should be able to read every well formed EMSA file.

Hi Nicholas,

   Example of a .EMSA file attached.

   

jrminter

  • Professor
  • ****
  • Posts: 72
Re: EMSA File Format
« Reply #21 on: March 15, 2021, 04:04:49 PM »
Mike Matthews is correct: the standard permits XPERCHAN to be in eV or keV. The EDS_Cu_ReducedAperture.EMSA file has the line "#XUNITS      : Energy [keV]" in the file. The line should read: "#XUNITS       : keV". The prerelease version of DTSA-II Microscopium properly loads the spectrum. I hope this helps...

 

JonF

  • Professor
  • ****
  • Posts: 149
Re: EMSA File Format
« Reply #22 on: March 16, 2021, 04:59:04 AM »
Mike Matthews is correct: the standard permits XPERCHAN to be in eV or keV. The EDS_Cu_ReducedAperture.EMSA file has the line "#XUNITS      : Energy [keV]" in the file. The line should read: "#XUNITS       : keV". The prerelease version of DTSA-II Microscopium properly loads the spectrum. I hope this helps...

Yep, you're right - if I change the #XUNITS from "Energy (keV)" to "keV" and leave the #XPERCHAN as 0.01, DTSA-II loads the file correctly. I'm using the public (e.g. not the pre-release) of Microscopium.

Nicholas Ritchie

  • Professor
  • ****
  • Posts: 141
    • NIST DTSA-II
Re: EMSA File Format
« Reply #23 on: March 16, 2021, 05:49:02 AM »
I've changed the code so that if "keV" is anywhere in the #XUNITS value, the energy scale and offset are interpreted as keV rather than eV. The updated version of DTSA-II is available here.
"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

JonF

  • Professor
  • ****
  • Posts: 149
Re: EMSA File Format
« Reply #24 on: March 19, 2021, 04:40:33 AM »
Brilliant, thank you!

Playing around with it quickly and it seems to load the files fine.