stonerlab / Stoner-PythonCode

Stoner Python module repository
GNU General Public License v3.0
19 stars 13 forks source link

XRD reader #22

Open woodg07 opened 3 years ago

woodg07 commented 3 years ago

I tried to load a Brucker raw version 4 XRD file from one of our instruments but got the error below. Does this package support this format?

File "stoner_convert.py", line 2, in d=Stoner.Data.load('test_raw4.raw',filetype=Stoner.formats.instruments.XRDFile) File "/Users/geoffwood/anaconda3/lib/python3.8/site-packages/Stoner/Core.py", line 2176, in load filename = self.file_dialog("r") AttributeError: 'str' object has no attribute '_DataFilefile_dialog'

gb119 commented 3 years ago

That's interesting - it shouldn't do that! What version of the package are you using (Stoner.__version__)? I think the underlyng problem might be that the XRDFile type is designed to handle DQL files - I suspect that your .raw file may not be readable and it is a consequence of that that is making it fall through to the error - although it shouldn't have crashed out in that particular way!

woodg07 commented 3 years ago

It's '0.9.6' and I'm using python 3.8. the raw4 format is relatively new incantation from Bruker. We also have a D8 so was crossing my fingers that you had the same format...perhaps not. Can I upload a test file here to see if it works for you?

woodg07 commented 3 years ago

You have to change the extension.... test2_raw4.raw.txt

gb119 commented 3 years ago

Ok, I'll take a look at it. We're getting a new Brucker machine soon so I guess it will be useful to implement the format if I can find the specs somewhere...

gb119 commented 3 years ago

Doesn't look wildly hopeful, mainly people are pointing at the (closed source) PowDLL convertor, but that seems to be not totally reliable for Bruker RAW4 formats. I've also found https://gsas-ii.readthedocs.io/en/latest/_modules/G2pwd_BrukerRAW.html from which I can reverse engineer a reader for RAW1-3. I suppose when we get our new system I could ask Brucker for the tech specs of the format, but I having a suspicion that they'll either need an NDA or a lot of money...!

woodg07 commented 3 years ago

OK, well thanks for taking a look. Let me know if you have any luck!