Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening Bruker .bcf micro-XRF files #19

Open
jat255 opened this issue Sep 18, 2017 · 10 comments
Open

Opening Bruker .bcf micro-XRF files #19

jat255 opened this issue Sep 18, 2017 · 10 comments

Comments

@jat255
Copy link
Member

jat255 commented Sep 18, 2017

I have a colleague who is interested in doing some analysis on x-ray florescence data with HyperSpy. The data is saved by Bruker in a .bcf file (the same as the EDS maps implemented by @sem-geologist).

Unfortunately, the existing reader cannot handle these files, and I am starting to look into what it would take to get them opened. I'm currently awaiting word whether or not I can share his example data file, but I figured I'd get the discussion started here.

@sem-geologist, did you ever get any documentation about the .bcf format from Bruker, or was it all achieved by reverse engineering the from the file?

@jat255
Copy link
Member Author

jat255 commented Sep 19, 2017

An example .bcf file containing the microXRF data can be downloaded here.

@sem-geologist
Copy link
Contributor

All was achieved by pure reverse engineering. I had for short moment some pascal windows dll, but it is of zero use for multi-platform (also it looked allready terrible buggy with memory leaks). Also as Bruker tends to use terrible pascal libraries, which do not keep standards (e.g. XML tags starting with number; and as lately found out decimals serialized into XML with comma (e.g. 3,14) , instead dot (e.g. 3.14)).
There are some ugly hacks already in bcf library due to lazy implementations of Bruker neglecting any standards.
I will look into the file, but at this moment I guess it will be very similar to what is already in EDS with additional XRF parameter information, and will update the status here.

@jat255
Copy link
Member Author

jat255 commented Sep 26, 2017

Before you go into too much effort, I've gotten reading the XRF data working in a hacky sort of way. The structure was very similar to the EDS data, with some minor differences in headers and such. Thanks for doing all of the hard work!

I'll be putting up a PR in the next few days hopefully with my implementation of the XRF reader for discussion.

@sem-geologist
Copy link
Contributor

ok, then I will wait.
I am just wandering if µXRF and normal electron beam EDS can be done at the same time (that will hint if both headers: µXRF (which contain volatage of X-ray, angle and other parameters) and ESMA (which contain normal electron column data). if not that would simplify the implementation a lot.

@sem-geologist
Copy link
Contributor

sem-geologist commented Sep 27, 2017

Don't forget to ask your friend for minimal bcf example for tests. The easiest way to do that is through going to Esprit programing window (Alt+F2) and opening one of the tests in public Quantax User folder; in particular the hypermap example. There it is possible to set pixel dimensions bellow 100x75 (GUI implemented minimum pixel width). That way it is possible to produce e.g. 4x3 pixel hypermap which will take very little space, but will be perfect for tests.

@jat255
Copy link
Member Author

jat255 commented Sep 27, 2017 via email

@sem-geologist
Copy link
Contributor

@jat255 , are you still doing the μXRF implementation? Some very important changes were made to bcf library: lxml was dropped and replaced with built-in xml.etree.ElementTree (see hyperspy/hyperspy#1750).

@jat255
Copy link
Member Author

jat255 commented Oct 11, 2017

@sem-geologist Yes, I am. This is what I get for going away for a week... a whole new code base to work from! I'll take a look at it in the next few days. I'm still waiting for that small testing map from my colleague here, so my PR isn't ready yet anyway.

@sem-geologist
Copy link
Contributor

sem-geologist commented Oct 13, 2017

I think You could find this useful:
https://gist.github.com/sem-geologist/0f733b27fb7a64528c7b5b9a726ec8ad
BTW, I think this implementation needs quite more work than it looks, general XRF mode should be added alongside SEM and TEM, so that metadata would be meaningfully displayed and used.
@francisco-dlp , what do you think?

@jat255
Copy link
Member Author

jat255 commented Oct 13, 2017

Thanks for that, and I agree. A proper implementation would create an XRFSpectrum class, I think. That's perhaps a bit more than I can take on right at this moment, but I'll look into it after I fix up the XRF reader. changing it to return a different class should not be too hard, anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants