News:

:) To see the latest forum posts scroll to the bottom of the main page and click on the View the most recent posts on the forum link

Main Menu

EMSA File Format

Started by John Donovan, June 27, 2015, 12:24:23 PM

Previous topic - Next topic

jrminter

If you want to open that spectrum with DTSA2, you will need to manually change the eV/channel to 10.0 ...

JonF

Quote from: jrminter 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 ...

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.


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

Quote from: JonF on March 11, 2021, 06:37:43 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

Quote from: Probeman on March 12, 2021, 07:09:33 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

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

Quote from: NicholasRitchie 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.

Hi Nicholas,

   Example of a .EMSA file attached.

   

jrminter

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

Quote from: jrminter 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...

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

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

Brilliant, thank you!

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